Go to Post Everyone here inspires each other and helps them out. That's why FIRST is amazing. - tiffany34990 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 07-08-2016, 23:49
NetArcX NetArcX is offline
Registered User
FRC #1816 ("The Green Machine")
 
Join Date: Jun 2015
Rookie Year: 2014
Location: Edina, Minnesota
Posts: 6
NetArcX is an unknown quantity at this point
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
  • A USB to UART cable from adafruit (https://www.adafruit.com/product/954)
  • turned off console out in the robo rio
  • have the baud rate from the on-board computer the same as the baud rate on the rio
  • have the Tx and the Rx ports swapped for communication between the two

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 ?
Reply With Quote
  #2   Spotlight this post!  
Unread 08-08-2016, 01:33
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
Team Role: Engineer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 689
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
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
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
Reply With Quote
  #3   Spotlight this post!  
Unread 08-08-2016, 01:39
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
Team Role: Engineer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 689
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
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).
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
Reply With Quote
  #4   Spotlight this post!  
Unread 08-08-2016, 09:23
FlamingSpork FlamingSpork is offline
Eating Utensil
FRC #3003 (Tan[X])
Team Role: Programmer
 
Join Date: Nov 2014
Rookie Year: 2015
Location: Canandaigua, NY
Posts: 64
FlamingSpork is just really niceFlamingSpork is just really niceFlamingSpork is just really niceFlamingSpork is just really niceFlamingSpork is just really nice
Re: Serial Communication (Java)

Quote:
Originally Posted by RyanCahoon View Post
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.
You could use a RS-232 to TTL adapter board based on the MAX3232 chip (most are), like this one: https://www.amazon.com/Mini-RS232-Co...ywords=max3232

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. Reason: Adding detail.
Reply With Quote
  #5   Spotlight this post!  
Unread 08-08-2016, 13:40
NetArcX NetArcX is offline
Registered User
FRC #1816 ("The Green Machine")
 
Join Date: Jun 2015
Rookie Year: 2014
Location: Edina, Minnesota
Posts: 6
NetArcX is an unknown quantity at this point
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."
Reply With Quote
  #6   Spotlight this post!  
Unread 08-08-2016, 16:01
FlamingSpork FlamingSpork is offline
Eating Utensil
FRC #3003 (Tan[X])
Team Role: Programmer
 
Join Date: Nov 2014
Rookie Year: 2015
Location: Canandaigua, NY
Posts: 64
FlamingSpork is just really niceFlamingSpork is just really niceFlamingSpork is just really niceFlamingSpork is just really niceFlamingSpork is just really nice
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
Reply With Quote
  #7   Spotlight this post!  
Unread 10-08-2016, 11:50
Hugh Meyer's Avatar
Hugh Meyer Hugh Meyer is offline
Registered User
FRC #1741 (Red Alert Robotics)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Greenwood Indiana
Posts: 158
Hugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud of
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
Reply With Quote
  #8   Spotlight this post!  
Unread 10-08-2016, 12:27
adciv adciv is offline
One Eyed Man
FRC #0836 (RoboBees)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Southern Maryland
Posts: 478
adciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to all
Re: Serial Communication (Java)

You could use a USB to Ethernet adapter on the RoboRIO and connect over Ethernet that way.
__________________
Quote:
Originally Posted by texarkana View Post
I would not want the task of devising a system that 50,000 very smart people try to outwit.
Reply With Quote
  #9   Spotlight this post!  
Unread 11-08-2016, 00:41
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
Team Role: Engineer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 689
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
Re: Serial Communication (Java)

Quote:
Originally Posted by adciv View Post
You could use a USB to Ethernet adapter on the RoboRIO and connect over Ethernet that way.
Or just use the second ethernet port on the radio
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
Reply With Quote
  #10   Spotlight this post!  
Unread 11-08-2016, 11:00
adciv adciv is offline
One Eyed Man
FRC #0836 (RoboBees)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Southern Maryland
Posts: 478
adciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to all
Re: Serial Communication (Java)

Quote:
Originally Posted by RyanCahoon View Post
Or just use the second ethernet port on the radio
OP wants to avoid using that.
__________________
Quote:
Originally Posted by texarkana View Post
I would not want the task of devising a system that 50,000 very smart people try to outwit.
Reply With Quote
  #11   Spotlight this post!  
Unread 12-08-2016, 00:10
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
Team Role: Engineer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 689
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
Re: Serial Communication (Java)

Quote:
Originally Posted by adciv View Post
OP wants to avoid using that.
Ah, I missed that
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 00:14.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi