software uart+pic16f877a+hitech c

Status
Not open for further replies.

manikandanshine

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.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…