Quantcast
Viewing all articles
Browse latest Browse all 5369

General • Re: Very strange problems encountered using the RP2040's PIO to drive a parallel port display

You can't do 'SET Y,118'. The maximum value for SET is 31.

The common way to deal with needing large constants is to load them into one of the other registers - ISR, OSR, X, whichever you aren't using, and then MOV Y,<whichever> in place of SET Y,<value>.

You can load the value into the register with forced-execute instructions before starting the SM, so that the load doesn't use up any of your precious program instructions.

In your case, since it's a purely output application, ISR seems like a good choice for a spare register.
Thank you very much, problem solved.

It was indeed caused by the SET instruction.

I forgot that I should load the porch cycle to ISR rather than Y.

Code:

sm_bus.put(118) # back porch cyclessm_bus.exec("pull()")sm_bus.exec("mov(isr, osr)") ######################### should be loaded to ISR first, and using pioasm to load ISR to Ysm_bus.put(899) # data valid cyclessm_bus.exec("pull()")sm_bus.exec("mov(x, osr)")
Here I am using ISR and X for storing delay cycles. But this is just an experiment, I still need to store the VSYNC back porch cycle, does this mean I have exhausted the available registers.

Statistics: Posted by b0wen — Mon Apr 08, 2024 7:34 am



Viewing all articles
Browse latest Browse all 5369

Trending Articles