Anda di halaman 1dari 5

CpEng 213 - Homework 9 Serial Communications Name:____________________________________Student No.

._________________ Read corresponding sections and answer the followings problems selected from the textbooks. (Due: Thursday, May 1, 2008) Total Points: 200 Section 10.1 1. Which is more expensive, parallel or serial data transfer? Parallel 2. True or False. 0 V and 5 V digital pulses can be transferred on the telephone without being converted (modulated). False Show the framing of the letter ASCII Z (0101 1010), no parity, 1 stop bit.

3.

1010110100

4.

True or False. The stop bit can be 1, 2, or none at all. False Calculate the overhead percentage if the data size is 7, 1 stop bit, no parity. 7 bit data + 1 stop bit + 1 start bit = 9 bits 2/9 100% = 22%

5.

6.

True or False. The RS232 voltage specification is TTL compatible. False

7.

Calculate the total number of bits transferred if 200 pages of ASCII data are sent using the asynchronous serial data transfer. Assume a data size of 8 bits, 1 stop bit, and no parity. Assume each page has 80 25 of text characters. 200 80 25 10 = 4, 000, 000 bits

8.

In question 7, how long will the data transfer take if the baud rate is 9, 600? 416.6 seconds

Section 10.2 & 10.3

9.

State the advantages and disadvantages of the MAX232 and MAX233.

Max232 requires a capacitor whereas Max233 does not and saves space but it is more expensive.

10. Which of the following baud rates are supported by the BIOS of 486/Pentium PCs? (a) 4, 800 (b) 3, 600 (c) 9, 600 (d) 1, 800 (e) 1, 200 (f) 19, 200 (a), (c), (e), (f) 11. For XTAL = 11.0592 MHz, find the TH1 value (in both decimal and hex) for each of the following baud rates: (a) 9, 600 (b) 4, 800 11.0592/12 = 921.6 kHz and 921.6/32 = 28, 800 (a) (b) 28,800/9,600=3 and (-3) = FDH = 253 28,800/4,800=6 and (-6) = FAH = 250

12. What is the baud rate if we use MOV TH1, #-1 to program the baud rate?

28,800/1=28,800 13. Write an 8051 program to transfer serially the letter Z continuously at 1, 200 baud rate. MOV TMOD, #20H MOV TH1, #-24 MOV SCON, #50H SETB TR1 MOV A, #z MOV SBUF, A JNB TI, HERE CLR TI SJMP AGAIN

AGAIN: HERE:

14. Write an 8051 program to transfer serially the message The earth is but one country and mankind its citizens continuously at 57, 600 baud rate. MOV DPTR, #MYDAT MOV R2, #52 MOV A, PCON SETB ACC.7 MOV PCON, A MOV TMOD, #20H MOV TH1, #-1 MOV SCON, #50H SETB TR1 CLR A MOVC A, @A+DPTR MOV SBUF, A JNB TI, H_1 INC DPTR CLR TI DJNZ R2, A_2 ORG 300H DB The earth is citizen

;COUNT ;MAKE IT 56K RATE

A_2:

H_1:

MYDATA:

15. When is the TI flag raised? At the beginning of the stop bit of the outgoing framed byte 16. When is the RI flag raised? Midway through the stop bit of the incoming framed byte 17. What is role of the SMOD bit in the rate of data transfer? The SMOD bit allows to double the serial data transfer rate. 18. Is SMOD bit high or low when the 8051 is power up? Low

19. Find the baud rate for the following if XTAL = 16 MHz and SMOD = 0. (a) MOV TH1, #-10 (b) MOV TH1, #-180

16MHz/12 = 1.333 MHz and 1.333 MHz/32 = 41666 Hz (a) 41666/10 = 4166 (b) 41666/180 = 231

20. Find the baud rate for the following if XTAL = 24 MHz and SMOD = 1. (a) MOV TH1, #-15 (b) MOV TH1, #-100 24MHz/12 = 2 MHz and 2 MHz/16 = 125 000 Hz (a) (b) 125000/15 = 8332 125000/100 = 1250

Anda mungkin juga menyukai