Running PIO flat out?


Author Message
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2375
Posted: 08:55pm 30 Jan 2025      

It may help, especially if the 74HC14 is close to the Pico.
The output resistance of the Pico pins is 40 - 50Ω so driving the scope input capacitance may contribute to the rounding.

Edit.
An odd thing.
Tried the program above but using FIN to show the output (Pico2 VGA beta 5) and the Pico freezes when PIO output is connected to FIN. Unplug the link and it resumes running.

Tried various CPU speeds, PIO speeds and FIN sampling times but always same result.
> option list
PicoMiteVGA MMBasic RP2350A Edition V6.00.02b5
OPTION SYSTEM I2C GP14,GP15
OPTION FLASH SIZE 4194304
OPTION COLOURCODE ON
OPTION KEYBOARD US
OPTION DEFAULT MODE 3
OPTION DISPLAY 60, 133
OPTION SDCARD GP13, GP10, GP11, GP12
> RUN
0: E081
1: E000
2: E001
0
0   <---------Heartbeat and program stop when GP0 linked to GP7, resume when removed
0
0
0
>
> LIST
SetPin gp7,FIN,10
SetPin gp0,PIO1

PIO ASSEMBLE 1,".program toggle"
PIO assemble 1,".line 0"         'start line 0
PIO ASSEMBLE 1,"set pindirs,1"   'set GPIO to output
PIO ASSEMBLE 1,".wrap target"
PIO ASSEMBLE 1,"set pins,0"      'set low
PIO ASSEMBLE 1,"set pins,1"      'set high
PIO ASSEMBLE 1,".wrap"           'wrap back to wrap_target
PIO ASSEMBLE 1,".end program list"

'configure pio1 StateMachine 0
f0 = 63e6    '1MHz, change this to meet your need
'              a b c d e f g   'a,e=side set   c,g=OUT  b,f=set
p0 = Pio(PINCTRL 0,1,,,,GP0,)
e0 = Pio(EXECCTRL GP0,Pio(.wrap target),Pio(.wrap))

'write the configuration
PIO init machine 1,0,f0,p0,e0,,0        'SM0 start at address 0
PIO START 1,0

Do
 Pause 2000
 Print Pin(GP7)
Loop
>

Edit 2
FIN works ok when linked to a PWM pin.
Edited 2025-01-31 08:05 by phil99