#include <pic.h>
__CONFIG(HS & PWRTEN & WDTDIS & LVPDIS & BOREN & DEBUGDIS);
void main (void)
{
unsigned char ch[7]="fabmax ";
unsigned char i;
/* Configure IO pins. */
TRISC6 = 1;
TRISC7 = 1;
/* Set baud rate. */
SPBRG = 51; //9600 at 8Mhz
// SPBRG = 129; //9600 at 20MHz
BRGH = 1;
/* Select asynchron mode. */
SYNC = 0;
/* Enable transmission.*/
TX9 = 0; //8 bit transmission
TXEN = 1; //tx enabled
/* Enable reception.*/
RX9 = 0; //8 recption
CREN = 1; //rx enabled
/* Enable UART module.*/
SPEN = 1;
while(1)
{
for(i=0;i<=6;i++)
{
// while(!RCIF); //wait to receive a byte
// ch = RCREG;
while(!TXIF); //wait for current transmition to end
TXREG = ch[i];
}
}
}