??? 08/23/04 09:38 Read: times |
#76274 - Interrupt discipline... Responding to: ???'s previous message |
Hi Ghulam,
I think Oleg has pointed out certain issues. Besides them just take note of the following general but important issues : - Always save your ACC, PSW before entering the ISR and restore them before the RETI. - You are in grief if you jump out of an ISR bypassing the RETI. - Switch the register bank to something that is not used in the main line code. Like if you are using bank_0 in main line, switch to bank_1 inside ISR and don't forget to switch back to bank_0 before RETI. - And if your main line code uses the DPTR in a big way it would be nice to use a MCU with dual DPTR : DPTR_0 for the main line and DPTR_1 inside the ISR. - Learn to write good comments and name your labels with some meaning instead of simple TA and ALI. If you are serious about coding for MCU, the above are rules that you cannot afford to ignore. The earlier you fall in line the better. With or without the above in place your current code MAY work - but rest assured that cannot be said of all codes that ignore the above basics. PS: Your SKIP routine is an example of a "fatal loop". It loops forever till something else "hangs" the MCU. Cheers Raghu |
Topic | Author | Date |
Handling the timer | 01/01/70 00:00 | |
RE: Handling the timer | 01/01/70 00:00 | |
RE: Handling the timer | 01/01/70 00:00 | |
RE: Handling the timer | 01/01/70 00:00 | |
RE: Handling the timer | 01/01/70 00:00 | |
RE: Handling the timer | 01/01/70 00:00 | |
RE: Handling the timer | 01/01/70 00:00 | |
Interrupt discipline... | 01/01/70 00:00 | |
RE: Handling the timer![]() | 01/01/70 00:00 |