[Icc-mot] 9S08 Interrupt mask.

Gene Norris genenorris at spotengineering.com
Tue May 1 12:13:00 PDT 2007


Bob,

To start a new thread e-mail icc-mot at imagecraft.com instead of replying. 
  (FYI)

Bob Smith wrote:
> A couple lf weeks ago, I mentioned that I couldn't get the RTI on my
> 9S08AW60 to throw interrupts as expected.
You must turn that interrupt on too?! Weren't you talking about
void _HC08Setup(void)?

> 
> Well  the problem is now worse as I can't get the SCIx to throw
> interrupts either.
Are you setting the appropriate flags to enable interrupts for the SCIx 
explicitly?

> 
> Further, according to my debugger (NoIce08) the interrupt mask bit in
> the CCR is set at the entrance to main() and at all other times in my
> program.  Well after a bit of arm-chair digging in the AW60 Data Sheet
> this A.M. it seems that the AW60 comes out of reset with the I bit in
> the CCR set, thus masking all interrupts.  This is, they claim, to allow
> me time to set up the stack pointer, et al.  OK, I can live with that
> but, I have a fussy client who insists that everything be done in C so I
> am not happy with the idea of sticking an "asm("CLI") in main() or my
> HC08Setup routine.  Of course I could modify the library cstart routine
> and hide a CLI in there.
I would put it in main in your case. Use the setup for port and 
peripheral (SCI, timer...) configuration. Then enable interrupts in main...

> 
> Anybody got any better ideas;  how do _you_ deal with this problem??
You could use

#define INTERRUPTS_ON()    asm("cli")
#define INTERRUPTS_OFF()   asm("sei")

The following used to be defined in the hc12 header

#define INTR_ON()       asm("cli")
#define INTR_OFF()      asm("sei")

This give the illusion of 'C' in your program. Embedded systems _Always_ 
have this sort of work around. Nobody should fuss.

Good luck.



> 
> All suggestions welcome.
> 
> Many thanks, Bob Smith
> 
> ---------------------------------------------------------
> PCB and Embedded Control Sys Design
> Smith Machine Works, Inc.
> 
> http://www.smithmachineworks.com
> 
> _______________________________________________
> Icc-mot mailing list
> Icc-mot at imagecraft.com
> http://dragonsgate.net/mailman/listinfo/icc-mot
> 
> 

-- 
Gene Norris
Chief Engineer

SPOT Engineering, Inc.
1261 Campground Road
Lancaster, Ohio 43130
740.654.0880
FAX.654.0889

http://www.spotengineering.com/



More information about the Icc-mot mailing list