AT91SAM7SE256, totally idle clock and wake up from I/O int?

My application has an AT91SAM7SE256 in it. Normally it runs from an external crystal that is fed through the internal PLL to yield a MCK frequency of 24MHz. However, when I discover a USB disconnect (this is done sensing the VBUS voltage with an external circuit that sets an I/O pin to 1 or 0).

I detect this I/O in an ISR, and decide whether I have lost USB connection or not. If the connection is lost, then I want to set the CPU core totally idle (not 500Hz slow clock, but total 0Hz sleep), and only wake up when the I/O pin returns high. The datasheet says that the slow clock is selected (and the CPU subsequently awaken) when any enabled interrupt occurs. There is however a problem with this, as the PIO block as stated in the datasheet chapter 34.3.3, requires the PIO clock (and thus MCK?) to be valid/turned on to catch a rising/falling edge interrupt.

Could someone please clarify if it is possible or not for me to wake up on a PIO line edge interrupt while sleeping with the CPU totally turned off? Battery power consumption is a make or break in this project, so dealing with this issue at an early design stage is crucial.

Best Regards

Daniel Nilsson

I am not completely sure about this, but maybe it’s still useful.

If you want a PIO edge-detection to wake the CPU, you must be clocking the PIO-controller. So, the CPU itself can be shut down completely, and be woken by the PIO.

But, why not use one of the dedicated IRQ-pins. That way you can disable the PIO for this pin and have the actual pin-status trigger the interrupt-controller waking the CPU.

You’ll still have the main clock running at some low frequency, otherwise the interrupt controller couldn’t wake the chip. But if you use the rc-oscillator as main-clock and turn off every other clock, you will be down to the very minimal power consumption.

If you’re down to saving the last µA, aren’t there better chips to begin with than an “old” ARM7?

monstrum:
I am not completely sure about this, but maybe it’s still useful.

If you want a PIO edge-detection to wake the CPU, you must be clocking the PIO-controller. So, the CPU itself can be shut down completely, and be woken by the PIO.

But, why not use one of the dedicated IRQ-pins. That way you can disable the PIO for this pin and have the actual pin-status trigger the interrupt-controller waking the CPU.

You’ll still have the main clock running at some low frequency, otherwise the interrupt controller couldn’t wake the chip. But if you use the rc-oscillator as main-clock and turn off every other clock, you will be down to the very minimal power consumption.

If you’re down to saving the last µA, aren’t there better chips to begin with than an “old” ARM7?

Thanks for answering,

The problem here is that as the SW guy, I have been given a design to work with. Set in stone more or less.

I don’t need that low power consumption, running on a few hundred uA is good enough.