
jb_noob
Hi Folks
Unfortunately Brookshire's documentation on the RAPU is lacking many details. The short section on controlling with serial is fine, if you are connected to a COM serial port with an ancient DB9 straight-through cable (or USB-to-RS232 converter). Pull up RealTerm or similar, set the 19200 baud rate, and power up the RAPU. Console shows the boot up and the command prompt is hot and ready in your terminal window. Commands work exactly like they are shown in the manual.
NOW...
Get that to work with your microcontroller.
Yes, you will need a TTL-to-RS232 converter (5V level).
Yes, you need to code a "serial wrapper".
Yes, you should be able to use the same command in the manual through serial communication from your controller to the RAPU.
It doesn't work!
I have been fighting this for a good long time, love some tips or to hear some success stories.
Here's where I'm at:
- I can "see", using a serial monitor window, all commands and boot-up text and an active prompt
- Despite using CRLF formatting it trips-up the input commands. For example it will not take in an "a". So if I type in "play" it reads "ply" and reports that it is an unrecognized command.....DUH!
For the record YES, I'm sending 8-bit, no parity, one stop bit at 19200 baud.
Seems like there something else a tiny bit off. For fun I tried shifting the baud rate. No real significant changes from about 19100 to 19300, outside that is gibberish.
Soooo close!
Ideas?
TIA!
Command OK: $$1. Terminator set to CRLF
Sent: 0x3E(>) 0x3E(>) 0x3E(>) 0x70(p) 0x6C(l) 0x61(a) 0x79(y) 0x0D 0x0A
Sent: 0x0D 0x0A
>>> 0x3E(>)
>>> 0x9E()
>>> 0x70(p)
>>> 0xB1(±) 0x79(y) 0x8A() 0x0D
>>> 0x0A
>>> 0x75(u) 0x6E(n) 0x72(r) 0x65(e)
>>> 0x63(c) 0x6F(o) 0x67(g) 0x6E(n)
>>> 0x69(i) 0x7A(z) 0x65(e) 0x64(d)
>>> 0x20( ) 0x63(c) 0x6F(o) 0x6D(m)
>>> 0x6D(m) 0x61(a) 0x6E(n) 0x64(d)
>>> 0x3A(:) 0x20( ) 0x3E(>) 0x9E()
>>> 0x70(p) 0xB1(±) 0x79(y) 0x8A()
>>> 0x0D 0x0A 0x3E(>)
do you have the EZ-Script code ?
https://www.ez-robot.com/Community/Forum/Thread?threadId=5562
I call foul.
Did you get any support from brookshire on this?
Anybody out there a wiz at debugging RS-232 communications? I have consulted a few and they have never seen something like this.
you need to cut some variables, if you connect the RAPU via RS232-USB to a PC and then via terminal, does the RAPU works as expected ?
Computer to RAPU via DB9 cable (no converters): works
Code to computer via Serial communication windows works perfectly
Code to TTL-to-RS232 into RAPU: random character switching, no success.
Code works.
Multiple TTL-to-RS232 converters work, all providing the same results in both scenarios.
Gremlin is in RAPU.
Gotta kill the gremlin.
Did you tried different converters ?
The fix is to slow the code down when it is sending commands to the RAPU.
Typically the code will run a lot faster than your typing. The idea would be to send one character, wait a bit, send the next character, wait a bit, etc. I had a small 4 line LCD display that kept loosing text sent to it until slowed my code down. How often you need to wait is dependent on the buffer size in the RAPU and the speed of the RAPUs processor. It could take some tinkering with to figure out. Can't say for sure but that could be your problem.
The other way to wait is to send a letter and wait for that letter to be echoed back before sending the next letter.