Page 1 of 1

uart level_test fails (start bit is a glitch)

Posted: Tue Aug 04, 2015 10:03 am
by sprajagopal
Hi,
I am using the following github code for uart.

https://github.com/xcore/sc_uart/blob/m ... rx_impl.xc

I am probing the variable level_test (line 256), and I keep getting level_test = 1, which means the loop skips this iteration. I'm not sure why level_test remains 1 for me. I think this could be because my UART line is in idle high state during this time. But I'm definitely sending data into it. So, what exactly could be happening here?

Thanks,
Prasanna.

Re: uart level_test fails (start bit is a glitch)

Posted: Fri Aug 07, 2015 5:55 pm
by larry
What is your sender in this test? Do you have a logic analyzer trace that shows the stop bits?

Re: uart level_test fails (start bit is a glitch)

Posted: Sun Oct 04, 2015 6:52 am
by sprajagopal
I haven't probed the pins through an oscilloscope. But the problem set itself right.
But related to this, sometimes my uart rx server reads 255's when the line is idle. Is this normal? Actually, this is fine as long as the data is read properly but sometimes there are 255s in between the data. My suspicion is that the line stays idle but the server reads 255s at these times.

P.S. I don't have a communications background so I just have some intuitive ideas about comms.

Re: uart level_test fails (start bit is a glitch)

Posted: Tue Oct 06, 2015 12:32 am
by babazaroni
Could be the xmos is detecting a glitch on the rx line and thinks a start bit has happened, then clocks in the rest of the data as 0xFF. Maybe add another port read to make sure it's not a glitch.