Enabling The Serial Port Interrupts - Intel 8XC196NT User Manual

Table of Contents

Advertisement

The reason for this restriction is that the receive shift register is clocked from
an internal signal rather than the signal on TXD. Although these two signals
are normally synchronized, the internal signal generates one clock before the
first pulse transmitted by TXD and this first clock signal is not synchronized
with TXD. This clock signal causes the receive shift register to shift in
whatever data is present on the RXD pin. This data is treated as the least-
significant bit (LSB) of the reception. The reception then continues in the
normal synchronous manner, but the data received is shifted left by one bit
because of the false LSB. The seventh data bit transmitted is received as the
most-significant bit (MSB), and the transmitted MSB is never shifted into the
receive shift register.
Using XTAL1 at 20 MHz, the maximum baud rates are 3.33 Mbaud for mode 0 and 1.25 Mbaud
for modes 1, 2, and 3. Table 7-3 shows the SP_BAUD values for common baud rates when using
a 20 MHz XTAL1 clock input. Because of rounding, the BAUD_VALUE formula is not exact
and the resulting baud rate is slightly different than desired. Table 7-3 shows the percentage of
error when using the sample SP_BAUD values. In most cases, a serial link will work with up to
5.0% difference in the receiving and transmitting baud rates.
Table 7-3. SP_BAUD Values When Using XTAL1 at 20 MHz
Baud Rate
9600
4800
2400
1200
NOTE:
1.
Bit 15 is always set when XTAL1 is selected as the clock source for the baud-rate generator.
7.4.4

Enabling the Serial Port Interrupts

The serial port has both a transmit interrupt (TI) and a receive interrupt (RI). To enable an inter-
rupt, set the corresponding mask bit in the interrupt mask register (see Table 7-2 on page 7-2) and
execute the EI instruction to globally enable servicing of interrupts. See Chapter 5, "Standard and
PTS Interrupts," for more information about interrupts.
SP_BAUD Register Value (Note 1)
Mode 0
Mode 1, 2, 3
8411H
8822H
9046H
A08CH
Mode 0
8081H
0.03
810BH
0.02
8208H
0.01
8411H
0
SERIAL I/O (SIO) PORT
% Error
Mode 1, 2, 3
0.16
0.16
0.06
0.03
7-11

Advertisement

Table of Contents
loading

Table of Contents