The Python package pigpio has a wave_chain() method that allows one to chain together a series of waveforms in an easy-to define looping structure. But the GPIO chip itself has quite a limited number of 32-byte registers.

Is the CPU executing this loop, swapping out one waveform after another? Is it for example alternating between a pair of GPIO registers (e.g. the two PWM DATA registers); writing to one while the other is being clocked through by the GPIO internals? Or is the loop somehow executed within the GPIO itself?

Will RPi CPU overhead lead to occasional, unpredictable pauses and delays?

1 Answer 1


The Raspberry Pi has 16 hardware DMA (Direct Memory Access) channels.

Using DMA you can copy the contents of memory from one memory address to another memory address without software involvement. The hardware allows you to chain many transfers together such that the next is automatically started when the previous has finished. You can also pace (i.e. time) the transfers using either the PWM or PCM hardware.

pigpio uses these features to create waves, whereby blocks of memory are periodically copied to the GPIO output registers which sets the levels of GPIO 0-31.

This means you can switch any combination of GPIO 0-31 on and off at controlled intervals.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.