[MKW01] LPTMR internal pullup

cancel
Showing results for 
Search instead for 
Did you mean: 

[MKW01] LPTMR internal pullup

Jump to solution
435 Views
giancarlozanuz
Contributor III

Hello, i'm using the LPTMR as a pulse counter, but the internal pull-up is not working in this mode.

The pin I'm using is the PTE17 - ALT6 (LPTMR0_ALT3), and the pullup works fine as a GPIO, but when I change the mux to ALT6 the pin goes floating.

Here's the code:

      PORT_HAL_SetPullMode(PORTE,17u,kPortPullUp);
      PORT_HAL_SetPullCmd(PORTE,17u,true);
      PORT_HAL_SetMuxMode(PORTE,17u,kPortMuxAlt6);           /* PTE17 - ALT6 */

With an external pullup it works fine, but I need to use the internal for my hardware.

Thanks in advance.

Labels (1)
Tags (3)
0 Kudos
1 Solution
206 Views
mjbcswitzerland
Specialist V

Giancarlo

I don't have a KW01 to test on.
If you are reading the value back as expected and you are sure that there is no error in the measurement it would sound like it is not possible with that chip.

Regards

Mark

View solution in original post

0 Kudos
4 Replies
206 Views
giancarlozanuz
Contributor III

Well, should I assume this is not possible at all? Kind of disappointed.

0 Kudos
207 Views
mjbcswitzerland
Specialist V

Giancarlo

I don't have a KW01 to test on.
If you are reading the value back as expected and you are sure that there is no error in the measurement it would sound like it is not possible with that chip.

Regards

Mark

View solution in original post

0 Kudos
206 Views
mjbcswitzerland
Specialist V

Hi

Maybe the PORT_HAL_SetMuxMode() is bad and clears the pull-up setting.
Try putting it first and see what happens.

Or just set
PORTE_PCR17 = 0x00000603; // (PORT_MUX_ALT6 | PORT_PS_UP_ENABLE)

Regards

Mark

0 Kudos
206 Views
giancarlozanuz
Contributor III

Hello Mark,

Thanks for your reply, but it didn't work either. The pin is still floating around ~1V.

I have checked the register and it is correct (0x00000603), as you can see:

PTE17.PNG

What else can it be?

Thanks.

0 Kudos