Example 1 Program the divisor Latch for 300 baud. Assume Xin=1.8432MHz The Base Address: 0x3F8 0 RX_TX / Divisor.low 1 IER: Interrupt Enable Reg. / Divisor.high 2 IIR: Interrupt Identification Reg. 3 LCR: Line Control Reg. 4 MCR: Modem Control Reg. 5 LSR: Line Status Reg. 6 MSR: Modem Status Reg. 7 - 300*384=115200 115200*16=1843200
26
Embed
Example 1 Program the divisor Latch for 300 baud. Assume Xin=1.8432MHz The Base Address: 0x3F8 0RX_TX / 1IER: Interrupt Enable Reg. / Divisor.high.
Example 3 Program 8250 for 2400 baud, 8 data bit, even parity and 1 stop bit. Assume Xin=1.8432MHz The Base Address: 0x3F8 MOVAL,80H; Accessing DLAB MOVDX,3FBH;Line Control Register Address OUTDX,AL MOVAX,48;baud= :48=2400 MOVDX,3F8H;Low byte of Divisor OUTDX,AL MOVAL,AH INCDX OUTDX,AL MOVAL, ; DLAB,Break,Even,1 stop, 8 data MOVDX,3FBH;LCR OUTDX,AL
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Example 1Program the divisor Latch for 300 baud. Assume Xin=1.8432MHz The Base Address: 0x3F8
0 RX_TX / Divisor.low
1 IER: Interrupt Enable Reg. / Divisor.high
2 IIR: Interrupt Identification Reg.
3 LCR: Line Control Reg.
4 MCR: Modem Control Reg.
5 LSR: Line Status Reg.
6 MSR: Modem Status Reg.
7 -
300*384=115200115200*16=1843200
Example 2Program the divisor Latch for 2400 baud. Assume Xin=1.8432MHz The Base Address: 0x3F8
2400*48=115200115200*16=1843200
Example 3Program 8250 for 2400 baud, 8 data bit, even parity and 1 stop bit. Assume Xin=1.8432MHz The Base Address: 0x3F8
Serial Data Transfer Asynchronous v.s. Synchronous
— Asynchronous transfer does not require clock signal. However, it transfers extra bits (start bits and stop bits) during data communication — Synchronous transfer does not transfer extra bits. However, it requires clock signal
Frame
Startbit B0 B1 B2 B3 B4 B5 B6
ParityStop bits
AsynchronousData transfer
SynchronousData transfer
clk
dataB0 B1 B2 B3 B4 B5
data
(a) Serial data transmitted at the proper rate. (b) The data rate is too fast. (c) The data rate is too slow.
Serial Frame (Synchronous)
Bit 7 0 1 2 3 4 5 6 7 0
No start or stop bits, timing synchronized with special ASCIIcharacters (SYN)