hi all,
The code below is not working...Can anyone advice on this.I'm using PIC16f877.
Thanks
The code below is not working...Can anyone advice on this.I'm using PIC16f877.
Code:
#include <pic1687x.h>
#include <pic.h>
// Transmitter test program
void main() {
TRISC = 0x00 ; //portC as output
SPBRG = 129; // Set the baud rate to 9.6k
BRGH = 1; // Set high baud rate
SYNC = 0; // Set asynchronous
SPEN = 1; // Enable serial port pins
SREN=0;
TX9 = 0; // Disable 9 bit transmission
TXIE = 0; // Disable tx interrupts
RCIE = 0; // Disable rx interrupts
TXEN = 0; //reset the transmitter
TXEN = 1; // Enable the transmitter
while(1) {
TXEN = 1;
while(!TXIF) { // Checks if the transmit flag is down
continue;
}
TXREG = 0b01010101;
}
}
Thanks