Jared Sanson wrote: > Hello, I am having trouble with my PIC18F4550's USART module: > > Transmitting is fine, works perfectly > > However I can not get my code to receive properly. > > I used the following code: > > while (!PIR1bits.RCIF) {} > > return RCREG; > > But it doesn't work properly. > > It waits until the first byte is received, and using an if() statement I > can check the byte is valid, > > But after this it just skips through the routine, returning the same > byte value. Can you post the rest of your code? Are you doing anything with the CREN/SREN bits? Vitaliy -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist