Реферат: Микроконтроллер 8250

IIR = BASE+2 = interrupt identification register (read only)

FCR = BASE+2 = FIFO control register (write only)

SCR = BASE+7 = scratch register (read and write)

Bits are numbered from 0 to 7, 7 is high bit

Read and save the SCR

Store a test value into SCR (hex 5A is good)

Read SCR and compare to test value

If not equal, there is no scratch register, so the chip is an 8250

Store another test value into SCR (hex A5 is good)

Read SCR and compare to test value

If not equal, there is no scratch register, so the chip is an 8250

Restore the saved value from the SCR

Read and save the IIR (saves current possible FIFO status)

Store 1 into FCR (enables possible FIFOs)

Read IIR

If saved IIR value had bit 7 clear, store 1 into FCR (FIFOs were off)

If IIR had bit 6 set, the chip is a 16550A

If IIR had bit 7 set, the chip is a 16550

Otherwise, the chip is a 16450

How to use the 16550 FIFOs

National semiconductor says not to - you can lose characters. Get a 16550A (see below)

How to use the 16550A FIFOs

Changes to the UART registers compared to an 8250

IIR = BASE+2 = interrupt identification register (read only)

The upper 2 bits (bits 7 and 6) indicate if the FIFOs are enabled. A one in both means the FIFOs are enabled. A one in bit 7 only means you have a 16550, not a 16550A. (see above about chip detection and using 16550 FIFOs)

Bit 3 is used to indicate character time-out. This is set to indicate that there are bytes in the receive FIFO that need to be read. This happens after a short amount of time has elapsed that no characters have been recieved. If Bit 3 is set, Bit 2 is also set (which means receive data available), so for most applications, Bit 3 can be ignored.

On an 8250 and 16450, bits 7, 6, and 3 are always zero. Bits 5 and 4 are reserved. For compatability, after reading the IIR, mask the value with 7.

FCR = BASE+2 = FIFO control register (write only)

Bit 0 - FIFO enable

К-во Просмотров: 3050
Бесплатно скачать Реферат: Микроконтроллер 8250