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

SDK • connecting two state machines through FIFOs

$
0
0
Looking into the RP2040 datasheet, each statemachine has its own FIFO and all fifos are connected to the AHB-lite bus.
Its possible by code ( through pio_sm_get) or by dma to pull/push data from/to the fifo.

My question is if it's possible for one SM to push or consume data from the other SM FIFO.

My problem right now is that a capture process in a SM runs until fifo is full, then by DMA I purge the data I don't need (either FIFO or next data), this gives me a 1 capture time precision from the moment the capture needs to be started and on that event, if I could "drop" just one entry on the fifo, the timing will be accurate to fractions of the capture time.

For that I wanted to use another SM, to hook to a edge like trigger, and purge at that time one element on thge capture fifo,
I do this on the edge triggered IRQ and is visibly an improvement, but IRQ are slow and less deterministic compared to the PIO

Is this feasible?
AFAIK with a DMA (between one consuming and the other producing, where the consumer holds the DMA transfer

Statistics: Posted by mlorenzati — Mon Feb 26, 2024 2:10 am



Viewing all articles
Browse latest Browse all 5924

Latest Images

Trending Articles



Latest Images