![]() |
Forum Index : Microcontroller and PC projects : PicoMite V6.01.00 betas
![]() ![]() |
|||||
Author | Message | ||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5156 |
Peter, When using the PIO PROGRAM LINE command, you cannot start a program at line 0. This used to work in 6.00.01, and stopped working in 6.00.02. Relevant Post Any reason why ? If this is purposely, then we need to adapt the user manual change the examples. EDIT: using 6.00.03 When using PIO1, you can not start on line 0. Line 1 works though. This is also the case with the other way of programming, programming through an array. Examples: This does NOT work 'CpuSpeed 126000 SETPIN GP0,PIO1 'program pio1 pio program line 1,0,&hE081 pio program line 1,1,&hE101 pio program line 1,2,&hE000 pio program line 1,3,&h0001 'program pio 1 using an array to write the program in PIO memory, and start 'Dim a%(7)=(&h0001E000E001E081,0,0,0,0,0,0,0) 'PIO program 1,a%() 'configure pio1 p=Pio(pinctrl 0,1,,,,gp0,) f=2000 'Hz PIO init machine 1,0,f,p,,,0 PIO start 1,0 But then...this works... 'CpuSpeed 126000 SETPIN GP0,PIO1 'program pio1 pio program line 1,1,&hE081 'start at line 1 pio program line 1,2,&hE101 pio program line 1,3,&hE000 pio program line 1,4,&h0002 'program pio 1 using an array to write the program in PIO memory, and start 'Dim a%(7)=(&h0001E000E001E081,0,0,0,0,0,0,0) 'PIO program 1,a%() 'configure pio1 p=Pio(pinctrl 0,1,,,,gp0,) f=2000 'Hz PIO init machine 1,0,f,p,,,1 'start at line 1 PIO start 1,0 It is not related to GP0, on GP4 the behavior is the same. EDIT:EDIT: the behaviour on PIO0 is the same (now) as PIO1, I must have been confused earlier that it worked correct on PIO0. Volhout Edited 2025-08-18 22:11 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10364 |
What about using the inbuilt assembler? |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5156 |
Same when using the onboard assembler. Line 0 as starting point does not work, line 1 does work. pio clear 1 SETPIN GP0,PIO1 'program pio1 pio assemble 1,".program test" pio assemble 1,".line 1" 'does not work with line 0 pio assemble 1,"set pindirs,1" pio assemble 1,"label:" pio assemble 1,"set pins,1 [1]" pio assemble 1,"set pins,0" pio assemble 1,"jmp label" pio assemble 1,".end program list" 'pio program line 1,0,&hE081 'pio program line 1,1,&hE101 'pio program line 1,2,&hE000 'pio program line 1,3,&h0001 'program pio 1 using an array to write the program in PIO memory, and start 'Dim a%(7)=(&h0001E000E001E081,0,0,0,0,0,0,0) 'PIO program 1,a%() 'configure pio1 p=Pio(pinctrl 0,1,,,,gp0,) f=4000 'Hz PIO init machine 1,0,f,p,,,1 'does not work with line 0 PIO start 1,0 Volhout P.S. you have to check this with a scope, or buzzer, not with a LED. A previous run could leave the PIO output register for GP0 is state "1", and the new run could light a LED attached. As if it works, but the program should output a tone. Not a static high level. Edited 2025-08-18 23:10 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5156 |
pio clear 1 SETPIN GP0,PIO1 'program pio1 pio assemble 1,".program test" .line 1 set pindirs,1 .label lbl set pins,1 [1] set pins,0 jmp lbl .end program list 'pio program line 1,0,&hE081 'pio program line 1,1,&hE101 'pio program line 1,2,&hE000 'pio program line 1,3,&h0001 'program pio 1 using an array to write the program in PIO memory, and start 'Dim a%(7)=(&h0001E000E001E081,0,0,0,0,0,0,0) 'PIO program 1,a%() 'configure pio1 p=Pio(pinctrl 0,1,,,,gp0,) f=4000 'Hz PIO init machine 1,0,f,p,,,1 'does not work with line 0 PIO start 1,0 Same for this version of the assembler. Volhout PicomiteVGA PETSCII ROBOTS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10364 |
I've tracked it down to a change in the sdk added to support the RP2350B. There is another control variable (PINHI) which the sdk creates when you call the routines to load the config. PIO init machine does not do anything with this but just substitutes the user supplied values of PINCTRL etc. PINHI is a sdk internal value that I don't know how to create but magically changes when you call the sdk routines to load the config/ The program works if you substitute PIO Configure 1, 0, 4000, 0,,,,gp0,1 for PIO init machine 1,0,f,p,,,0 because the newer configure mechanism does everything properly I've been testing on a RP2350 Please confirm on an RP2040 init machine give PINHI of 0xFFFFFFFF, configure gives 0xFFF07C1F Why this works with a start line of other than 0 - who knows |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5156 |
Ok, you are confused, so am I. What do you suggest as the way forward. Talk to RP about the SDK? Depricate PIO INIT MACHINE? Then we need to adapt the manuals, since they currently confuse. Volhout Edited 2025-08-19 01:23 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10364 |
I've done more research and it appears the later sdk have changed the defaults for execctrl and shiftctrl. The PINHI thing may be a red herring and only relate to pins above gp29 for the rp2350. I'll try and generate a version that restores the defaults that were in the earlier versions - watch this space. |
||||
stanleyella![]() Guru ![]() Joined: 25/06/2022 Location: United KingdomPosts: 2602 |
I added usc to ttl so I could usb pico version and added the sound filter, all works, audio from sd card. PicoMite MMBasic USB RP2350A Edition V6.01.00b8 OPTION SERIAL CONSOLE COM2,GP8,GP9 OPTION SYSTEM SPI GP18,GP19,GP16 OPTION AUTORUN ON OPTION FLASH SIZE 4194304 OPTION COLOURCODE ON OPTION KEYBOARD UK OPTION CPUSPEED (KHz) 378000 OPTION LCDPANEL ILI9341, LANDSCAPE,GP15,GP14,GP13 OPTION TOUCH GP12,GP11 GUI CALIBRATE 0, 3900, 3816, -887, -658 OPTION SDCARD GP22 OPTION AUDIO GP0,GP1', ON PWM CHANNEL 0 using pins in use For m=0 To 28 :n= MM.Info(pinno "GP"+Str$(m)):print n,"GP"+Str$(m), MM.Info(pin n) :next Sub MM.Startup Local Integer m, n For m=0 To 28 n = MM.Info(pinno "GP"+Str$(m)) If MM.Info(pin n)="OFF" Then SetPin n, DIN, PULLUP Print n,"GP"+Str$(m), MM.Info(pin n) Next End Sub I get 1 GP0 Boot Reserved : SSD RESET 2 GP1 Boot Reserved : AUDIO R 4 GP2 OFF 5 GP3 OFF 6 GP4 OFF 7 GP5 OFF 9 GP6 OFF 10 GP7 OFF 11 GP8 Boot Reserved : CONSOLE TX 12 GP9 Boot Reserved : CONSOLE RX 14 GP10 OFF 15 GP11 Boot Reserved : TOUCH IRQ 16 GP12 Boot Reserved : TOUCH CS 17 GP13 Boot Reserved : LCD CS 19 GP14 Boot Reserved : LCD Reset 20 GP15 Boot Reserved : LCD DC 21 GP16 Boot Reserved : SPI SYSTEM MISO 22 GP17 OFF 24 GP18 Boot Reserved : SPI SYSTEM CLK 25 GP19 Boot Reserved : SPI SYSTEM MOSI 26 GP20 OFF 27 GP21 OFF 29 GP22 Boot Reserved : SD CS 41 GP23 DOUT 42 GP24 DIN 43 GP25 HEARTBEAT 31 GP26 OFF 32 GP27 OFF 34 GP28 OFF why GP0 Boot Reserved : SSD RESET not audio L ? |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5156 |
Hi Peter, I understood that I2S audio uses PIO0. Correct ? All other audio systems do not use PIO. Is below overview correct ? ![]() Volhout PicomiteVGA PETSCII ROBOTS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10364 |
Only I2S uses PIO. RP2350 uses PIO2, RP2040 uses PIO0 |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10364 |
V6.01.00b9 Compensates for the sdk change in the way PIO structures are initialised PicoMiteV6.01.00b9.zip |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 8004 |
PIO2 isn't present on the RP2040 is it? Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5156 |
@Peter, I2S audio: on RP2350A also uses PIO2 ? Or only on RP2350B. On 2350, is VGA also in PIO2 then ? About 6.01.00b9 - Runs OK on 2350B-VGA+PSRAM, tested several programs including logic analyzer, kept OPTIONS - Runs OK on 2350A equipped Game*Mite (deleted OPTIONS at install) - Runs OK on RP2040-GEEK (deleted OPIONS) - Runs OK on 2040 PicoMite (kept OPTIONS) Checked several PIO programs on 2040, and all work okay. I will do some more testing tonight. Maybe this should replace the 60003 at Geoff's site. I will update the overview on PIO usage. Volhout Edited 2025-08-19 22:12 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10364 |
No - RP2350 only All RP2350 Edited 2025-08-19 22:10 by matherp |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5156 |
Peter, On 2040VGA PIO0 has both I2S and VGA combined. On 2350VGA PIO2 combines I2S and VGA ? (or do they use separate PIO's) ?. Volhout PicomiteVGA PETSCII ROBOTS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10364 |
Separate, for some reason I couldn't get shared to work and in any case it makes it simpler to always use PIO2 |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5156 |
OK, then this should be correct. ![]() PicomiteVGA PETSCII ROBOTS |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5156 |
@Peter, Tested all in my possession on 2040VGA, and all work on b9. Volhout PicomiteVGA PETSCII ROBOTS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10364 |
![]() |
||||
![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |