Intel 8XC196MC User Manual page 138

Table of Contents

Advertisement

Interrupts
Software Clears TXD
LSB
Bit 0
Start
TXD
(Port pin)
1 Bit Time
Figure 5-25. Asynchronous SIO Transmit Timing
The first PTS cycle must be started manually by generating a start bit and then setting up the tim-
ing for the first EPA interrupt.
Initialize the TXD port pin to one before starting a transmission.
Write a zero to the TXD port pin to start the transmission. The PTS uses this as the start bit.
Add the contents of the timer register to the Baud_value (Figure 5-19 on page 5-38) and
store the result into the EPA time register. This sets up the timing for the first interrupt and
causes the first bit transmission to occur at the proper baud rate.
The following example uses P2.0 to output the data (TXD) and EPA0 to control the baud rate. It
sets up an asynchronous serial I/O PTS routine that transmits 16 bytes with eight data bits, one
parity bit, and one stop bit at 9600 baud. This example uses several user-defined registers.
T_COUNT defines the number of bytes to transfer and TXDDONE is a flag that is set when all
bytes are transferred.
1.
Disable the interrupts and the PTS.
— Use the DI instruction to disable all standard interrupts and the DPTS instruction to
disable the PTS.
2.
Set-up the stack pointer.
3.
Reset all interrupt mask registers.
— Clear INT_MASK, INT_MASK1and PI_MASK.
4.
Initialize P2.0 to function as TXD.
— Clear P2_DIR.0 (selects output).
— Clear P2_MODE.0 (selects LSIO function).
— Set P2_REG.0 (initializes TXD output to "1").
10 PTS Serviced Interrupts
Bit 1
Bit 2
Bit 3
Get other manuals https://www.bkmanuals.com
STANDARD AND PTS INTERRUPTS
Conventional
MSB
Bit 4
Bit 5
Bit 6
Bit 7
End-of-PTS
Interrupt
Parity
Stop
Optional
Parity Bit
A3119-01
5-51

Advertisement

Table of Contents
loading

This manual is also suitable for:

8xc196md8xc196mh

Table of Contents