Configure allocated pins as GPIO - preferred way?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Configure allocated pins as GPIO - preferred way?

790 Views
davidrea
Contributor II

I am working with a KL25 MCU, configured by Processor Expert under KDS 3.0.0. Some pins are muxed to SPI peripherals, among others.

 

When switching to low power mode, I need to set the output states of these pins, or switch them to act as inputs, to avoid drawing unnecessary current through external pull resistors, or asserting push-pull outputs into ICs that are externally powered-off.

 

Is there a preferred method in Processor Expert to allow a pin's configuration to swap between a peripehal and a pre-defined GPIO configuration at runtime?

 

Thanks,

Dave

Labels (1)
0 Kudos
2 Replies

517 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi David,

You could use the pin sharing option to be able to use the same pin with your SPI and GPIO components, and use the set direction method of the GPIO component to set the pin as input before switching to low power modes.

Please take a look to the following post created by our colleague Erich Styger, it explains how to enable the pin sharing option:

Tutorial: Bits and Pins with Kinetis and the FRDM-KL25Z Board | MCU on Eclipse

Hope it helps!

Best Regards,

Carlos Mendoza

Technical Support Engineer

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

517 Views
davidtietz
Contributor III

I am not aware of anyway to do this in processor expert. You can probably configure the pins however you wish in processor expert and then after the PE initializations are done you can freely reconfigure the peripheral to a GPIO. You just must be careful of processor expert code running again and messing with your configurations. If it were me, I would setup these peripherals/gpios manually outside of processor expert.

0 Kudos