Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5433

General • Re: Help with PIO fundamentals to drive matrix-based displays.

$
0
0
I've got things working without DMA for the moment, I have the state machine handling all the various serial shifting and pin enabling to the hardware. I'm looping put() commands to feed it with data, and want to use DMA.

But I'm stuck on setting it up. I have everything configured right, I think, but for the life of me can't get attach the dma object to the state machine.

The problem is in the following code, taken from the above example which doesn't compile.

Code:

self._sm = StateMachine(sm_id, muxed7seg, freq=2 * count_freq, out_base=Pin(pin_out), pull_thresh=11)...self.dma0.config(read=addressof(self.seg_buffer), write=self._sm, count=3, ctrl=self.ctrl0)
It throws this error:

Code:

Traceback (most recent call last):  File "<stdin>", line 83, in <module>  File "<stdin>", line 48, in __init__TypeError: can't convert StateMachine to int
What is the syntax for specifying a PIO in the write=param? Is there any documentation on this? The only example I found doesn't compile and
https://docs.micropython.org/en/latest/ ... 2.DMA.html seems to say that it should work. (write=my_state_machine)

Using MicroPython 1.22.2

Statistics: Posted by iansmith6 — Thu Apr 11, 2024 9:16 pm



Viewing all articles
Browse latest Browse all 5433

Trending Articles