Tutorial 7:  Aysnchronous USART echo

The PIC16F877 has an onboard USART which can operate either synchronously or asynchronously. This tutorial demonstrates asynchronous operation. It listens for a 9.6Kbaud RS232 signal and echo's any data it receives.

Download FEATURE877_Tutorial7.zip and unzip into folder <your path>\Tutorial 7

Filename Version Description
tut7.pjt 1.0 MPLAB (2.3) Project
tut7.asm 1.0 PIC16F877 Assembler code
tut7.hex 1.0 Precompiled HEX
tut7.lst 1.0 Precompiled LST
tut7.vbb 1.0 Virtual Breadboard simulation

Running the Simulation

Open tut7.vbb and press RUN. Using the terminal enter 'Hello World' and click Transmit. The RS232 terminal will transmit this string in 9600 RS232 format which is received and echo'd back to the terminal. After a short delay 'Hello World' appears in the Termainal Text Received window.

Code Walk Through

 

Features Demonstrated

TRISC/PORTC

USART Asynchronous Mode

USART Receive Interrupt

USART Receive

USART Transmit