we have a 16550 UART with clock frequency of 18432MHZ its to
we have a 16550 UART with clock frequency of 18.432MHZ. it\'s to be programmed as even parity, no break(SB=0), 2 STOP BITs, 6- BIT DATA, 38400 BAUD. The UART starting address is at 0X0A38 in the 8086 architechture
a) what addresses does UART occupy? Assume consecutive addressed.
b) what\'s the correct frequency divisor to yield the desired baud rate?
c) what are the correct values for the line control register and divisor register?
d)write the 8086 intel assembly code to program the UART. Assume all register must be restored.
Solution
a)if starting addres is at 0X0A38, then UART will occupy consecutive 8 bits, i.e from 0X0A38 to 0X0A3F
b)The 16550 UART contains a programmable baud generator. Two 8-bit latches store the divisor in a 16-bit binary format.
The divisor is calculated as follows:
Divisor = (frequency input)/ (baud rate x 16).
therefore,
divisor= (18.432* 10^6)/38400* 16= 30
c) so divisor latch register(LSB) will be 00011110 ( 30 D)
divisor latch register(MSB) will be 00000000 ( 0 D)
Values of the Line control register will be ( to be programmed as even parity, no break(SB=0), 2 STOP BITs, 6- BIT DATA, )
sticky parity
bit
even parity
select bit
| Bit no. | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Bit Value | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 |
| details | divisor latch access bit | break control enable bit | sticky parity bit | even parity select bit | parity enable bit | 2 stop bit | 6 bit data | 6 bit data |
