PIO conditional jump based on fifo value #15458
-
Hi, I'm working on a parallel interface implementation using PIO and I'm looking for advice on a particular issue. The RP2040 is talking to another device using an 8 bit parallel port with a DIRection and a STroBe signal. The RP2040 is controlling the interface (i.e. it can inititate reads and writes to registers on the other device), but the other device is providing the CLocK. Reading and writing are initiated in the same way: The Python program sends a 32 bit word to the PIO FIFO, with the lower 16 bits containing the bit states for the outputs and the upper 16 bits containing the direction (see code below). Now, for a read operation, the state machine waits for the falling clock edge before sampling the data bits and sending them to the RX fifo. For writing, the read part is not needed and I'd like to skip it. Is there a good way to achieve this by looking at the DIR bit of the command word read from the FIFO? It does not appear to be directly possible, but maybe someone has a clever idea how I can skip the Thanks a lot!
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You might use the |
Beta Was this translation helpful? Give feedback.
... and sometimes, it helps to just spell out the problem to find a solution. I think I can use this MSB of the command word as a read/write indicator, as I only have to control 14 GPIO pins:
and