Serial data from avr to python

attinyavrrs232serial

I am using ATtiny2313 microcontroller along with a RS232 to establish communication between my microcontroller and the laptop.
Here's my question :
What is the predefined system for the laptop to make sense of the data that i send using the microcontroller ? (i.e. what is the number of parity bits, start bits… that the laptop expects to make sense of the data ?)

I tried reading the data using python but all data reads 0xff
my avr code sends a constant byte 0x01010101 every one seconds and laptop detects every new byte every 1 second. But every byte is sensed as 0xff.
What could be the problem ?
(i am using the screen function in the mac terminal to view the RS232 data).

Please help

Best Answer

make sure that the baud rate, number of parity bits, start bits and stop bits are same in your microcontroller and in your serial terminal program. In every serial terminal applications there are options to set the number of parity bits, start bits e.t.c. So the terminal program expects data in the format which is defined by the you. Install any other serial terminal application and check to see the correct byte is received. If the correct bit is received then it may be the problem with your python program.

Related Topic