BL4S200 User’s Manual
60
4.2.2 Serial Communication
The following sample programs are found in the
SAMPLES\BLxS2xx\RS232
subdirectory.
•
PARITY.C
—This sample program repeatedly sends byte values 0–127 from Serial Port F
to Serial Port E. The program switches between generating parity and not generating
parity on Serial Port F. Serial Port E will always be checking parity, so parity errors
should occur during every other sequence. The results are displayed in the Dynamic C
STDIO
window.
Connect TxF (pin 2 on connector J11) to RxE (pin 6 on con-
nector J11) before compiling and running this sample pro-
gram.
The BL4S210 model only has one RS-232 serial port avail-
able, and so this sample program cannot be run on the
BL4S210 model.
NOTE:
For the sequence that does yield parity errors, the errors won't occur for each
byte received. This is because certain byte patterns along with the stop bit will appear to
generate the correct parity for the UART.
•
SIMPLE3WIRE.C
—This program demonstrates basic RS-232 serial communication
using the Dynamic C
STDIO
window. Follow these instructions before running this
sample program.
BL4S200, BL5S220, BL4S230 models
—Connect TxE (pin
1 on connector J11) to RxF (pin 7 on connector J11), then
connect TxF (pin 2 on connector J11) to RxE (pin 6 on
connector J11) before compiling and running this sample
program.
BL4S210
—Connect TxB (pin 1 on connector J11) to RxB
(pin 6 on connector J11) before compiling and running this
sample program.
2
7
8
3
9
4
RXF
RXE
TXF
TXE
6
1
5
10
J11
2
7
8
3
9
4
RXF
RXE
TXF
TXE
6
1
5
10
J11
2
7
8
3
9
4
RXB
TXB
6
1
5
10
J11
BL4S210