2005-06-03 11:22 AM
Unexpected interrupt behaviour ST72521(72321)
2005-05-18 11:47 AM
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, davef2005-06-03 11:22 AM
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