is a delay really required after sending each charater to TXREG? -----Original Message----- From: "Jason Harper" Sent: 10/01/04 5:58:01 PM To: "PICLIST@MITVMA.MIT.EDU" Subject: [PIC]: UART Help needed to PC David Dolheguy wrote: > static void usartput(unsigned char c) > { > while(!TRMT1) > TXREG1=c; > } This basically says: for as long as there is something in the transmit buffer already, send the same character anyway... You need a semicolon at the end of the 'while' line. Note that TRMT isn't usually what you want to poll for serial transmission: it doesn't get set until the character is entirely sent, when you can actually put another character into TXREG much sooner due to the USART's internal buffering. Poll the TXIF bit instead. Also note that continuously sending the same character is not necessarily going to result in that character being received at the PC, since there's no guarantee that it will sync to your start/stop bits. An occasional pause, of at least one entire character time, will ensure synchronization. Jason Harper -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body