English
Language : 

AN969 Datasheet, PDF (6/10 Pages) STMicroelectronics – SCI COMMUNICATION BETWEEN ST7 AND PC
SCI COMMUNICATION BETWEEN ST7 AND PC
Note: ETPR and ERPR can be used to finetune the baud rate. When ETPR and ERPR con-
tain any value other than 0, the BRR register is disabled and the baud rates are given by the
formula:
TX = fCPU/(16*EPTR*PR*TR) RX = fCPU/(16*ERPR*PR*RR)
where EPTR and ERPR = 1 to 255.
3.2.3 Word length
The word length is selected by the M bit in the SCICR1 register.
7
0
R8 T8 SCID M WAKE PCE PS PIE
In the application, data length is always 8 bits, but the user can force a second stop bit. This
is done using a 9-bit word length and setting the 9th bit (T8 bit of SCICR1). When receiving
data, R8 bit will always be set (reception of 2 stop bits).
Special bits (PCE,PS,PIE) are also available to use the SCI with parity (not used in this appli-
cation). Refer to the datasheet for more information.
3.2.4 Selecting reception and transmission modes
The selection is made using the SCICR2 register.
7
0
TIE TCIE RIE ILIE TE RE RWU SBK
Transmission is enabled or disabled depending on the value of the TE bit of SCICR2 (TE = 1,
transmission enabled). When disabled, the TDO pin is free for general purpose I/O.
Reception is enabled or disabled depending on the value of the RE bit of SCICR2 (RE = 1, re-
ception enabled). When disabled, the RDI pin is is free for general purpose I/O.
When reception is disabled, no data must be sent to the ST7. If data are to be received at this
time, the RE bit must be set. Otherwise a wrong byte might be detected when going back into
reception mode.
6/10