PDA

View Full Version : Assembler and interrupt problem



milanche
- 21st September 2006, 08:36
I have a program written in PBP(ver.2.44 and 16F870) with part of code in assebler. Assembler code is used for pause. Without assebler code everything works fine. It looks like that if interrupt occures during assebler code, it can not go back.

mister_e
- 21st September 2006, 15:47
More you give details (code, schematics) more you have chance to have solutions. As now, i don't see how we can help you.

Ron Marcus
- 21st September 2006, 17:24
I have a program written in PBP(ver.2.44 and 16F870) with part of code in assebler. Assembler code is used for pause. Without assebler code everything works fine. It looks like that if interrupt occures during assebler code, it can not go back.

Why do you need assembly code for the delay? At least show the assembler portion of the code. It sounds like your variable for counting the delay increment is being overwritten by your interrupt routine. If the mL code is used for a very short delay...only reason I can think to use it, turn off interrupts while in the delay code, and turn it back on after. Or... If you need to go to the interrupt routine ASAP, disable the interrupt, and poll the interrupt flag regularly during your delay loop.

Ron