Hi Guys!
I am extremely confused as to how interrupts and ISRs work. I have never worked with interrupts and have just begun with PICs. I am using microC for programming. The following questions may sound very lame, but please do help me out.
1. interrupts are written like any other function. am I correct? or do they have to be in the function void interrupt()?
2. checking of flags should be done in void interrupt()? and should this function be a part of main()? if yes then am i not wasting processing time?
3. if i do check flag outside of main() but in interrupt()....how is this function invoked?
4. how do i invoke handlers?
5. I understand that there are many pre defined interrupts in PIR1 and 2. Can I have software interrupts too?
If there is a tutorial on the same pls do share it with me. I havent been able to find one answering the above questions.
Thanks in advance
Regards,
pyridot
I am extremely confused as to how interrupts and ISRs work. I have never worked with interrupts and have just begun with PICs. I am using microC for programming. The following questions may sound very lame, but please do help me out.
1. interrupts are written like any other function. am I correct? or do they have to be in the function void interrupt()?
2. checking of flags should be done in void interrupt()? and should this function be a part of main()? if yes then am i not wasting processing time?
3. if i do check flag outside of main() but in interrupt()....how is this function invoked?
4. how do i invoke handlers?
5. I understand that there are many pre defined interrupts in PIR1 and 2. Can I have software interrupts too?
If there is a tutorial on the same pls do share it with me. I havent been able to find one answering the above questions.
Thanks in advance
Regards,
pyridot