Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 02:34 24 May 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Running PIO flat out?

     Page 2 of 2    
Author Message
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 597
Posted: 09:56pm 21 Feb 2025
Copy link to clipboard 
Print this post

Hi Peter,
I changed the Init Machine line in the above code to
PIO init machine 1,0,f0,p0,e0,,0,1,0,0
put the Set pin back to 5, at the begining and in the PINCTRL.
and got the following (image), only showing 2 channels of each, but all 5 SET Pins and 5 Side Set Pins are now working. :-)
I then put another bit in to give:-
PIO init machine 1,0,f0,p0,e0,,0,1,1,0
Which then meant I could remove the line
Set pindirs, &b11111   'set GPIO 0to4 to output

Unfortunately I have a bit of a mix of probes, hence the slightly differing wave shapes. :-(

So my PIO code now is:-
PIO ASSEMBLE 1
.program multi_toggle
.side set 5            '5 side set pins
.line 0                'start line 0
.wrap target
Set pins, &b00000 side &b11111      'set low, side set high
Set pins, &b11111 side &b00000      'set high, side set low
.wrap                  'wrap back to wrap_target
.end program list

'configure pio1 StateMachine 0
f0 = 210e6    '100MHz, 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 5,5,,,GP5,GP0,)
e0 = Pio(EXECCTRL GP0,Pio(.wrap target),Pio(.wrap))

'write the configuration
'PIO INIT MACHINE PIO%,stateMACHINE%,clockspeed[,pinctrl][,execctrl][,shiftctrl][,startinstruction][,sideout][,setout][,outout]
' sideout,setout,& outout can be set to 0 (default) or 1 to specify if pins defined in pinctrl should be INITialised as inputs (0) or outputs (1).
PIO init machine 1,0,f0,p0,e0,,0,1,1,0        'SM0 start at address 0

PIO START 1,0

Thanks for the extra information.
Regards, Kevin.
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1193
Posted: 03:09pm 22 Feb 2025
Copy link to clipboard 
Print this post

So cool. This is good reassurance for me    
 
     Page 2 of 2    
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025