[MKW01] LPTMR internal pullup

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

[MKW01] LPTMR internal pullup

跳至解决方案
1,006 次查看
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.

标签 (1)
标记 (3)
0 项奖励
1 解答
777 次查看
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

在原帖中查看解决方案

0 项奖励
4 回复数
777 次查看
giancarlozanuz
Contributor III

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

0 项奖励
778 次查看
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

0 项奖励
777 次查看
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 项奖励
777 次查看
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 项奖励