I wrote a code with several ISRs. I use the using command when calling ISR. I use banks 1 and 2 for the ISRs. when i look into the *.M51 file created after compilation i got the following: TYPE BASE LENGTH RELOCATION SEGMENT NAME -----------------------------------------------------
* * * * * * * D A T A M E M O R Y * * * * * * * REG 0000H 0008H ABSOLUTE "REG BANK 0" REG 0008H 0008H ABSOLUTE "REG BANK 1" DATA 0010H 0004H UNIT _DATA_GROUP_ 0014H 000CH *** GAP *** I wonder why the Linker doesn't reserves memory for REG bank 2?
Hi Al thanks for your response. i haven't seen it before. i thought i'll get a mail with the response. anyhow, per your request pls find the relevant code below
INTERRUPT_USING (RTC0ALARM_ISR,INTERRUPT_RTC0ALARM,2) { EIE1 &= ~0x02; Inc_TimeFlag=1; }
the INTERRUPT_USING is defined as follows:
# define INTERRUPT_USING(name, vector, regnum) void name (void) interrupt vector using regnum
beside this isr i use several other isrs, most of them are directed to using 1 for example
void Timer_0_Interrupt (void) interrupt INTERRUPT_TIMER0 using 1 { TH0=0xff&((-TC_650uS)>>8);TL0=0xff&(-TC_650uS);//reinstate 650uS pulse width .... .... }
If the interrupt code does not used any of the registers. Have you checked this?
INTERRUPT_USING (RTC0ALARM_ISR,INTERRUPT_RTC0ALARM,2) unless you have some hefty defty macros, that will not work in Keil
my guess is a 'macro error'
try using non-macro ISR (void) xxxISR interrupt n using 1 {