LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA Serial Communication

Hi,

I need to interface a GPS module to my sbRIO. The GPS module sends data serially (UART-RS232). The RS-232 port available on sbRIO which is connected to RT side is already used by a wireless module I am using.

I have searched different threads and LV example implementing RS-232. Just for the sake of testing, I connected one DIO of my sbRIO to the Tx pin of arduino and tried receiving some data but nothing happens. The baud rate, parity bits and other parameters are all identical for both arduino and sbRIO.
Am I making some kind of blunder here. Help needed.

Thank you. 
 


0 Kudos
Message 1 of 13
(4,576 Views)

Hi NapDynamite,

 

You should be able to implement serial communication using the DIO pins on your sbRIO. I located an example that looks like it implements the serial communication on the FPGA using the DIO pins of an sbRIO:

 

http://www.ni.com/example/27164/en/

 

If that example isn't working for you, could you provide some details about your setup and how you have the Arduino wired to the sbRIO?

 

Best Regards,

Matthew B.
Senior Product Manager - NI InsightCM™ and Monitoring Solutions
National Instruments
0 Kudos
Message 2 of 13
(4,458 Views)

I applied the same code to the FPGA but didn't work. I have wired the Tx pin of arduino to the Rx on sbRIO (DIO pin as dedicated). Matched the comm settings(baud rate, parity bits, flow control etc) on both sides. 
When I run arduino and send a serial string, the sbRIO is not recieving anything. 


0 Kudos
Message 3 of 13
(4,447 Views)

Hi NapDynamite,

 

If you connect the Arduino to the computer, are you able to see the data using a terminal program such as HyperTerminal or PuTTY? I haven't run the code in that example, but do you know where the code is caught (it's most likely waiting for the start bit)?

 

Regards,

Matthew B.
Senior Product Manager - NI InsightCM™ and Monitoring Solutions
National Instruments
0 Kudos
Message 4 of 13
(4,395 Views)

I can view the serial outut of serial terminal but cannot view the output on string indicator on LabVIEW front panel.
Let me check again and I will reply. 🙂


0 Kudos
Message 5 of 13
(4,353 Views)

OK, so is it really necessary to connect the ground pin of arduino to GND of my sbRIO? While communicating via RS232? 


0 Kudos
Message 6 of 13
(4,226 Views)

@NapDynamite wrote:

OK, so is it really necessary to connect the ground pin of arduino to GND of my sbRIO? While communicating via RS232? 


YES!!!  You need to make sure the grounds between two devices are the same, especially if they are using a common bus.  Otherwise weird things will happen.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 13
(4,224 Views)

*sigh*
The RS232 code over FPGA doesn't seem to work after lot of tries. Connected the DIO pin of sbRIO to the Tx pin of arduino and ground pins to ground, but the string indicator over RT side is blank. 

Serial configurations on both ends is the same. I don't know what seems to be the case. 


0 Kudos
Message 8 of 13
(4,195 Views)

Hi NapDynamite,

 

If you scope the lines, do you see activity and the data flowing over the lines?

 

Regards,

Matthew B.
Senior Product Manager - NI InsightCM™ and Monitoring Solutions
National Instruments
0 Kudos
Message 9 of 13
(4,165 Views)

Yes. Tried that as well. Both on FPGA and RT side but ALAS! 
I think I need to revisit all the VIs and code for this protocol over the FGPA side. This is going to take some serious time but I have no other way of doing this. 


0 Kudos
Message 10 of 13
(4,138 Views)