[MKW01] LPTMR internal pullup

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

[MKW01] LPTMR internal pullup

ソリューションへジャンプ
1,003件の閲覧回数
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 解決策
774件の閲覧回数
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 返答(返信)
774件の閲覧回数
giancarlozanuz
Contributor III

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

0 件の賞賛
775件の閲覧回数
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 件の賞賛
774件の閲覧回数
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 件の賞賛
774件の閲覧回数
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 件の賞賛