Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

software uart+pic16f877a+hitech c

Status
Not open for further replies.

manikandanshine

Full Member level 1
Full Member level 1
Joined
Aug 15, 2012
Messages
99
Helped
7
Reputation
14
Reaction score
7
Trophy points
1,298
Location
india
Visit site
Activity points
1,809
i want to use two uart in my project....anybody how to use two uart in pic16f877a by using hitech c compiler.....anybody knows plz help me.....
 

It is available in microchip site itself.... once again read the datasheet of PIC16f877a
Code:
// U A S R T   C O N F I G
   TXSTA   = 0b00100000;
   SPBRG   = 0x33;         // Baud = 1200
   RCSTA   = 0x80;         // Enable serial port and dis RX

void WriteUSART( unsigned char data )
{
   while(!TXIF);         // Wait till reg is empty
   TXREG = data;
}

// For RX
// U A S R T   C O N F I G
   TXSTA   = 0b00000000;   // Tx Disables
   SPBRG   = 0x33;         // Baud = 1200
   RCSTA   = 0x90;         // Enable serial port and Rx

// Read RCREG if RXIF is set
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top