Go to Post This our big chance to spread the word and change the culture, let's not waste it. So in the words of one Leroy Jenkins, "Time's up, let's do this." - Frenchie461 [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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 12-03-2015, 12:05
sanelss sanelss is offline
Registered User
FRC #1658
 
Join Date: Dec 2012
Location: saint louis
Posts: 258
sanelss is a splendid one to beholdsanelss is a splendid one to beholdsanelss is a splendid one to beholdsanelss is a splendid one to beholdsanelss is a splendid one to beholdsanelss is a splendid one to behold
Roborio RS-232 port issue

X-post: http://www.chiefdelphi.com/forums/sh...d.php?t=135713

Trying to get an arduino to talk to roborio over the serial port and having some issues.

on the arduino side i have:

Serial.write(0);
Serial.write(1);
Serial.write(2);
Serial.write(8);


and on roborio side I get:

0
253(0b11111101)
251(0b11111011)
239(0b11101111)

as far as i'm aware the arduino uses 8 data bits, no flow control, and 1 stop bit, in labview I have the same configuration on the serial>open vi

it seems as though the bits are inverted and off by one place. This is not the first time I've run into a communication issue, the i2c interface also has a very similar issue where the address bits are shifted the wrong way and was able to work around that. on here it looks like it can also be worked around but looks like 1 bit of data will be lost...

Anyone have any ideas how to fix this?

Edit:Looks like it's just an issue with the logic levels, the rs-232 port is not ttl compatible and needs a level shifter circuit. In my case since it's only 1 way communication I can just use an inverter and should work

Last edited by sanelss : 12-03-2015 at 12:17.
Reply With Quote
  #2   Spotlight this post!  
Unread 12-03-2015, 12:28
jman4747's Avatar
jman4747 jman4747 is offline
Just building robots
AKA: Josh
FRC #4080 (Team Reboot)
Team Role: CAD
 
Join Date: Apr 2013
Rookie Year: 2011
Location: Atlanta GA
Posts: 418
jman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond repute
Re: Roborio RS-232 port issue

Quote:
Originally Posted by sanelss View Post
Edit:Looks like it's just an issue with the logic levels, the rs-232 port is not ttl compatible and needs a level shifter circuit. In my case since it's only 1 way communication I can just use an inverter and should work
Yes RS-232 is +15V to to -3V. The arduino is TTL UART at 5V. Conjecture, use the UART on the MXP port. Also note that the dedicated I2c, MXP I2c pins, and MXP UART are all at 3.3V. Using a 3.3 volt arduino or Bi-directional I2c safe level shiftier is necessary for I2c.
__________________
---------------------
Alumni, CAD Designer, machinist, and Mentor: FRC Team #4080

Mentor: Rookie FTC Team "EVE" #10458, FRC Team "Drewbotics" #5812

#banthebag
#RIBMEATS
#1620
Reply With Quote
  #3   Spotlight this post!  
Unread 12-03-2015, 12:40
sanelss sanelss is offline
Registered User
FRC #1658
 
Join Date: Dec 2012
Location: saint louis
Posts: 258
sanelss is a splendid one to beholdsanelss is a splendid one to beholdsanelss is a splendid one to beholdsanelss is a splendid one to beholdsanelss is a splendid one to beholdsanelss is a splendid one to behold
Re: Roborio RS-232 port issue

Quote:
Originally Posted by jman4747 View Post
Yes RS-232 is +15V to to -3V. The arduino is TTL UART at 5V. Conjecture, use the UART on the MXP port. Also note that the dedicated I2c, MXP I2c pins, and MXP UART are all at 3.3V. Using a 3.3 volt arduino or Bi-directional I2c safe level shiftier is necessary for I2c.

What I did was use software serial which supports inverted logic so I don't need to change pins or use any additional hardware on the arduino. the port can handle higher voltage so i just shove the tx line from arduino to the rx on roborio, i only care about one way communication so I don't need to worry about the -V output of the roborio. the i2c device we use has open collector output and I just pulled it up to the 3.3V rail so no problems on that end.

I just got it working as expected though a bit annoying to figure out!
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 10:19.

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