alan smith wrote: > So I really havent done much with 16F serial, and the 18F stuff I can get to work flawlessy (so far at least), so I am having a small issue with this code on the '913 > > > To preface, it works...almost. I have a string defined such as it uses a jump table to index into it, and has a null on the end to terminate. I can address into it, grab the character and it sends it out, so the USART is setup properly, and single stepping it displays each character, so far so good. > > Now, when I do it full speed....I lose characters. I'm thinking...ok....the buffer isnt clearing out by the time I go to get the next character and send it. Cheating....add delay. But doesnt fully explain things. > > So here is the code that sends the character, held in Wreg > > TX_CHARACTER > banksel TXSTA > bsf TXSTA,TXEN > banksel TXREG > movwf TXREG > _txCharLoop > call DEBOUNCE > btfsc TXSTA,TRMT ; check buffer, wait till empty (1=empty) > goto _txCharLoop > bcf TXSTA,TXEN > return Hmm... Why are you clearing and re-setting TXEN on each character? I don't immediately see how it could cause the behavior you're seeing, but I would delete those lines - all you should have to do is FIRST wait for TRMT to go high, THEN put your data in TXREG. (This is from memory.) -- Timothy J. Weber http://timothyweber.org -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist