On 22/06/2011 11:14 AM, Josh Koffman wrote: > 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. There >> 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. The chip is actually a PIC18F45K22. I was working on another board when=20 I wrote my email ! I've just checked and ANSELx are not being cleared. Looks like I need=20 to learn more about the BSR. David... --=20 ___________________________________________ David Duffy Audio Visual Devices P/L Unit 8, 10 Hook St, Capalaba 4157 Australia Ph: +61 7 38235717 Fax: +61 7 38234717 Our Web Site: www.audiovisualdevices.com.au ___________________________________________ --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .