UART output doubled?

Discussion about my Wifi Radio project at http://mightyohm.com/wifiradio/ or my WL-520gU talk at NOTACON.
Post Reply
BuffaloM
Posts: 2
Joined: Thu Apr 07, 2011 6:27 pm

UART output doubled?

Post by BuffaloM »

I went to test that my serial port was working after loading OpenWRT and saw garbled output at 115200, 8N1. Looking at the Hex values for the output though shows that the values are doubled. For example, if I echo "0123\n" > /dev/ttyS0 on the Asus, I see 60 62 64 66 1A 14 in the hex output. I would have expected 30 31 32 33 0d 0a. Which means that everything is showing up doubled. Another example: F should be 0x46. When I send FF to ttyS0 I see 8C 8C not 46 46. So to get an F ascii to show up, i would need to put in what ever is half of F (0x23) which is #. Sure enough sending #### displays FFFF on the screen and 46 46 46 46 in hex.

What is causing this and is there anything I can do to fix it before I hook up the display and controls?

Thanks
User avatar
mightyohm
Site Admin
Posts: 1064
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

Re: UART output doubled?

Post by mightyohm »

Are you using the Openwrt images I provide on this site?

What program are you using on the PC side of things?

What USB-serial adapter?

Did you modify any stty settings?

I have never seen this before, but it's a very interesting problem.... :ugeek:
BuffaloM
Posts: 2
Joined: Thu Apr 07, 2011 6:27 pm

Re: UART output doubled?

Post by BuffaloM »

I'm using openwrt backfire 10.03-1-rc4. Dropping the baud rate down to 9600 with stty (and of course changing the baud rate used by screen on the receiving end to match) seems to have made the issue go away. Since communication with the microcontroller needs to be at 9600, I guess it was a non-issue. Threw me for a loop to start things off though!
User avatar
mightyohm
Site Admin
Posts: 1064
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

Re: UART output doubled?

Post by mightyohm »

That is really weird!
Post Reply