cancel
Showing results for 
Search instead for 
Did you mean: 

Unexpected interrupt behaviour ST72521(72321)

dave_festing
Associate II
Posted on June 03, 2005 at 20:22

Unexpected interrupt behaviour ST72521(72321)

2 REPLIES 2
dave_festing
Associate II
Posted on May 18, 2005 at 20:47

PORTA_0 is initialised as an interrupt port.

First action that took place when entering the ISR was to make PORTA_0 a floating input by writing to the Option Register, hopefully to disable further interrupts. Before leaving the ISR this port was reenabled as an interrupt input by another write to the OR.

According to the manual the above is a safe transition, i.e. should not generate any interrupts. See Figure 30 (page 48) in the ST72321R/AR manual.

However, using a clean square wave source (no bouncing) I would get inconsistent behaviour. Sometimes it will miss a rising interrupt and sometimes it would miss a falling interrupt. EICR is set to PA+PF on change (IS21, IS20 to 1, 1).

If I just leave this port as an interrupt port, while in the ISR, everything works properly.

Could anyone suggest where I might have gone wrong?

Thanks,

davef

dave_festing
Associate II
Posted on June 03, 2005 at 20:22

Evidently there is more to writing a good ISR, specifically reads and writes to either the ISPRx and/or EICR reegisters, to effectively disable further interrupts.

davef