You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been studying the Raspberry Pi Pico and writing code in MicroPython. I've been using SPI communication so far.
Recently, my mentor suggested that I'd better to learn about PIO mode (Programmed I/O). According to the specifications of a certain Backlight LED Driver, the SCK signal should be continuously pulsed without gaps, hence the switch to PIO is better.
So, I'm attempting to rewrite a code based on what I wrote before with PIO mode.
However, the PIO mode seems quite challenging to me.
Right now, there's something I can't understand. (You may check out the pictures that I uploaded.)
The codes on the rightside are showing an uploaded picture, and there is a modified code on the leftside. I want to know the meaning and role of 'pull(empty) .side(0x2) [1]' in the left code.
From my understanding, does it mean to pull data from the FIFO when it's empty (0)?
Also, regarding the 'side' part, does it set the I/O level, with the relationship being as follows:
0x2 → 10 : cs1 clk0
Is this correct?"
※Here are some documents that I would like to share with you:
Why does the timing diagram detected by the logic analyzer (SCK part) become a continuous transmission state after modifying the code? I have no clue. Can anyone help me?
"ifempty" is a condition that signifies an action will only be executed when the TX FIFO (Transmit First-In-First-Out) buffer is empty. In this context, the action is pulling data from external sources into the PIO.
In other words, this condition ensures that the PIO will fetch data from external sources only when the TX FIFO is empty, thereby preventing the overloading of data transmission that might lead to buffer overflow. This approach ensures the order and stability of data transmission.
Pull from the TX FIFO into OSR. This instruction takes the following forms: pull(), pull(block), pull(noblock), pull(ifempty), pull(ifempty, block), pull(ifempty, noblock).
If block is used then the instruction stalls if the TX FIFO is empty. The default is to block. If ifempty is used then it only pulls if the output shift count has reached its threshold.
So the ifempty relates to the OSR and the state that all previously pulled bits are shifted out, not to the state of the TX FIFO.
Your above statement hence was not correct.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
I've been studying the Raspberry Pi Pico and writing code in MicroPython. I've been using SPI communication so far.
Recently, my mentor suggested that I'd better to learn about PIO mode (Programmed I/O). According to the specifications of a certain Backlight LED Driver, the SCK signal should be continuously pulsed without gaps, hence the switch to PIO is better.
So, I'm attempting to rewrite a code based on what I wrote before with PIO mode.
However, the PIO mode seems quite challenging to me.
Right now, there's something I can't understand. (You may check out the pictures that I uploaded.)
The codes on the rightside are showing an uploaded picture, and there is a modified code on the leftside. I want to know the meaning and role of 'pull(empty) .side(0x2) [1]' in the left code.
From my understanding, does it mean to pull data from the FIFO when it's empty (0)?
Also, regarding the 'side' part, does it set the I/O level, with the relationship being as follows:
0x2 → 10 : cs1 clk0
Is this correct?"
※Here are some documents that I would like to share with you:
The screenshot of two Micropython codes:(difference)
https://fastupload.io/TmUlI1Jya22Kdz2/file
The timing diagram detected with a logic analyzer :
https://fastupload.io/KYqUjKiLQA8oj5e/file
A circuit draws that I wrote (how to connect with a logic analyzer):
https://fastupload.io/LQHz8mrAoHv3jhu/file
TECHNICAL LITERATURE for TFT-LCD module:
https://fastupload.io/NRem52RSsql601j/file
a specification of Backlight LED Driver (please check out P14→8.3.2 Continuous Clock Serial Interface)
https://fastupload.io/IDpd3ygL4TNXwhr/file
The code that changed before:
https://paste.fastmirror.net/?55032e1a8e2c7c2c#3rJX8XMLFw5p84BTHwzhL5GV61HCaNT5rVwGXmL6ukAp
The code that changed after:
https://paste.fastmirror.net/?cbe2c2cfbb99d79d#HP2vauFEJLh2amZwmPgc4bBqTBMFqYfTtkbqKhKgBLoA
Why does the timing diagram detected by the logic analyzer (SCK part) become a continuous transmission state after modifying the code? I have no clue. Can anyone help me?
All reactions