Serial Communication Protocols
Serial Communication Protocols
Serial Communication Protocols
13-02-13
Dedicated to
Contenido.
Mode of Communication Clock Pulse and Its significance. Asynchronous and synchronous Protocol. UART(RS232/485/422). SPI(Serial Peripheral Interface). I2C(Inter Integrated Circuit). Methods of SW Implementation. Interfacing with Peripherals
Mode of Communication
Although the word signal has a number of other meanings, the term here is used for "transmitted energy that can carry information". In other words to say which drives other peripherals.
Application
A metronome is any device that produces regular, metrical ticks (beats, clicks) settable in beats per minute.
Mechanical metronome
In synchronous transmission, envelop the information, but with more characters between the start and end sequences. The start and stop bits are replaced with a new format that permits greater flexibility. An extra ending sequence is added to perform error checking. Receiver and Transmitter are synchronized by a clock signal, either transmitted over a separate wire. More data can be sent after a short synchronizing sequence. Which achieves Lower overhead and thus, greater throughput.
UART(RS232/485/422)
A Universal Asynchronous Receiver/Transmitter. UARTs are commonly used in conjunction with communication standards such as EIA, RS-232, RS-422 or RS-485. The electric signaling levels and methods (such as differential signaling etc.) are handled by a driver circuit external to the UART.
Bit Time = 1/Baud Rate One frame contains 1+8+1 = Start Bit + Data Byte + Stop bit
Character framing
RS232
RS-232(Recommended Standard 232) is a standard for serial binary data signals connecting between a Data Terminal Equipment (DTE) and a Data Communication Equipment (DCE). Significant differences between TTL level UART and RS-232 is the voltage level. Valid signals in RS-232 are 3 to 15V, and signals near 0V is not a valid RS-232 level. Besides voltage level, the RS-232 also has a few extra pins specifically designed for the communication between PC and modem. The pinouts of the DB-9 and their functions
Transmitted Data (TxD) Received Data (RxD) Request to Send (RTS) Clear to Send (CTS) Data Terminal Ready (DTR)
3 2 7
Serial data output Serial data input This line informs the DCE (Modem) that the DTE (PC) is ready to exchange data This line indicates that the DCE is ready to exchange data Asserted by DTE to indicate that it is ready to be connected
8 4
Asserted by DCE to indicate the DCE is powered on and is ready to receive commands or data for transmission from the DTE Asserted by DCE when a connection has been established with remote equipment Asserted by DCE when it detects a ring signal from the telephone line
RS-422 - RS-485
RS-422 (also EIA-422) is a technical standard that specifies electrical characteristics of a digital signaling circuit. Differential signaling can transmit data at rates as high as 10 million bits per second, or may be sent on cables as long as 1500 meters. Some systems directly interconnect using RS-422 signals, or RS-422 converters may be used to extend the range of RS-232 connections. The standard only defines signal levels; other properties of a serial interface are set by other standards EIA-485, also known as TIA/EIA-485 or RS-485, is a standard defining the electrical characteristics of drivers and receivers for use in balanced digital multipoint systems. The standard is published by the Telecommunications Industry Association/Electronic Industries Alliance (TIA/EIA). Digital communications networks implementing the EIA-485 standard can be used effectively over long distances and in electrically noisy environments. Multiple receivers may be connected to such a network in a linear, multi-drop configuration. These characteristics
I2C.
Methods of SW Implementation
SW Development Steps:
Polling Method. Ex: UART: for Transmission : while(Transmitter empty flag & UxTCTL) { // source code lines }
For Reception mostly Interrupt method is used ( either peripheral IO or GPIO interrupt for bit banging) Interrupt Method. Ex: UART: for Transmission : 1. Place the Data into the UART_TxBUFFER_REGISTER Enable the Interrupt Flag in the UART Interrupt Register. 2. Few code lines will be placed in the Tx Interrupt, to check the end of the data Byte.