week8 - 8051 Serial Port Programming Week 8 1 8051 Pin...

Info iconThis preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Week 8 8051 Serial Port Programming
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 8051 Pin Diagram 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 P1.0 P1.1 P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 RST (RXD)P3.0 (TXD)P3.1 (T0)P3.4 (T1)P3.5 XTAL2 XTAL1 GND (INT0)P3.2 (INT1)P3.3 (RD)P3.7 (WR)P3.6 Vcc P0.0(AD0) P0.1(AD1) P0.2(AD2) P0.3(AD3) P0.4(AD4) P0.5(AD5) P0.6(AD6) P0.7(AD7) EA/VPP ALE/PROG PSEN P2.7(A15) P2.6(A14) P2.5(A13) P2.4(A12) P2.3(A11) P2.2(A10) P2.1(A9) P2.0(A8) 8051 (8031) Serial #0 Serial #1 (DSC894x0)
Background image of page 2
3 Inside Architecture of 8051 CPU On-chip RAM On-chip ROM for program code 4 I/O Ports Timer 0 Serial Port Figure 1-2. Inside the 8051 Microcontroller Block Diagram OSC Interrupt Control External interrupts Timer 1 Timer/Counter Bus Control TxD RxD P0 P1 P2 P3 Address/Data Counter Inputs
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Section 10.1 Basics of Serial Communications
Background image of page 4
5 Parallel vs. Serial ± Computers transfer data in two ways: ² Parallel •Send one byte or more at a time (fast) •Fo r very short distance between two devices • 8-bit data path is expensive • Example: printer, hard disks ² Serial one bit at a time (slow) via simple wire • Relatively long distance •Che ap • For long-distance data transfers using communication lines such as a telephone, uses a modem to modulate (0/1 to analog) and demodulate (analog to 0/1).
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Figure 10-1. Serial versus Parallel Data Transfer Sender Receiver Sender Receiver Serial Transfer Parallel Transfer D0 D7
Background image of page 6
7 Serial Communication ± How to transfer data? ² The byte of data must be converted to serial bits using a parallel-in-serial-out shift register. ² The bit is transmitted over a single data line. ² The receiver must have be a serial-in-parallel- out shift register to receive the serial data and pack them into a byte. 111 01000001 011 ‘A’ register 8-bit data register 8 1 parallel-in serial-out serial-in parallel-out
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8 Asynchronous vs. Synchronous ± Serial communication uses two methods: ² Synchronous: Transfer a block of data (characters) at a time ² Asynchronous: Transfer a single byte at a time byte transmitter receiver start bit stop bit byte byte ± Special IC chips are made for serial communication ² USART (universal synchronous-asynchronous receiver-transmitter) ² UART (universal asynchronous receiver-transmitter) ± The 8051 chip has a built-in UART .
Background image of page 8
9 Simplex vs. Duplex Transmission ± Simplex transmission: Data can sent in one direction. ± Duplex transmission: Data can be transmitted & received ² Half duplex: Not simultaneously ² Full duplex: Simultaneously
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
10 8051 Serial Communication ± The 8051 has serial communication capability built into it. ² Full-duplex ² Asynchronous mode only ² Uses data framing • Each byte is placed in between start and stop bits “A” (41H) is being sent
Background image of page 10
11 Framing ± The start bit is 0 (low) and always one bit. ± The LSB is sent out first. ± The stop bit is 1 (high). ± The stop bit can be one or two bits (one in modern PCs).
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 68

week8 - 8051 Serial Port Programming Week 8 1 8051 Pin...

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online