The 8251 is a USART (Universal Synchronous Asynchronous Receiver Transmitter) for serial data communication. As a peripheral device of a microcomputer system, the 8251receives parallel data from the CPU and transmits serial data after conversion. This device also receives serial data from the outside and transmits parallel data to the CPU after conversion
There are two types of the control word.
- Mode instruction (setting of function)
- Command (setting of operation)
1) Mode Instruction
Mode instruction is used for setting the function of the 8251. Mode instruction will be in "wait for write" at either internal reset or external reset. That is, the writing of a control word after resetting will be recognized as a "mode instruction."
- Items set by mode instruction are as follows:
- o Synchronous/asynchronous mode
- o Stop bit length (asynchronous mode)
- o Character length
- o Parity bit
- o Baud rate factor (asynchronous mode)
- o Internal/external synchronization (synchronous mode)
- o Number of synchronous characters (Synchronous mode)
The bit configuration of mode instruction is shown in Figure. In the case of synchronous mode, it is necessary to write one-or two byte sync characters. If sync characters were written, a function will be set because the writing of sync characters constitutes part of mode instruction.
Command is used for setting the operation of the 8251. It is possible to write a command whenever necessary after writing a mode instruction and sync characters. Items to be set by command are as follows:
- Transmit Enable/Disable
- Receive Enable/Disable