4.2.3 RS-232 Serial Communication Sample Programs

JR_FLOWCONTROL.C—This program demonstrates hardware flow control by config- uring Serial Port C (PC3/PC2) for CTS/RTS with serial data coming from TxB at 115,200 bps. One character at a time is received and is displayed in the STDIO window.

To set up the Prototyping Board, you will need to tie PC4 and PC5 (TxB and RxB) together at header J1, and you will also tie PC2 and PC3 (TxC and RxC) together as shown in the diagram.

A repeating triangular pattern should print out in the STDIO window. The program will periodically switch flow control on or off to demonstrate the effect of no flow control.

GND

TxC RxB

RxC TxB

J1

Refer to the serBflowcontrolOn() function call in the Dynamic C Function Refer- ence Manual for a general description on how to set up flow control lines.

JR_PARITY.C—This program demonstrates the use of parity modes by repeatedly sending byte values 0–127 from Serial Port B to Serial Port C. The program will switch between generating parity or not on Serial Port B. Serial Port C will always be checking parity, so parity errors should occur during every other sequence.

GND

TxC RxB

RxC TxB

J1

To set up the Prototyping Board, you will need to tie PC4 and PC3 (TxB and RxC) together at header J1 as shown in the diagram.

The Dynamic C STDIO window will display the error sequence.

46

Jackrabbit (BL1800)

Page 50
Image 50
Digi BL1800 user manual 3 RS-232 Serial Communication Sample Programs