#include #include unsigned char i; unsigned int j; void main(void) { RCSTA=0b10010000; //enable serial port, enable continuous read TXSTA=0b00100100; //transmit enabled, asynchronous, high speed mode SPBRG=20; //set baud rate to 56K while(1) { i=0; while(i<255) { while((PIR1 & 0b00010000)==0){}; //wait till the transfer register is empty TXREG=i; //place the data in the transfer register i=i+1; j=0; while (j<65000) //wait a while j=j+1; } } }