Software Implementation of Asynchronous Serial I/O
M
AN555
Software Implementation of Asynchronous Serial I/O
Author: Code Update:
Amar Palacherla Microchip Technology...
Description
M
AN555
Software Implementation of Asynchronous Serial I/O
Author: Code Update:
Amar Palacherla Microchip Technology Scott Fink Microchip Technology Inc.
INTRODUCTION
PIC16CXXX microcontrollers from Microchip Technology, Inc., high-performance, EPROM-based 8-bit microcontrollers. Some of the members of this series (like the PIC16C71 and PIC16C84) do not have an on-chip hardware asynchronous serial port. This application note describes the interrupt driven software implementation of Asynchronous Serial I/O (Half Duplex RS-232 Communications) using PIC16CXXX microcontrollers. These microcontrollers can operate at very high speeds with a minimum of 250 ns cycle time (with input clock frequency of 16 MHz). To test the RS-232 routines, a simple Digital Voltmeter (DVM)/Analog Data Acquisition System has been implemented using a PIC16C71, in which, upon reception of a command from host (IBM PC-AT®), an 8-bit value of the selected A/D channel is transmitted back to the host.
IMPLEMENTATION
A half duplex, interrupt driven, software implementation of RS-232 communications, using a PIC16C71, is described in detail below. The transmit pin used in the example code is RB7 and the receive pin is connected to the RA4/T0CKI pin (Figure 2). Of course these pins are connected with appropriate voltage translation to/from RS-232/CMOS levels. Schematics describe the voltage translation in the hardware section of this application note.
Transmit Mode
Transmit mode is quite straight-forward to i...
Similar Datasheet