GR740-UM-DS, Nov 2017, Version 1.7
325
www.cobham.com/gaisler
GR740
23.4
Loop back mode
If the LB bit in the UART control register is set, the UART will be in loop back mode. In this mode,
the transmitter output is internally connected to the receiver input and the RTSN is connected to the
CTSN. It is then possible to perform loop back tests to verify operation of receiver, transmitter and
associated software routines. In this mode, the outputs remain in the inactive state, in order to avoid
sending out data.
23.5
FIFO debug mode
FIFO debug mode is entered by setting the debug mode bit in the control register. In this mode it is
possible to read the transmitter FIFO and write the receiver FIFO through the FIFO debug register.
The transmitter output is held inactive when in debug mode. A write to the receiver FIFO generates an
interrupt if receiver interrupts are enabled.
23.6
Interrupt generation
Two different kinds of interrupts are available: normal interrupts and FIFO interrupts. For the trans-
mitter, normal interrupts are generated when transmitter interrupts are enabled (TI), the transmitter is
enabled and the transmitter FIFO goes from containing data to being empty. FIFO interrupts are gen-
erated when the FIFO interrupts are enabled (TF), transmissions are enabled (TE) and the UART is
less than half-full (that is, whenever the TH status bit is set). This is a level interrupt and the interrupt
signal is continuously driven high as long as the condition prevails. The receiver interrupts work in
the same way. Normal interrupts are generated in the same manner as for the holding register. FIFO
interrupts are generated when receiver FIFO interrupts are enabled, the receiver is enabled and the
FIFO is half-full. The interrupt signal is continuously driven high as long as the receiver FIFO is half-
full (at least half of the entries contain data frames).
To reduce interrupt occurrence a delayed receiver interrupt is available. It is enabled using the delayed
interrupt enable (DI) bit. When enabled a timer is started each time a character is received and an
interrupt is only generated if another character has not been received within 4 cha 4 bit times.
If receiver FIFO interrupts are enabled a pending character interrupt will be cleared when the FIFO
interrupt is active since the character causing the pending irq state is already in the FIFO and is
noticed by the driver through the FIFO interrupt. In order to not take one additional interrupt (due to
the interrupt signal being driven continuously high as described above), software should clear the cor-
responding pending bit in the interrupt controller after the FIFO has been emptied.
There is also a separate interrupt for break characters. When enabled an interrupt will always be gen-
erated immediately when a break character is received even when delayed receiver interrupts are
enabled. When break interrupts are disabled no interrupt will be generated for break characters when
delayed interrupts are enabled.
When delayed interrupts are disabled the behavior is the same for the break interrupt bit except that an
interrupt will be generated for break characters if receiver interrupt enable is set even if break inter-
rupt is disabled.
An interrupt can also be enabled for the transmitter shift register. When enabled the core will generate
an interrupt each time the shift register goes from a non-empty to an empty state.