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:
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
Solved! Go to Solution.
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
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