Quantcast
Viewing all articles
Browse latest Browse all 4840

General • Re: Shared pins between PIO state machines. Multiple serial streams

To anyone who gets similar problems:

I have moved CLK_OUT to different state machine (could be generated with PWM or GPIO as well) due to synchronisation issues if it is controlled from these(capture) state machines. This is working with good performance - could possibly capture at 1MHz or more.

Code:

.program data_sampling.define CLK_IN 3            ;To set pin 3 for use in WAIT instruction (uses WAIT 1 GPIO not WAIT 1 PINS).define CLK_OUT 2.define PUBLIC BIT_COUNT 22.wrap_target    set X, (BIT_COUNT-1)    wait 1 PIN 2            ;Wait FRAME signal to go HIGH to signalize start of data frame    sample_data:    wait 1 gpio CLK_OUT     ;Should sample on CLK_IN        in pins, 1 ;[5]    wait 0 gpio CLK_OUT     ;Should sample on CLK_IN    jmp X-- sample_data.wrap

Statistics: Posted by PorinsR — Tue Feb 06, 2024 10:03 am



Viewing all articles
Browse latest Browse all 4840

Trending Articles