Open kektobiologist opened 4 years ago
Where are you seeing this limitation? The documentation, as I read it, shows a loop count of
loop x + y*256 times
is possible. Both x, y are 8-bit integers.
sorry i meant loop counters, not loop count
The code is currently dimensioned to support a chain with roughly 600 entries and 20 loop counters.
i.e. i can have only 20 loop blocks in the chain, having more throws PI_CHAIN_COUNTER
Ok, thanks for clarifying. The limitation may be due to the allocated dma control blocks in memory which may have been arbitrary when @joan2937 implemented the code. Even if it is, to change it could require a fairly involved effort.
Also, you may want to check if sending waves synchronously, each with 20 loop counters, is workable for your application. You would only need to monitor the wave status and send another wave every 200ms (if I'm understanding your requirement).
Thank you. I'm up for contributing if @joan2937 thinks this is worthwhile, or I'd like to know if there's another way around this.
I couldn't find any documentation related to sending synchronous wave chains. Do you mean using wave_send_using_mode(PIN, pigpio.WAVE_MODE_ONE_SHOT_SYNC)
to send individual waves?
Yes. But now that I think about it, you would have to send each individual wave. If they are 10ms long and your network isn't slow, you should be able to keep up using gpiowavetxat
to know when the next wave is playing.
Right now there is a hard limit of 20 loop counters (as per documentation) in a wave chain I am trying to create a ramp pulse input with ~100 square waves of 10 ms duration each of increasing frequencies (5000us pulse width to 10us pulse width), however the library only allows 20 loop counters (so 20 waves) at most. Is this a hardware limitation or can it be changed? In the code I can see the limit is defined as
where
WCB_CNT_PER_PAGE
is 2 andPI_WAVE_COUNT_PAGES
is 10 Any help would be appreciated. EDIT: changed wording to make it clearer