UART bitshift not behaving

New to XMOS and XCore? Get started here.
Post Reply
User avatar
msar
Member++
Posts: 19
Joined: Wed Sep 08, 2010 11:04 am
Contact:

UART bitshift not behaving

Post by msar »

I noticed some odd behavior testing leon_heller's simple UART code. When using the version that takes 10 bytes, and then returns them, it seems like every second byte gets bitshifted one too many places. What might be going on here?

This is example I/O from the terminal emulator I'm using:

Code: Select all

Data sent: 00000001 
Data sent: 00000001 
Data sent: 00000001 
Data sent: 00000001 
Data sent: 00000001 
Data sent: 00000001 
Data sent: 00000001 
Data sent: 00000001 
Data sent: 00000001 
Data sent: 00000001 
Data received: 00000001 00000001 10000000 10000000 01000000 01000000 00100000 00100000 00010000 11111000
The last byte makes especially little sense to me - any clues as to why this might happen?


User avatar
leon_heller
XCore Expert
Posts: 546
Joined: Thu Dec 10, 2009 10:41 pm
Location: St. Leonards-on-Sea, E. Sussex, UK.
Contact:

Post by leon_heller »

I just tried it with the latest 10.4.2 tools, and there does seem to be a problem with it, now. Whatever I type, it returns the same value, changing each time I run it!

I'll look into it.
Post Reply