English
Language : 

AN969 Datasheet, PDF (7/10 Pages) STMicroelectronics – SCI COMMUNICATION BETWEEN ST7 AND PC
SCI COMMUNICATION BETWEEN ST7 AND PC
4 SCI COMMUNICATION BETWEEN ST7 AND PC VIA RS232
The software for this application is the SCI driver. The complete software can be found in the
the ST internet website. It is of course only an example. It is up to the user to adapt it to his
specific application.
4.1 GENERAL DESCRIPTION
In this application, a ST72F264 is connected to a PC. The communication is performed using
the «hyperterminal» application of Windows 98.
Characters are sent by the PC in ASCII code to the ST7. Every 4 characters received by the
ST7 are sent back to the PC and can be read on its screen.
The software is a polling SCI communication between an ST72F264 and a PC via RS232. The
communication works at 9600bps and has 1 stop bit.
The first part of the program performs the initialization of the ST72F264, core and SCI periph-
eral.
Then it enters transmission mode, sends the content of a 4-byte buffer to the PC. The initial-
ized value of the buffer is «test» in ASCII code. When the 4 characters are sent, transmission
mode is ended and the SCI peripheral enters reception mode.
In reception mode, the software waits for the user to send 4 ASCII characters from the PC.
Each character is put in the buffer until the fourth is received. Then reception mode is ended,
and goes back to transmission mode which will send the new contents of the buffer and so on.
As the ST7 sends the same characters as received, it is very easy to check if the communica-
tion is correct. Note that this program does not manage communication errors.
4.2 HARDWARE
The ST7 SCI peripheral cannot be directly connected to a PC, as it uses the RS232 protocol.
The conversion between SCI and RS232 can be done using a MAX232. An overview sche-
matic is presented below (Figure 3.).
7/10