Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

SERIAL PORT OPERATION | 129

for shift register mode and then maps the contents of internal memory location 20H to the eight
extra outputs, 10 times per second.
5.10 Which type of serial communication does the 8051's serial port support? Simplex, half- or full
duplex? Why? Explain the components within the serial port and how they support this type of
serial communication.
5.11 Explain how the 8051's input/output (I/O) capability can be expanded by using the serial port.
What is the disadvantage of such a method?
5.12 Write a subroutine called OUTCHR9 to transmit a 9-bit code (C8C7C6C5C4C3- C2C1C0) out the 8051
serial port. Note that C8 is in the LSB of B register while C7C6C5C4C3C2C1C0 are in the
accumulator. Return from the subroutine with all registers intact.
5.13 Write a subroutine called INCHAR8 to input an 8-bit extended ASCII character from the 8051's
serial port and return with the 8-bit code in the accumulator. Expect odd parity in the ninth bit
received and set the carry flag if there is a parity error.
5.14 Write a subroutine called OUTCHR8 to transmit the 8-bit extended ASCII code in the accumulator
out the 8051 serial port, with odd parity added as the ninth bit. Return from the subroutine with the
accumulator intact.
5.15 a. Write an instruction sequence to initialize the serial port to operate as a 9-bit UART at 9600
baud. Use Timer 1 to provide the baud rate clock, assuming that the crystal oscillator
frequency, fosc = 12 MHz.
b. Is the resulting baud rate exactly 9600 baud? If not, what is the percentage error (% error)?
Hence, calculate the value of fosc to achieve an exact baud rate of 9600 baud.

You might also like