21
Serial communication

Microcontroller serial communication

Embed Size (px)

DESCRIPTION

everything about communication

Citation preview

  • 1. transfer of data between two entities.Classification:-Parallel-serial

2. Serial versus parallel data transfer 3. Two basic transmission modes:-Asynchronous: transmitter and receiverclocks are independent.-Synchronous: transmitter and receivermodes are synchronized. 4. Framing:-Data word(octet) is encapsulated betweenstart bitstop bit c-receiver resynchronizes again at a start of each new wordor character received. 5. Its an industry acronym which stands forUniversal Asynchronous ReceiverTransmitter. It is the interface circuitry between themicroprocessor and the serial port. It is responsible for breaking apart bytes ofdata.And transmitting it one bit at a time(i.e.Serially) 6. It was designed by EIA(ElectronicsIndustries Association).Voltage specifications:-3V to -25V -- logic 1+3V to +25V -- logic 2Some specific signals 7. SBUF: Serial Buffer Register-data moved to SBUF is transmittedserially.-serial data Rx-ed is stored by 8051 inSBUF.Example:SBUF=char;variable=SBUF;SFR: special function register 8. This only applies to Serial Port modes 1 and 3. The Baud Rate is determined based on theoscillators frequency when in mode 0 and 2. In mode 0, the baud rate is always the oscillatorfrequency divided by 12. This means if your crystal is 11.059Mhz, mode 0baud rate will always be 921,583 baud. In mode 2 the baud rate is always the oscillatorfrequency divided by 64, so a 11.059Mhz crystalspeed will yield a baud rate of 172,797. 9. PC Baud rates110150300600120024004800960019200 10. The basic equation for a timer reload valuecan be stated as:TH1 = 256 Crystal Frequency/384 (or 192 if SMOD = 1)Baud RateExample:To obtain a timer reload value for a 9600 baudserial data rate with an 11.0592 MHz crystal:=256 11.0592/3849600= 256 3= 253 or FD (hexadecimal) 11. The equation can also be solved to derivethe baud rate or the crystal frequency fromthe other information as follows:Baud Rate = Crystal Frequency/384 (or 192 if SMOD = 1)256 TH1