Control PIC Serial Port | Controller Circuit

Sunday, January 6, 2013

Control PIC Serial Port

This is a tutorial for microcontroller tutorial circuit (you can use it on any other PIC device even a 16F84 as it uses a software implementation of the transmit part of a USART). The circuit uses the standard MAX232 level translator chip but you could use an SP202ECP which has identical pin out (and is cheaper!) and lets you use 100nF capacitors instead of electrolytic ones. Connect the ground and transmit output to a serial port connector as shown and to a serial cable from it to the PC and it's ready to go. This is the figure of the circuit;


The code for the TX part of the USART is simplified in that it generates 10 bits of serial data with no parity bit. Since each bit takes 1/2400 seconds the total time to transmit a digit is 4.16ms.  Adding a pic serial port connection to the circuit gives you scope for much more interesting projects as you can collect data from the ADC (inputs) or comparator or external infrared receiver module etc. and transmit it to a PC.

No comments:

Post a Comment