English
Language : 

Z8F1680SH020SG Datasheet, PDF (173/412 Pages) Zilog, Inc. – High-Performance 8-Bit Microcontrollers
Z8 Encore! XP® F1680 Series
Product Specification
148
8. Execute an EI instruction to enable interrupts.
The LIN-UART is now configured for interrupt-driven data transmission. Because the
LIN-UART Transmit Data Register is empty, an interrupt is generated immediately. When
the LIN-UART Transmit interrupt is detected and there is transmit data ready to send, the
associated interrupt service routine (ISR) performs the following:
1. If in MULTIPROCESSOR Mode, writes to the LIN-UART Control 1 Register to
select the outgoing address bit:
– Sets the Multiprocessor Bit Transmitter (MPBT) if sending an address byte, clears
it if sending a data byte.
2. Writes the data byte to the LIN-UART Transmit Data Register. The transmitter auto-
matically transfers the data to the Transmit Shift Register and transmits the data.
3. Executes the IRET instruction to return from the interrupt-service routine and wait for
the Transmit Data Register to again become empty.
If a transmit interrupt occurs and there is no transmit data ready to send, the interrupt ser-
vice routine executes the IRET instruction. When the application does have data to trans-
mit, software can set the appropriate interrupt request bit in the Interrupt Controller to
initiate a new transmit interrupt. Another alternative would be for the software to write the
data to the Transmit Data Register instead of invoking the interrupt service routine.
12.1.4. Receiving Data Using Polled Method
Observe the following steps to configure the LIN-UART for polled data reception:
1. Write to the LIN-UART Baud Rate High and Low Byte registers to set the appropriate
baud rate.
2. Enable the LIN-UART pin functions by configuring the associated GPIO port pins for
alternate function operation.
3. If MULTIPROCESSOR Mode is appropriate, write to the LIN-UART Control 1 Reg-
ister to enable MULTIPROCESSOR (9-bit) Mode functions.
4. Write to the LIN-UART Control 0 Register to:
a. Set the Receive Enable bit (REN) to enable the LIN-UART for data reception.
b. If MULTIPROCESSOR Mode is not enabled, then enable parity (if appropriate),
and select either even or odd parity.
5. Check the RDA bit in the LIN-UART Status 0 Register to determine if the Receive
Data Register contains a valid data byte (indicated by a 1). If RDA is set to 1 to indi-
cate available data, continue to Step 6. If the Receive Data Register is empty (indi-
cated by a 0), continue to monitor the RDA bit that is awaiting reception of the valid
data.
PS025015-1212
PRELIMINARY
LIN-UART