Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Roborio RS-232 port issue (http://www.chiefdelphi.com/forums/showthread.php?t=135714)

sanelss 12-03-2015 12:05

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

jman4747 12-03-2015 12:28

Re: Roborio RS-232 port issue
 
Quote:

Originally Posted by sanelss (Post 1456913)
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.

sanelss 12-03-2015 12:40

Re: Roborio RS-232 port issue
 
Quote:

Originally Posted by jman4747 (Post 1456932)
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!


All times are GMT -5. The time now is 10:19.

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