I've been trying to enable pullups on input pins PORTB20 and 21 on the MKV31F512VLL12, and I'm getting no results. The output is not changing at all. I can see the registers getting set for the PS and PE bits, and the port is set as an input. The board simply bring the pins out to the connector, and there is nothing else connected to it (connector is unplugged). The only thing I can think of is that maybe kv31 does not support pullups on these pins. The datasheet is not exactly clear on whether they are or not
Hi Geoffrey Lansberry,
Have you try to select PTB20 and PTB21 as GPIO function? (for exampe: PORTB_PCR20[MUX]=001)
The internal pull-up should be set the pin to high voltage.
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Yes, I tried that, no pull up is happening: Here are the relevant register settings.
Both outputs are configured as inputs, as you can see above (PDD = 0, right?)
One input is sitting at 0.2v the other is at .06. Interestingly, I can't pull them up with a 4700ohm resistor. Am I missing a setting somewhere? It's acting like they are set as outputs.
So, I tried to change the pin to an output, and write a 1, I also don't get any change
I set PDD= 0x00300000
and PDO= 0x00300000
both pins are still the same. Either I'm doing something wrong, or those inputs are damaged. Thanks for the help.
Geoff
Please measure the voltage of the pin at MCU(instead of the pin at connector).
Please test the input_interrupt example in SDK_2.3.0_FRDM-KV31F(C:\SDK_2.3.0_FRDM-KV31F\boards\frdmkv31f\driver_examples\gpio\input_interrupt)
I just test the example after enable pullup these two pins. The voltage can be high after run the PORT_SetPinConfig.
I have attached pin_mux.c file.
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thanks Robin - I have discovered that my processor will no longer recognize the input, so I think it's safe to say that the processor has been damaged. I'll try this again if i can get the processor replaced.
You can close the issue for now.