I want to generate some signal on GPIO pin on Raspberry PI Zero W using DMA control blocks and PWM to pace data. However I faced with some problems while trying to generate signal at ~10-50kHz.
When I configure timings to generate 10us high state followed by 10us low state in loop (basically looping DMA control blocks) I see following picture on GPIO pin output:
In general it generates 10us pulses but sometimes something goes wrong and DMA changes GPIO state with wrong timings. It looks like this "interrupts" happens periodically each ~115us (about 8.5kHz).
Here is minimal reproducible code that generates signal on GPIO pin 23 and compiles fine on Raspberry PI Zero W: https://www.codepile.net/pile/v2JJ8L2q (I'm just modified example from https://iosoft.blog/2020/05/25/raspberry-pi-dma-programming/)
What I'm doing wrong?
sudo pigpiod
thenG=23; pigs m $G w; BG=$((1<<G));pigs wvag $BG 0 10 0 $BG 10; pigs wvcre; pigs wvtxr 0