Serial Data Transfer to PC(Personal Computer) using PIC16f877 Microcontroller USART
Here is a simple project on How to transmit serial data to pc using built in usart(universal Syncronous-Asyncronous receiver transmitter)of PIC 16f877 microcontroller. The data Transmitted by PIC microcontroller is received by computer through its (Serial)DB-9 Port and is displayed on Hyperterminal window. Since microcontrollers works on TTL wave form and standard PC(Personal Computers) works on RS-232 wave form so we have to convert our transmitted data from microcontroller into RS-232 wave form. The best way is to use MAX-232 ic. It converts TTL wave form in to RS-232 and RS-232 to TTL.To learn about its Pin out and working below is a good tutorial.
The TX or transmission line of Usart is at pin 25 of PIC 16f877. Connect this transmission line to pin 10(T2IN) of MAX-232. Connect Pin# 7(T2OUT) of MAX-232 to pin# 2 of DB-9 port of your PC. Connect four Capacitors to MAX-232. The Capacitors should range between 1uf to 10uf. I recommend 10uf because i used it in mine project and the circuit is working fine. Apply 5v to vcc pin of microcontroller and MAx-232. Ground Gnd pins of microcontroller and MAX-232. Inserst 20MHz crystal between pins 13 and 14 of PIC 16f877. Crystal should be in parallel to two 33Pf capacitors.
First of all to enable the serial port or TX(Transmission) RX(Reception) line. The SPEN(Serial port enable bit) bit of register RCSTA(Receive status and control register) should be high.
EasyEDA: Ideas for Circuit Design, Innovation for Electronics Access
Free Circuit Design: Schematic – Simulation – PCB Layout – Gerber Viewer
JLCPCB Prototype: Only $2 for 10pcs 10×10cm, 24 hours Quick Turn, DHL Delivery in 3 days