I expect errors and make my parser able enough that if my string/buffer does make sense I just throw away the bad byte/message and move on with things. Should read I expect errors and make my parser able enough that if my string/buffer does NOT make sense I just throw away the bad byte/message and move on with things. Phillip Things should be as simple as possible but no simpler Phillip Coiner CTO, GPS Source, Inc. Your source for quality GNSS Networking Solutions and Design Services, Now! -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of Phillip Sent: Tuesday, September 19, 2006 10:41 AM To: 'Microcontroller discussion list - Public.' Subject: RE: RE: RE: FW: [PIC] Trouble getting my ISR high Hi Neil Well that makes/made sense to me...........till I read the data sheet and on page 94 in the interrupts section it says that reading the RCREG receive buffer clears PIR3.RC2IF interrupt flag bit. I originally planned to clear the bit and I suspected the same thing so I tried clearing the flag in the first line of my ISR. It makes no difference if I don't have the section that clears the over run error then I stop getting interrupts after two characters/interrupts. I can't understand what is magic about two if that is not the reason or why an over run should stop the UART from going on with its life. Why does in not throw an error and then clear the error on the next good character? I thought the over run and framing error was just a check to see if the byte was good. On my other port I never check for any errors. I expect errors and make my parser able enough that if my string/buffer does make sense I just throw away the bad byte/message and move on with things. If it were locking up like this one I would be hung up all the time just by plugging and unplugging the cable in the middle of things but that has no effect on the first serial port/its ISR. I do suspect if I knew why this happens I could put the thing high. void handle_chars_gps(void) { PIR3bits.RC2IF = 0; //reading a char is supposed to clear the interrupt flag so I should not need to do this either way this makes no difference if (RCSTA2bits.OERR) { RCSTA2bits.CREN = 0; //disable then enable the receiver to clear the over run error RCSTA2bits.CREN = 1; //if I don't do this I only get two interrupts and then they just stop return; } char_holder = getc2USART(); //this causes problems even with out pushing the the character to the buffer if I make the thing a high priority Thanks again for the help Phillip Things should be as simple as possible but no simpler Phillip Coiner CTO, GPS Source, Inc. Your source for quality GNSS Networking Solutions and Design Services, Now! -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of Neil Baylis Sent: Tuesday, September 19, 2006 9:52 AM To: Microcontroller discussion list - Public. Subject: Re: RE: RE: FW: [PIC] Trouble getting my ISR high Phillip, RCSTA2bits.CREN = 0; //disable then enable the receiver to clear the over run error RCSTA2bits.CREN = 1; //if I don't do this I only get two interrupts and then they just stop The two interrupts would be: 1, an interrupt for receiving a character. 2, an overrun interrupt. Is that correct? If so, it means you're not clearing the interrupts correctly. When the second character arrives, the uart thinks you haven't read the first one, so it posts the overrun error. Neil -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist