2.4.1 Disable the clocks to unused peripheral modules
The XMEGA devices have a very rich set of peripherals available, and each peripheral will add a small contribution to the total current consumption. The clock domain of most peripherals can be disabled independently, and by removing the clock signal to an unused peripheral, the dynamic power consumption contribution of that peripheral will be removed.
There are seven PR registers available on the ATxmega128A1U (no PORT F), see section "Register Description – Power Reduction" in the XMEGA AU Manual.
As an example, disabling the AES and EBI module is done by setting the corresponding bits in the PR.PRGEN register like this:
PR.PRGEN = PR_AES_bm | PR_EBI_bm.
The following modules can be disabled:
- PR.PRGEN:
- AES
- EBI
- USB
- PR.PRPA:
- AC
- DAC
- PR.PRPB:
- AC
- ADC
- DAC
- PR.PRPC:
- TWI
- USART1
- USART0
- SPI
- HIRES
- TC1
- TC0
- PR.PRPD:
- TWI
- USART1
- USART0
- SPI
- TC1
- TC0
- PR.PRPE:
- TWI
- USART1
- USART0
- SPI
- HIRES
- TC1
- TC0
- PR.PRPF:
- TWI
- USART1
- USART0
- SPI
- TC1
- TC0