Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

interrupt

Status
Not open for further replies.
im using pic 16f877a for my project....i want to use interrupt in it...i heard that i shouldnt make isr much long and should avoid calling subroutines like delay loops within isr.....is there some relevance to the statement....im currently facing some delay as i exit the isr which is not intended...how can i avoid it?....should i make interrupt routine small.....also can i call interrupt when im in the isr by clearing the interrupt bits...........


i hope some one ll b having a gud answer.....
 
so can i make a table within the isr and call subroutines which are defined inside isr.....?

how can i do things without calling even delay loops....i need delay to make the motors respond accurately......how can i do it......?
 
im attaching my code ......
i found that its taking much time to exit the isr when i simulated it....is the clearing of the flag i have done proper.....should the external interrupt flag be cleared within the isr........can i call subroutines as i have done which are inside the isr?
 

Attachments

  • program.txt
    9.9 KB · Views: 152
Last edited:
inrstdinrobotics said:
so can i make a table within the isr and call subroutines which are defined inside isr.....?

how can i do things without calling even delay loops....i need delay to make the motors respond accurately......how can i do it......?

The usual method is to use the ISR just to set flags, the main program loop then checks the flags and branches accordingly.

Your code is very confusing, as you're using numbers for registers and bits, use their names instead as defined in the include file.
 
Status
Not open for further replies.

Latest threads

Back
Top