Interface 8251 with 8086 at an address 80H initialize it in asynchrono...
Interface 8251 with 8086
To interface the 8251 USART (Universal Synchronous/Asynchronous Receiver/Transmitter) with the 8086 microprocessor, we need to initialize the 8251 in asynchronous transmit mode and transmit a message to a modem. Here's how we can do it:
Initializing 8251 in Asynchronous Transmit Mode
To initialize the 8251 in asynchronous transmit mode, we need to perform the following steps:
1. Set the Control Word Register (CWR) of the 8251 with the desired configuration.
- Load the CWR with the value 00001111 (binary) or 0FH (hexadecimal).
- This sets the USART in transmit mode, with 7-bit character size, one start bit, one stop bit, and even parity enabled.
2. Configure the mode control bits of the 8251.
- Load the Mode Control Register (MCR) with the desired configuration.
- Set the Baud Rate Generator (BRG) to generate the desired baud rate.
- For a baud factor of 16, we need to set the BRG to 16 times the desired baud rate.
3. Perform any other necessary initialization steps, such as enabling interrupts, configuring the I/O ports, and setting up the memory locations for data transmission.
Transmitting a Message to the Modem
To transmit a message "HAPPY NEW YEAR" in ASCII coded form to a modem, we need to follow these steps:
1. Load the message "HAPPY NEW YEAR" into the data buffer of the 8086 microprocessor.
2. Start the transmission by setting the Transmit Enable (TE) bit of the 8251 Control Word Register.
3. Write the first character of the message into the Transmit Holding Register (THR) of the 8251.
4. Wait for the transmitter to complete the transmission of the character.
- This can be done by polling the status bits of the 8251 or by using interrupts.
5. Repeat steps 3-4 for each character of the message until the entire message is transmitted.
6. Once the entire message is transmitted, disable the TE bit to stop further transmission.
7. Verify the successful transmission by checking the status bits of the 8251 or by monitoring the modem's response.
Summary
In summary, to interface the 8251 USART with the 8086 microprocessor, we initialize the 8251 in asynchronous transmit mode with the desired configuration, including character size, baud factor, start/stop bits, and parity. We then transmit a message by loading it into the data buffer of the 8086 and writing each character to the Transmit Holding Register of the 8251. We wait for the transmission to complete and repeat the process for each character until the entire message is transmitted. Finally, we disable the transmit enable bit and verify the successful transmission.