This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

softdevice affecting the IR pulse timing

Hello devzone... My setup: nRF51422 and S110 peripheral My setup transmits IR data on reception of Bluetooth data from a central device. I have used PWM for generating IR pulses. It is configured as GPIOTE, the timer compare event toggles the pin. This works fine without the softdevice enabled. If the softdevice is enabled, it blocks the CPU for sometime to serve the radio events which mess up the IR mark and space timings. I have to start and stop the timer tasks and events at proper intervals. Since softdevice blocks the CPU there is delay which increases the IR data timings. The IR is an integral part of my application, so i would like to avoid ble events till the application sends IR data. Any suggestions and design improvements where in i can have a sync between IR and ble? Can i disable the events from sd for the time IR data is being sent?

Thanks..:-)

Parents
  • Maybe you could send the data via SPI back to an GPIO that controls the PWM using PPI. If you use the SPIS then you can use the DMA but then you need to generate the clock that is feed in to the SPIS.

  • Set up PWM for 50% duty 38.5kHz or what ever you use, connect a gpio to two gpiote, falling edge to timer->event_stop and rising edge to timer->event_start or something similar. Now a gpio gates the carrier. Now set up the spis to use DMA and load the dma buffer with the data you want to send. Connect spis.miso to the pwm "gate" gpio. You now need to create a timebase using the second timer channel,make a pwm with a period that is the least common divider of the carrier on and carrier off time for your ir protocol and connect this pwm pin to the spis.sck pin. This is a ugly solution but it should be able to transmitt IR packages without CPU.

Reply
  • Set up PWM for 50% duty 38.5kHz or what ever you use, connect a gpio to two gpiote, falling edge to timer->event_stop and rising edge to timer->event_start or something similar. Now a gpio gates the carrier. Now set up the spis to use DMA and load the dma buffer with the data you want to send. Connect spis.miso to the pwm "gate" gpio. You now need to create a timebase using the second timer channel,make a pwm with a period that is the least common divider of the carrier on and carrier off time for your ir protocol and connect this pwm pin to the spis.sck pin. This is a ugly solution but it should be able to transmitt IR packages without CPU.

Children
No Data
Related