implementing JTAG protocol using PIO state machine #9371
-
Hello, I am trying to implement JTAG protocol using a PIO state machine. I need to generate two signals- TDI and TCK and have assigned the pins for them in my state machine. During one of the states, I need to serially send out data on TDI pin, along with the clock on a TCK pin. I am able to create a clock by using the set() command for toggling the TCK pin. However, I am unable to figure out how to serially shift out a bit on every TCK cycle on the TDI pin. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You should shift out the data with out(pin, 1) and control the CLK pin with sideset on the set command. The 1 in the out command outputs just une bit and shift the reguister, such that you can loop through the word. See e.g. https://github.com/robert-hh/SSD1963-TFT-Library-for-PyBoard-and-RP2040/blob/master/rp2040/tft_pio.py, function pio_data_write, where three bus control lines are set with the data. |
Beta Was this translation helpful? Give feedback.
-
The nop() is an instruction. If you decode the binary of nop(), you'll see that it is in fact a mov of a register to itself. |
Beta Was this translation helpful? Give feedback.
You should shift out the data with out(pin, 1) and control the CLK pin with sideset on the set command. The 1 in the out command outputs just une bit and shift the reguister, such that you can loop through the word. See e.g. https://github.com/robert-hh/SSD1963-TFT-Library-for-PyBoard-and-RP2040/blob/master/rp2040/tft_pio.py, function pio_data_write, where three bus control lines are set with the data.