Hello all, I recently started playing around with SDCC to program PIC16 devices. I'm moving from a compiler that implemented interrupts in software (by appending an if...then after every line of code!), so hardware interrupts are new and marvelous enigmas to me. Forgive my ignorance! :)
I have a few general questions about their behavior in several situations: 1. Firstly, how do the interrupt flags work? Do they immediately and always cause a vector to the ISR as long as they are set? If I were to not reset the interrupt flag after servicing a routine, would it infinitely loop that routine? 1a. If not, how does SDCC handle interrupts that happen during a __critical block (or similarly, low priority interrupts that happen during a high priority ISR, or if I'm manually masking interrupts with the interrupt enable bit)? Does it immediately vector to the interrupt after it is re-enabled? Or is this something that must be checked in software? 2. Do interrupts of the same priority level interrupt each other, or do they wait for the other to finish? 3. I think I understand this one, but correct me if I'm wrong. There's a warning in the documentation about non-atomic math and assignment functions with respect to 16 bit variables. It only matters if those 16 bit variables are used in the ISR, correct? The chip will still accurately finish 16 bit operations when the ISR returns; the problem is just the intermediate state, right? 4. If I keep my ISRs relatively short (specifically -- so they execute faster than the time it takes to send one byte through USART), do I need to worry about interrupting my printf()s to the STREAM_USART? Thanks for your insight! Matt ––––––––––––––––––––––––– Matt Bauman Research Technician, Miller Lab Physiology, Ward 5-150 Northwestern University ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Sdcc-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sdcc-user
