re problem: from what l remember (l dont use hardware comms much) the TX interupt flag is to tell you that the sending process is over...not ready to begin... ie. its over put next byte in buffer transmit wait for txif ----- Original Message ----- From: "David Huisman" To: Sent: Wednesday, September 27, 2000 3:23 PM Subject: Serial Setup > I am having problems with the TXIF flag not being set after loading transmit > data into the TXREG. A snippet of code concerning the serial comms is below. > Would someone mind pointing out what I have missed ? The code locks up on > the "while" line. > The watchdog timer is disabled, code is compiled using Hi-Tech C in MPLAB, > then downloaded via Microchip DEBUG ICD to ISP connection on target. I have > tested other code on the platform such as flashing LED's etc attached to > various port pins without problem. > > > THANKS > > void Send(unsigned char tx_byte) > { > TXREG = tx_byte; > while (!TXIF); > } > > void init(void) > { > TRISC = 0x80; PortC = all outputs except RXD > INTCON = 0xc0; Enable global ints, enable PEIE > TXSTA = 0x24; Txen = 1,Sync = 0,BRGH = 1 > RCSTA = 0x50; Spen = 1, CREN = 1 > SPBRG = 129; 9600 Baud, 0.16% error > } > > main(void) > { > for(;;) > { > Send(65); > Delay(200); > } > } > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > use mailto:listserv@mitvma.mit.edu?body=SET%20PICList%20DIGEST > > -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! use mailto:listserv@mitvma.mit.edu?body=SET%20PICList%20DIGEST