Hello everyone. I'm totally new to this so please forgive my ignorance here... I'd like to use an Arduino with a display shield to build a device to communicate with a motor controller using 5V TTL, the query/replies are in HEX. This seems like the kind of thing that must have been done before, so I would much appreciate it if someone could suggest a good way to start.
Hi Jim. That is a very high-spec display! It is not suitable for a beginner's first Arduino project. It will be difficult to use and probably no-one here on the forum will be able to help you when you find you are out of your depth trying to get it to work. Even if you eventually get it to work with an Uno, the Uno's capabilities are much too limited to do justice to such a display.
I suggest you choose a far more basic display such as a 16x2 or 20x4 character LCD and some simple mechanical buttons, pots or maybe a rotary encoder for controls.
You need to focus on the basics while you begin to learn and not be distracted by shiny stuff.
Your description of the motor controller does not tell us much. "TTL" is a pretty meaningless term simply indicating that it communicates with 5V digital logic signals, which could be any one of several protocols. The term "HEX" is also pretty meaningless. What you need to share is a link to the specs or data sheet for the controller.
Hi Paul, thanks for the help. I'm a little relieved to hear that because that display is not cheap! I'm looking for something about that size though (4"-ish) and sunlight readable, otherwise I don't think it's critical. Here's the datasheet:
I've verified that the "Query" string is working and that the "Reply" is valid according to the datasheet using a USB-5V TTL converter to talk to the controller with my laptop.
For example, I've sent "fe 00 01 01" to ask for voltage and received "fe 00 01 00 00 01" from the controller to indicate 0V.
I'd like to do this:
-Automatically send Requests 1 through 11 on start-up
-Receive the Replies and put them through a logic/math process to decipher and check for errors
-Display them
-Repeat as quickly as possible to reduce the latency of the display
My apologies if I'm not using the right language to describe my goal, this isn't my field (not even close). But, I'm digging into the tutorials and making progress.
Hopefully this makes sense, if not please let me know what else I can provide.
There is no such display. Every electronical display has its limits in full sunshine. Work on the housing of the display, how to keep the sunshine away from it.
Use an I2C communicating display, 2 by 16 or 4 by 20, and the lib down in the snippet:
Drop the TTL. You clearly tell confusion by using it.
For an easy project use logic that use 5 volt levels. (There are 3.3 volt stuff and they need extra, complicating, hardware to match.)
Nearly al modern VLSI is one or the other kind of CMOS down in the silicon. There was/is HMOS, HCMOS, CMOS and the old fashioned TTL... Luckily CMOS now days contains the safety of the stone age logic that was named TTL.
I don't think that is really true. "Tranreflective" displays such as on the OLPC are designed to work in sunshine. Precisely how durable they are if left out continuously, well that may be another story.
I wholeheartedly agree. TTL logic levels are not compatible with common 5 V logic - there is a whole line of logic - "74HCT" specifically designed to work with the obsolete TTL logic, but now very useful for interconnecting with increasingly common 3.3 V logic.
Do not use the term "TTL" unless you understand a very specific reason for something unusual.
I can't open it. Please attach the data sheet itself to your post using the file upload icon.
Ok, I think you are talking about a usb-serial (UART) adaptor. Can you please confirm?
I had a quick look on eBay. 40x4 character LCD displays start at less than £5. Unfortunately, the only versions I could find that claimed to be "transflective" started at more like £40, which does not seem great value. I suggest for now just getting a cheap non-transflective display to experiment with
This is good stuff, thanks for all the input. I know I'm not speaking in the right terms yet so that's a source of my confusion. The system won't allow me to upload anything yet since I'm too new, but I suspect that that will be short lived. I'll post the datasheet shortly...
Paul, I'm using the UART adapter that you've described to talk to the controller. I also got an oscilloscope, which I used to verify what I'm seeing.
I suppose step one is to get a UNO and a cheap display and start figuring it out (and keep the smoke in)?
Please do not get a UNO unless you have a "shield" that you need to use with it.
The Nano is far more practical (and cheaper), can be used with a "solderless breadboard" and then mounted to stripboard or a "terminal adapter" (or your own PCB) for final, permanent use.
I was planning on using a shield type display and putting it into a box so that I would have a compact, durable-ish unit to mount in a panel. Please set me straight on this if I'm mistaken.
You mean this one?
Plausible, how easy it is to use the buttons when mounted in a box I don't know. The potentiometer (also with a wiring mistake FWIW) could also be a problem.
And it also depends on what other components you wish to use with it.
Note the problem with some of those display shields.
Something like that would be sufficient to get started, I've seen them cheap on Amazon. I wouldn't need any buttons as I hope to simply display the data received from the serial input after doing some translation.
Here's the datasheet for the controller. I'd be interested in your opinions on getting the commands in and out of the Arduino.
I do not find anything on Amazon "cheap". Maybe in the US if there is some "free shipping" deal.
If you do not need buttons, you do not want that shield. You want a display with an I²C "backpack" and you just wire the four connections to your Nano.
Sorry, no further help as I must go back to bed to get some sleep.
Sounds pretty straight forward. You seem to have got the hang of sending the query and receiving the response. I must say I found that part of the data sheet confusing.
How did you do that exactly? With an app on PC? Did you type hex digits and spaces like that, or code something in python or...?
Either way, should be easy to replicate in Arduino code.
Another alternative to Nano would be a Pro Micro (don't confuse with Pro Mini). The advantage of Pro Micro would be its extra UART interface. The Nano has only one UART interface which is used for sketch upload and serial monitor. You would need to use a Software Serial library to make a second UART interface with Nano. But that would also be fine I think, the motor controller uses a very slow 4800 baud/data rate.