Examples | Shop
 
Bi-directional RS232 serial communication with the Interface Module
Bi-directional serial
communication between
OOPic and PC
 
This application note shows how the OOPic microcontroller, in conjunction with the Interface Module, can be used to perform bi-directional serial communication with a PC.
In the example an OOPic, according to an instruction issued from a PC, lights a red or green led. The OOPic sends a reply to the PC to confirm that the instruction has been received.
When the OOPic receives the character string 'red' it switches on the red led and then sends the string 'OK' to the PC. If it receives the character string'green' it switches on the green led and replies 'OK'.
The code (download the file below) uses four subroutines to achieve the necessary FIFO buffering and flow control.
The OOPic code (compiler version 3.0.4) can be downloaded here serial_comms_demo.osc.
A HyperTerminal session file to configure your PC (COM1) to talk to this routine can be downloaded here direct_to_com1.ht.
A HyperTerminal session file to configure your PC (COM2) to talk to this routine can be downloaded here direct_to_com2.ht.
Examples | Shop