Hello,
I'm testing a board with KL16. In some cases I noticed that when I change the direction of an unused pin that was an output to 0 and becomes an input, sleep mode consumption changes from 2 uA to 30 -150 uA. I don't know why.
Could somebody help me? Thanks.
/* PTA2 NOT MORE USED - Set as output forced to 0 */
PORTA_PCR2 = (uint32_t)((PORTA_PCR2 & (uint32_t)~(uint32_t)(ORT_PCR_ISF_MASK | PORT_PCR_MUX(0x06))) |
(uint32_t)(PORT_PCR_MUX(0x01)));
sleep(); /* (it's ok 2uA after sleep) */
GPIOA_PDDR &= ~(0x04);
sleep(); /* (KO 30 and more uA after sleep) */
Daniele
Floating pins will increase low power current consumption by quite large amounts (also peripheral inputs that are floating).
Therefore you need to either drive them to defined levels (as you were doing with the output) or pull them up or down to stop them floating. You switch in a pull-up / down in the pins characteristics setting of the majority of pins (PORTx_PCRy) which will then ensure lowest current consumption.
Regards
Mark
Hi Daniele,
And I have another advice to hardware connection. Please refer to KL17 datasheet table 46. It recommend connection for unused analog interface. KL16 datasheet hasn't this table. But it is useful to your design.
Regards,
Jing