SETUP : Axon that outputs '7' (decimal of 55) through UART at 2400 baud , 8 data bits, no parity, 1 stop bit, no handshaking.
FT232 reads output of Axon's UART and displays it in my Terminal program. Terminal is set to the correct setting to "talk" with the Axon.
I used this breakout board for the FT232 -
http://www.sparkfun.com/commerce/product_info.php?products_id=718All devices have a common ground.
When all the wires are connected and THEN the devices are all turned on , then I do in fact see the correct data being received in the Terminal window.
PROBLEM: Sometimes if I disconnect the Data wire from the Axon's UART pins and then plug it back in ( while all the devices are powered on) , then I no longer receive the correct data. If I disconnect it and replug the wire while the devices are on(and therefore the Axon is still constantly transmitting UART data) , then I get either º(decimal 186) or Ó(decimal 211)
Here's some data that might help out
Correct Data - decimal of 55 , binary of 00110111
Incorrect Data - decimal of 186 , binary of 10111010
Incorrect Data - decimal of 211, binary of 11010011
My code for transmitting the UART
void SendByte(char c) {
// Syntax is SendByte(#); where # is any number
while (!(UCSR0A & (1<<UDRE0))); // Wait until you are able to send a byte
UDR0 = c; // pass the value of the c variable into the UDR ,
}
QUESTION: How can I always receive correct data from the UART ?
Thank you