LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

UART Communication with Microcontroller using Labview & USB 6509

Hello,

My requirement is to have Communication between tester(PC) and microcontroller via synchronous, serial interface. The tester(PC)
should receive one Byte from the microcontroller, with each Byte transmitted by the tester as a continues loop. Only the message(data)
should be able to change and the micocontroller should respond accordingly. I plan to do this via UART communication.

 

I have ordered USB 6509 DIO hardware for the above requirement. I have Labview 8.5 Full Development SW.

 

Please suggest how can I implement the communication part for the above?

 

Readily available Vi's are also appreciated.

 

Thanks and regards,

 

 Nick

 

 

0 Kudos
Message 1 of 12
(10,763 Views)
Why not standard labview serial communication?


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 2 of 12
(10,745 Views)

The 6509 is not capable of performing RS-232 communication rates. Better cancel your order.

 

As mentioned, you can use the serial functions in LabVIEW. You would just need an inexpensive USB-RS232 adapter and possibly a level shifter, depending on the voltage inputs of the micro.

0 Kudos
Message 3 of 12
(10,732 Views)

The 6509 will work for synchronous serial communications at 0-5V, but it lacks the built-in timing and control functions required to decode a serial stream.  With built-in timing, a burst of serial data can be recorded and decoded by the PC.  With an external clock function, the uC could strobe the data into the dio buffer.

 

You might be able to overcome these limitations by using a slow bit rate and a clock line.  I suggest utilizing the "change detection" function of the 6509 to acquire data on one edge of the clock.  Implement a start and stop bit for syncronization and combine the bits into a byte.

 

Look at the reference design for I2C communications to get started:

http://zone.ni.com/devzone/cda/epd/p/id/6080

 

Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.0, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
0 Kudos
Message 4 of 12
(10,710 Views)

 

Hello Everyone,

 

Thanks for the reply. Just for some additional Information I am using V850ES/Fx3 series microcontroller.

My requirement for byte sending & receiving is as follows.

 

Waveforms

I have installed the examples from the reference design and now am trying to implement them.

Thanks and regards,

 

Nick

 

 

0 Kudos
Message 5 of 12
(10,700 Views)

Hello All,

 

I also would like to add that the microcontroller ports i am using are IO ports.

 

Thanks and regards,

 

Nick

 

0 Kudos
Message 6 of 12
(10,687 Views)
Please resend your picture. I also have hunch that you have not reveal your actual question yet. The details so far have not been very informative. But generally speaking. Interfacing a a serial device in labview is an easy task on both sides. Especially  since you may write your own communication protocol. The hardest part in instrument communication is often to decode the protocol descriptionSmiley Very Happy 


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 7 of 12
(10,678 Views)

Hello,

 

You are correct I have to write my own communication protocol. The protocol is present on the microcontroller side (C Code), I have to implement in a similar way in Labview (Tester). As you can see from the attached waveforms the tester has to do the following:-

1) Send a Clock, 2) receive an clock echo, 3) send tester data out, 4) receive microcontroller data out.

 

As I have never implemented a serial comunication protocol, I am using this forum for all the help I can get. Earlier I was not sure of which protocol is to be implemented. But now I am sure I have to use SPI through USB 6509.

 

Please correct me if anything is wrong.

 

Thanks and regards,

 

Nick
0 Kudos
Message 8 of 12
(10,651 Views)
Some years ago I have to do something similar. We wanted to do some simple data communication PC to CPU board for test purposes. We ended up taken a small and cheap micro-controller, which we interfaced to the CPU board. Then we used RS232 from the microcontroller to the PC. The whole setup required 2 circuits, and was soldered up on a prototype board. At the end of the day the project worked as we wanted. If you do not like soldering you may pick up a cheap microcontroller test board. The cost very little compeered to your NI IO unit (USB 6509). I am just passing this as an idea. It may not fit your need.By the way are you sure you do not have a free UART port on your CPU board you can use for your testing


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 9 of 12
(10,634 Views)

Hello t06afre,

 

Thanks for the suggestion, but we do not have a free UART port on our CPU & also we should be able to test the CPU in an industrial enviornment. So we had selected the NI USB 6509.

 

Thanks for all the support to all, I will update once I have completed with the software.

 

Regards,

 

Nick 

 

0 Kudos
Message 10 of 12
(10,605 Views)