Go Down

Topic: Serial write/read (Tx/Rx) problem on Arduino Uno (Read 1 time) previous topic - next topic

nkdy

I know this is a pretty specific question, but I'm hoping someone here has some insight.
So I'm working on a program to do serial input/output (on the Rx/Tx lines) of the arduino. Simply, you type "1" into the serial monitor, and it puts out "one", etc.
So in testing our programs out in class, we noticed that a program with settings for the Duemilanove did NOT work for the Uno. When debugging, a student noticed that the ASCII character (which has the most significant bit zeroed) seemed to be high on the Uno. (That is, when typing in a "H", the code read in should have been 0x48 according to ASCII tables, but instead was 0xC8).
Because both boards use the ATMega328 chipset, my instructor seems to think the Uno's USB-to-RS-232 converter chip is setting that bit high, but no one knows.
We managed to figure out a solution, but my question is, does anyone know the hardware setup that would cause this? By masking the RX ISR with 0x7F, it forces a 0 into the MSB of every byte. But we want to know what is happening at the HARDWARE level.
To my understanding, the USB to serial on the Uno uses the ATMega8U2 chip, whereas the Duemilanove uses the FTDI FT232RL chip. However, I can't find anything that says there are major differences, other than not having to use drivers for the ATMega8U2.
Can anyone add some insight?

retrolefty

Could you post your complete sketch first before we guess at your symptom.

Lefty

nkdy

I might be wrong, but I don't think this involves a sketch (and my sketch isn't done, anyways).  I'd more just like someone to point me towards a website or a schematic that could show the difference between USB-to-serial converters on the Uno and Duemilanove. (Or, if anyone has noticed this problem before).   
I can still post the code I have done, if you want.

Coding Badly

Quote
I might be wrong, but I don't think this involves a sketch


Giving the fact that there are literally hundreds (or even thousands) of people using the Uno who do not have this problem there is a very good chance that you are wrong.  The most logical and time efficient place to start troubleshooting is with your Sketch.  Post your Sketch if you'd like help.

A few other things that would be helpful to post...

Operating system?

Terminal application?

Nick Gammon


Because both boards use the ATMega328 chipset, my instructor seems to think the Uno's USB-to-RS-232 converter chip is setting that bit high, but no one knows.


You ran the absolutely identical sketch? May we see it?

In any case the high-order bit being high sounds to me like the wrong number of bits. Serial has LSB first and MSB last, and the MSB is followed  by the stop bit which is a 1. So if you configured the port to use 7 data bits you would get those symptoms.

Does the class run to a logic analyzer? You might be able to see what is actually arriving.

Go Up