This page is obsolete and provided for historical reference only. You can find up-to-date information about embedded systems and microcontrollers on www.embedeo.org.
Little-endian and big-endian formats
Any "endian"-order affects physical storage of data elements larger than a byte. Example: word - 2 bytes;double word - 4 bytes.
Serial protocol RS232 - bit-stream format
In little-endian format, a multi-byte value is stored in memory from the lowest byte (the "little end") to the highest byte. Example: the value 0x12345678 is stored as (0x78 0x56 0x34 0x12) in little-endian format, i.e. LSB (Least Significant Byte) is first.
In big-endian format, a multi-byte value is stored in memory from the highest byte (the "big end") to the lowest byte. Example: the value 0x12345678 is stored as (0x12 0x34 0x56 0x78) in big-endian format, i.e. MSB (Most Significant Byte) is first.
Some platforms use little-endian order internally (Intel, PC -machines); some use big-endian order (Mac).
The start bit indicates the beginning of a new data word. It is used to synchronize transmitter and receiver and is always a logical 0 (HIGH state of the line).
Data is transmitted LSB to MSB, which means that the least significant bit (LSB, Bit 0) is transmitted first with 4 to 7 bits of data following, resulting in 5 to 8 bits of data. A logical 0 is transmitted by the HIGH state of the line, a logical 1 by LOW.
A parity bit can be added to the data bits to allow error detection. There are two kinds of parity: odd and even (as well as: none, mark and space). Odd parity means that the number of LOW steps in the data word (including parity bit) is always odd, so the parity bit is set accordingly. It is also possible to set the parity bit to a fixed state or to omit it.
The stop bit is a logical 1, and does not indicate the end of the word; it rather separates two consecutive words by putting the line into the LOW state for a minimum time.