Could somebody please have a look at my code below which I have written in MPLAB and will be using HTSOFT PIC18 C to compile. I am trying to develop a program which will continuously send the letter 's' via serial to Hyperterminal on a PC. I think I have setup the baud rate correctly, but am not really sure (I want to use 9600 with a 19.66Meg Clock on the PIC chip) If this is incorrect could somebody please show me the correct way to do this?? I do not want to receive data, just send the letter 's' over and over again. I have so far written the following code: #include #include #define BAUD_RATE 9600 #define CLOCK_FREQ 19660000 #define USARTGET (RCREG1) #define DATA 1 static void usartput(unsigned char c); static void usartput(unsigned char c) { while(!TRMT1) TXREG1=c; } bit kbhit(void) { unsigned char b; if(RCIF) { if(FERR1||OERR1) { b = RCREG1; CREN1 = 0; CREN1 = 1; return(0); } else return(1); } return(0); } void main(void) { TRISC7 = 1; SPBRG1 = (((CLOCK_FREQ/BAUD_RATE)/64)-1); TXSTA1 = 0b00100000; RCSTA1 = 0b10010000; do usartput('s'); while(DATA == 1); // if(kbhit) // DATA = USARTGET; } ________________________________________________ Message sent using UebiMiau 2.7.2 -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body