
DocID13284 Rev 2
263/564
UM0404
XBUS asynchronous / synchronous serial interface
9-bit data frames
either consist of 9 data bits D8...D0 (S1M = ‘100b’), of 8 data bits D7...D0
plus an automatically generated parity bit (S1M = ‘111b’) or of 8 data bit D7...D0 plus wake-
up bit (S1M = ‘101b’). Parity may be odd or even, depending on bit S1ODD in register
XS1CON. An even parity bit will be set, if the modulo-2-sum of the 8 data bits is ‘1’. An odd
parity bit will be cleared in this case. Parity checking is enabled via bit S1PEN (always OFF
in 9-bit data and wake-up mode). The parity error flag S1PE will be set along with the error
interrupt request flag, if a wrong parity bit is received. The parity bit itself will be stored in bit
8 of XS1RBUF.
In wake-up mode received frames are only transferred to the receive buffer register, if the
9th bit (the wake-up bit) is ‘1’. If this bit is ‘0’, no receive interrupt request will be activated
and no data will be transferred.
This feature may be used to control communication in multi-processor system when the
master processor wants to transmit a block of data to one of several slaves, it first sends out
an address byte which identifies the target slave. An address byte differs from a data byte in
that the additional 9th bit is a '1' for an address byte and a '0' for a data byte, so no slave will
be interrupted by a data byte. An address byte will interrupt all slaves (operating in 8-bit data
+ wake-up bit mode), so each slave can examine the 8 LSBs of the received character (the
address).
The addressed slave will switch to 9-bit data mode (by clearing bit S1M.0), which enables it
to also receive the data byte that will be coming (having the wake-up bit cleared). The
slaves that were not being addressed remain in 8-bit data + wake-up bit mode, ignoring the
following data byte (see
Asynchronous transmission
begins at the next overflow of the divide-by-16 counter (see
), provided that S1R is set and data has been loaded into XS1TBUF. The
transmitted data frame consists of three basic elements:
•
the start bit,
•
the data field (8 or 9 bits, LSB first, including a parity bit, if selected),
•
the delimiter (1 or 2 stop bits).
Data transmission is double buffered. When the transmitter is idle, the transmit data loaded
into XS1TBUF is immediately moved to the transmit shift register thus freeing XS1TBUF for
the next data to be sent. This is indicated by the transmit buffer interrupt request flag being
set. XS1TBUF may now be loaded with the next data, while transmission of the previous
one is still going on.
The transmit interrupt request flag will be set before the last bit of a frame is transmitted, that
means before the first or the second stop bit is shifted out of the transmit shift register.
The transmitter output pin TXD1/P8.7 must be configured for alternate data output,
P8.7 = ‘1’ and DP8.7 = ‘1’.
Asynchronous reception
is initiated by a falling edge (1-to-0 transition) on pin RXD1,
provided that bit S1R and S1REN are set. The receive data input pin RXD1 is sampled at 16
times the rate of the selected Baud rate. A majority decision of the 7th, 8th and 9th sample
determines the effective bit value. This avoids erroneous results that may be caused by
noise.
If the detected value is not a '0' when the start bit is sampled, the receive circuit is reset and
waits for the next 1-to-0 transition at pin RXD1. If the start bit proves valid, the receive circuit
continues sampling and shifts the incoming data frame into the receive shift register.