Hi Jan-Erik Yes you are correct I could just run everything at the same priority. But I should be able to put either one of my serial port ISRs as a high priority. My ISR routines are poorly named but they do exactly what you suggest. The bulk of the work i.e. the messages are parsed, in the main routine. I can put one high with no problem it is the one that is fleshed out and looks for start and stop characters and makes sure the length of a command is reasonable. Look at the ISR that is giving me troubles in my reply to Neil. There is absolutely nothing going on there but as a high priority ISR it reeks havoc with my code but it works fine (doing nothing but reading a char and dropping it) at a low priority. Thanks in advance 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 Jan-Erik Soderholm Sent: Tuesday, September 19, 2006 5:09 AM To: piclist@mit.edu Subject: RE: FW: [PIC] Trouble getting my ISR high Phillip, I think you're highly overcomplicating things. Probably by trying to do way to much in your interrupt routines. Try to simplify things. Do not use the double level interrupts, that's just messes up things, and you do not need that kind of respons time, do you ? By using one interrupt prio level, you get automatic state saving and an overall more "clean" interrupt environment. You have two serial lines going at 9600 and 4800 bud and all you have to do in the ISR is to get the recevied char and save it away in some buffer. Maybe setting some flags to signal to the main code that either "a character has been recevied" or that "a full message/package/whatever has been recevied". Or, to put it in another way, your routines handle_chars_gps() and handle_chars_cntrl() should be run from main (when a flag from the ISR told you so) and the ISR should use something like save_chars_gps() and save_chars_cntrl()... Jan-Erik. -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu]On Behalf Of Phillip Sent: den 19 september 2006 05:09 To: 'Microcontroller discussion list - Public.' Subject: RE: FW: [PIC] Trouble getting my ISR high Hi John That all makes sense and explains the strange behavior I was seeing except why one works high (by itself) but not the other one. Telling my compiler my high was low and resetting the GIEH in the ISR sounds tricky but doable but there is no reason for that kind of heroics here. I think the moral of the story is to only put one of my ISRs as high priority and move on with my life. I'm not sure why when I tried to put the handle_chars_gps() high and the handle_chars_cntrl() low it didn't work...no doubt I missed setting something correctly. I will fool around with it the morning because given my druthers the GPS receiver is the more important of the two devices. Thanks so much for the help John 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 John Temples Sent: Monday, September 18, 2006 8:46 PM To: Microcontroller discussion list - Public. Subject: RE: FW: [PIC] Trouble getting my ISR high On Mon, 18 Sep 2006, Phillip wrote: > So what you are saying is that if I'm in a high priority interrupt and > another one happens I'm toast???? If another interrupt flag becomes set while you're in the ISR, you will not normally re-enter the ISR, because the PIC has cleared GIEH. You would only re-enter if you had set GIEH in the ISR, which is not something that is normally done. -- John W. Temples, III -- 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 -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist