|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Serial Communication (Java)
My team is currently working on getting a new on-board computer for vision tracking working with our robot. We wanted to get two way communication between both the rio and the on-board computer. The obvious choice for us was serial communication. We are currently using robo-realm vision tracking which conveniently has a built in serial output. Also we want to stay far away from Network tables because it does not work as consistently as we would like, and we want to save the extra Ethernet port on the bridge.
We currently have
The issues we are currently having is that when we try to read the serial in the robot we get strange mix of characters that always starts with [@. and never seems to match up with the output from the on-board computer. So overall my question is how to read the info coming into the RS-232 port on the Robo-Rio ? |
|
#2
|
||||
|
||||
|
Re: Serial Communication (Java)
Why not communicate over ethernet? RoboRealm's network tables module is designed for this
http://www.roborealm.com/help/Network_Tables.php |
|
#3
|
||||
|
||||
|
Re: Serial Communication (Java)
To answer the original question, the AdaFruit cable you linked is meant for TTL level signals, whereas the RS-232 port uses much higher voltages. The RoboRIO does have a TTL UART port, but it's in the MXP port (pins 10 and 14, see the user manual).
|
|
#4
|
|||
|
|||
|
Re: Serial Communication (Java)
Quote:
We chose this one because it has solderable pads, so we didn't have to connect to the pins of a serial connector. It's reasonably easy to code with in C++. I don't know about coding it in Java, but it should be similar. Last edited by FlamingSpork : 08-08-2016 at 09:24 AM. Reason: Adding detail. |
|
#5
|
|||
|
|||
|
Re: Serial Communication (Java)
When we purchased this cable I made sure that it would be comparable with the 3.3 CMOS logic of the roborio.
On adafruits website they have a quick note on it saying "Note that we call this a "TTL cable" (since that's what they're called) but technically it's CMOS logic." |
|
#6
|
|||
|
|||
|
Re: Serial Communication (Java)
The Rio runs RS-232 at ±12 Volts (approx), while TTL is ±3.3 or 5. A 3.3V signal isn't enough to trigger a RS-232 circuit.
https://www.sparkfun.com/tutorials/215 |
|
#7
|
|||||
|
|||||
|
Re: Serial Communication (Java)
You might try inverting the signal. I have found when converting from TTL to RS-232 this is needed. It just depends on your hardware.
-Hugh |
|
#8
|
|||
|
|||
|
Re: Serial Communication (Java)
You could use a USB to Ethernet adapter on the RoboRIO and connect over Ethernet that way.
|
|
#9
|
||||
|
||||
|
Re: Serial Communication (Java)
Or just use the second ethernet port on the radio
|
|
#10
|
|||
|
|||
|
Re: Serial Communication (Java)
OP wants to avoid using that.
|
|
#11
|
||||
|
||||
|
Re: Serial Communication (Java)
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|