Jump to content
  • 0

Analog Discovery 2 UART Script - Example Sends Data, but Doesn't Receive


sgaetjens

Question

Hello,

     I'm trying to set up a serial port connection between my Analog Discovery 2 and my RaspberryPi 4B+.  When I open the "Protocol" window and manually send and receive data, everything seems to work.  But when I run the UART example script, no data gets received.

I'm using DIO 7 for TX and DIO6 for RX, my baudrate is 115200.  I have GND attached between the Pi and the AD2.  I'm running a python interpreter on my Raspberry Pi and just sending a simple "write" command each time I want to read data from the AD2.  e.g. ser.write(b'hello\r\n').  When I'm looking at the Protocol window and click "Receive", I see the word "hello" pop right in the window (see attached image titled "Protocol Working").

 

When I run the UART example script, nothing gets printed into my output window, even though I'm filling the buffer with several "hello\r\n" messages sent from my Raspberry Pi.

 

Note: I slightly modified the example based on the UART_initialize() function definition in this post:

 

When I read the buffer from the Raspberry Pi, I can read the messages being sent by the AD2.  I just can't read the messages from the Pi on the AD2.  I can transmit, but not receive.

Any idea what's going on?

Another clue might be that my logic analyzer does not work unless I change the source to "Scope".  Having the source set to "Digital" does not do anything.  Pictures attached.

Any assistance would be greatly appreciated!

Protocol Working.JPG

UART Example Script - doesn't work.JPG

Logic Analyzer - not working when sourced from digital.JPG

Logic Analyzer - working when sourced from scope.JPG

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...