manikandanshine
Full Member level 1
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.....
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
// 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