What is best way to put FlexBus addr lines in high-impedance state when sleeping?

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

What is best way to put FlexBus addr lines in high-impedance state when sleeping?

548 Views
jvasil
Contributor III

We are using the flexbus of a MK24 to drive a display.  When we go to sleep, we have to cut off the power to the display module.  Therefore, we need to make sure all the pins that are configured as outputs to this device are disabled (or put into a high-impedance state) before we turn off the power.  Is there an easy way to do this using PEx?  We are using the Init_FB component in PEx 10.4 to configure these lines but it doesn't support any methods other than the Init call.

One idea I had was to simply change the PORT_PCR_MUX of these lines to 0 but I am unsure if that disables the pins when the ALT0 cell in the "Signal Multiplexing and Pin Assignments" table in the K24 Reference Manual is blank.  Although this table says that the "default" setting of these pins is "disabled", it does not say that you can disable the pin by setting the PCR MUX to 0.

A second approach I have considered is to reconfigure these pins as GPIO inputs.  One way to do this from PEx would be to have two sets of "Init_GPIO" components--one that configures the pins for sleep state and one that configures for the running state.  Would there be any problems with having multiple Init_GPIO components defined for the same GPIO Port?

The final approach I have considered is ignoring PEx and just writing functions to configure these lines as needed.  I can certainly do this but dislike the "mixed" approach (i.e. some configuration done by PEx and some by user-written code).

Any ideas, examples, suggestions, etc. will be appreciated!!

Thanks,

James

0 Kudos
2 Replies

395 Views
mjbcswitzerland
Specialist V

James

I don't know whether PE supports this but if you don't mind writing general code to access the processor's peripheral it is very efficient using the following:

GPIOA_PDDR = 0;                  // optional since the DDR is usually already 0

PORTA_GPCLR = ((0xffff0000) | PULL_UP_STATE | PORT_MUX_GPIO);

PORTA_GPCHR = ((0xffff0000) | PULL_UP_STATE | PORT_MUX_GPIO);

Where PULL_UP_STATE can be set to either be floating, pull-up or pull-down (check the registers for the defines to use).

This also assumes all 32 pins of a port are to be set to inputs (by controlling the masks 0xffff0000 with just the required pin bits you can set any pattern required).

If more that one port is involved the same can be done for each one (A, B, C, etc.)

This is the fastest and most efficient method since each port write acts on up to16 pins at the same time.

Users of the uTasker project do this using the macro

_CONFIG_PORT_INPUT_FAST_LOW(ref, pins, chars)

eg.

_CONFIG_PORT_INPUT_FAST_LOW(B, (PORTB_BIT6 | PORTB_BIT7 | PORTB_BIT15), PORT_PS_UP_ENABLE);

Regards

Mark

Kinetis: µTasker Kinetis support

K24F: µTasker Kinetis TWR-K24F120M support

For the complete "out-of-the-box" Kinetis experience and faster time to market

0 Kudos

395 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, James,

As Mark pointed out, I think it is the best way to configure the FlexBUS pin as GPIO and input mode(setting MUX bits 001  in PORTx_PCRx register, clearing the bit in GPIOx_DDR register), enable the pull-down function(by setting the PE bit and clearing the PS bit).

If you set the pin in GPIO and OUTPUT mode and in Open Drain mode, because there is not external  pull-up resistor, the pin will be keep in less than 200mV, I think it is a method. If you set the pin in GPIO mode/Output mode and output Low logic, the pin will keep low in sleep mode, but it will consume energy.

BR

XiangJun Rong

0 Kudos