How do I create a 38kHz signal with kl43z?

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

How do I create a 38kHz signal with kl43z?

ソリューションへジャンプ
1,052件の閲覧回数
christopherira
Contributor III

Hello yall,

 

I need a 38kHz signal for the IR LED I am using. I'm using kl43z, SDK, and PE.

At the moment I'm using a for loop so it waits for 13 microseconds and toggle command to turn off and on the IR LED.

My code is the following:

138616_138616.pngpastedImage_0.png

I don't know if the for loop is creating the desired 13 micro seconds. But I did the calculation assuming a clock speed of 8MHz.

The clock might actually be 48MHz? So then I'd do 624 no-ops.

 

But alas, the circuit is not working. I got the circuit working on an arduino and downloaded a code that had the 38kHz signal.

 

Also bonus question, I haven't been able to get the GPIO_DRV_ClrPinOutput or the GPIO_DRV_SetPinOutput commands to work.

The only thing that works is the GPIO_DRV_TogglePinOutput.

 

Thanks for the help!

 

-Chris

ラベル(1)
タグ(4)
0 件の賞賛
返信
1 解決策
877件の閲覧回数
DavidS
NXP Employee
NXP Employee

Hi Christopher,

I would use the KL43 TPM module to generate a PWM of 38kHz with 50% duty cycle.

Attached is KDS_3.0+KSDK_1.3+PE that does this.

You can measure (and see) the 38kHz signal on the green LED of the FRDM-KL43Z Freedom board.

I used a fsl_tpm Processor Expert Component to set it up.

Regards,

David

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
878件の閲覧回数
DavidS
NXP Employee
NXP Employee

Hi Christopher,

I would use the KL43 TPM module to generate a PWM of 38kHz with 50% duty cycle.

Attached is KDS_3.0+KSDK_1.3+PE that does this.

You can measure (and see) the 38kHz signal on the green LED of the FRDM-KL43Z Freedom board.

I used a fsl_tpm Processor Expert Component to set it up.

Regards,

David

0 件の賞賛
返信