On Tue, Jun 21, 2011 at 8:58 PM, David Duffy (AVD) wrote: > I am using a PIC16F1827 as it has 2 UARTS and is 5V. > > One the first UART, I have it transmitting, but can't seem to get > receive working. > > I have: > 1) Set TRISC,7 to make RC7 an input > 2) Cleared ANSELC for digital i/o > 3) Set RC1STA,CREN to enable receiver 1 > 4) Set RC1STA,SPEN to enable uart 1 > 5) Set PIE1,RC1IE to enable RX1 interrupt > 6) Set INTCON,PEIE to enable peripheral interrupts > 7) Set INTCON,GIE to enable global interrupt > > The baud rate is correct, as I have the same UART sending data at 57600 > 8N1 and that's all good. > > I am testing the interrupt by turning on an LED when it's called. =A0Ther= e > is definitely data on the RX1 pin, but it seems to be ignoring it. David, do you have anything capable of in circuit debugging? It might help to step through your code and ensure that the bits are being set in the correct registers during your setup. If you don't, you could write some code to dump out the contents of various config registers over your working serial TX link. I'm not sure if this chip has it, but on some of the 18F USART modules there is a bit that changes the polarity of the signal. Might make sense to check that it's correct. Josh --=20 A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. =A0 =A0 =A0 =A0 -Douglas Adams --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .