Hello!
I'm fighting a strange behavior in what should be a very simple situation:
I compiled and ran this test code:
for (;;)
{
FGPIO_PCOR_REG (portIO) = maskIO2 | maskIO3; // IO LO
FGPIO_PDDR_REG (portIO) |= (maskIO2 | maskIO3); // IO Output 0.008
FGPIO_PDDR_REG (portIO) &= ~(maskIO2 | maskIO3); // IO Input 0.187
FGPIO_PSOR_REG (portIO) = maskIO2 | maskIO3; // IO HI
FGPIO_PDDR_REG (portIO) |= (maskIO2 | maskIO3); // IO Output 3.321
FGPIO_PDDR_REG (portIO) &= ~(maskIO2 | maskIO3); // IO Input 2.736
}
Single stepping through this code, I measured, after each line execution, the voltages shown at the right:
I must say I'm stuck! No idea why this is happening. I would appreciate anyone pointing out where am I busting it!
Jorge
Try setting the corresponding bits in FGPIOx_PIDR to '0'.
Regards
Mark
http://www.utasker.com/kinetis.html
http://www.utasker.com/kinetis/FRDM-KE02Z.html
http://www.utasker.com/kinetis/FRDM-KE02Z40M.html
No results... :-(
Anyway I'd need the input function enabled.
Thanks!
Jorge
FGPIOx_PIDR defaults to 0xffffffff, which means that the pin is NOT configured as general purpose input. To use it as input you will need to set the bits to '0'. However, it doesn't look to have any effect on the high leakage that you presently have.
What happens when you hold the processor in RESET? All pins should then be in high impedance state during and immediately after reset - if you get high leakage it can only be the chip (or other circuitry).
Regards
Mark