Reading signal via UART

Applications, development tools, FPGA, C, WEB
Post Reply
adam.polak
Posts: 37
Joined: Mon Jul 28, 2014 11:32 am

Reading signal via UART

Post by adam.polak » Sun Dec 06, 2015 9:57 pm

Hi!

I have a quick question - I'm using UART protocol to connect external device to RedPitaya. I started with the example C file provided on the web page. It works very well to send the demo string when tx and rx on RedPitaya are directly connected. For my application I had to modify a little writing function and then I was able successfully send information out from RedPitaya. However, after long time of try and error I failed to receive the signal to RedPitaya. When I run this C app it awaits the data like there would be no data available, while I'm sure that the device is sending a signal. The example of the signal structure to be received is like this:

0x70 0x34 0x33 0xff 0xff 0xff

... so it's basically ascii code of number 43 with initialization and ending characters from the device (where data property is as string) .
I expect there is probably something in the C code responsible for reading that it does not read/see/recognize this data and all the time awaits for the data to become available.
If I type this set of characters between quotes " ...." in the original example app and send it directly from RP's tx to RP's rx then I can see it received, but send from external device is not recognized :(

I don't know what I can modify so if anybody would have any idea I would be grateful !

adam.polak
Posts: 37
Joined: Mon Jul 28, 2014 11:32 am

Re: Reading signal via UART

Post by adam.polak » Mon Dec 14, 2015 2:11 pm

Hi

Short reply for my own question - just in case anybody would be looking at this in the future.
The answer was in the termios.h and use of ICRNL flag in the UART settings.

Thanks
Adam

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 99 guests