??? 04/01/09 06:15 Read: times |
#164110 - thanks >> it's working >> further Responding to: ???'s previous message |
I had removed disabling interrupts in ISR's, and used the concept suggested by you to store/restore EA. I had used Keil intrinsic macros _push_() and _pop_() to solve my purpose. The system is running fine and it is stable. The function with modified code is:
#include<intrins.h> void dtmfreceive(void) { _push_(IE); //KEIL INTRINSIC ROUTINE EA = 0; //DISABLING ALL INTERRUPTS -- -- //REST OF Function CODE -- _pop_(IE); //KEIL INTRINSIC ROUTINE } This same modification is required in some parts of code, where there is a direct access to the stack. That is actually a part of saving the task's context and its stack at the time of task switching, and happens forever in the superloop. The code is: unsigned char volatile tempSP; void taskCtxSwch(void)/*CYCLIC TASK SWITCHING SCHEDULING POLICY*/ { -- -- /*STORING ACC,B,DPL,DPH REGISTERS INTO TEMP VARIABLES*/ EA = 0; tempSP=SP; getNextTask(); /*THIS FUNCTION TAKES A BACKUP OF PRESENT TASK'S PSW,ITS FUNCTION ADDRESS,ITS USED STACK, ITS REGISTER BANK ENTRIES. THEN, IT INVOKES THE NEXT READY TASK AND LOADS ITS PREVIOUSLY STORED PSW, REG BANK, STACK AND SO ON.INTERRUPTS ARE DISABLED DURING THIS ENTIRE PROCESS*/ EA = 1; -- -- /*RESTORING ACC,B,DPL,DPH REGISTERS FROM TEMP VARIABLES*/ } The same modification of disabling/enabling interrupts thro Keil intrinsic _push_() and_pop_() are not supported here. For this, the changes done are: unsigned char volatile IE_VAR; void taskCtxSwch(void) { -- -- IE_VAR = IE; EA=0; -- -- IE = IE_VAR; -- } Q: Is it a correct way to store/restore IE? What is the effect on the performance of the system? |
Topic | Author | Date |
EA in "Interrupt service routine" | 01/01/70 00:00 | |
yes,no | 01/01/70 00:00 | |
both are wrong | 01/01/70 00:00 | |
... including this one? | 01/01/70 00:00 | |
well, I'll be | 01/01/70 00:00 | |
thanks >> it's working >> further | 01/01/70 00:00 | |
but WHY are you doing that? | 01/01/70 00:00 | |
Now i am not doing EA=0 in ISR. | 01/01/70 00:00 | |
ah, then it's OK![]() | 01/01/70 00:00 |