Hi all,
I need to transmit an infrared beacon every X seconds and the beacon does not change over time. I am using the PWM driver on nrf52 to generate the 38kHz carrier frequency and I am currently working on using a timer and PPI to turn on and off the carrier appropriately (mark and space).
However, I was wondering if it is possible to do the same thing only using the PWM driver. This would make the implementation simpler with less resources used.
I have the impression that, given the fact that my data is static, I can create a sequence of duty cycles that represents my data and then play it with the PWM driver. The actual duty cycles used would be only two, 50% for the marks and 0% for the spaces. The important thing (that I didn't figure out if it is possible or not yet) is to get the right timing for the marks and spaces. Maybe it is possible to use the playback_count
in nrf_drv_pwm_simple_playback
to define how long we should keep the 50% and 0% duty cycle, or maybe it is possible to use repeats
and end_delay
in nrf_pwm_sequence_t
. I still don't have clear how these three parameters work together.
Any ideas/thoughts?
Thanks!