PicoMite V6.00.02 betas


Author Message
JanVolk
Senior Member

Joined: 28/01/2023
Location: Netherlands
Posts: 196
Posted: 05:29pm 06 Feb 2025      

Did some tests and played with PIO assembler.
Works much faster and has a better overview and you can start it immediately after editing. Test on an RP2350A.
It works fine on PicoMite 2. It doesn't work on the WebMite.

Greetings,

Jan

PIO ASSEMBLE V6.00.02b8
With the latest PicoMite version you can enter PIO ASSEMBLE as standard.  RP2350A Edition  

That's how it used to be.
PIO assemble 1,".program NES"       'A program needs a name.
PIO assemble 1,".side_set 2"        'Use 2 bits for side set, 3 for delay
PIO assemble 1,".line 0"            'Start code on line 0.
PIO assemble 1,"SET pindirs,&b11"   'Set GP0,GP1 output, side GP0,GP1 Low.
PIO assemble 1,".wrap target"       'Wrap target = Top of the Loop
PIO assemble 1,"IN null,32 side 2"  'Set ISR to 0, GP1 high (load),GP0 Low
PIO assemble 1,"SET X,7 side 0"     'Set X counter at 7, GP0,GP1 low.
PIO assemble 1,"loop:"              'Inner loop label.
PIO assemble 1,"IN pins, 1 side 0"  'Slide 1 data bit in,keep GP0,GP1 low  
PIO assemble 1,"JMP X-- loop side 1"'JMP to loop, dec. X, GP0 high(clock)
PIO assemble 1,"PUSH side 0 [7]"    'Now X=0, PUSH result in FIFO, delay7
PIO assemble 1,".wrap"              'End outside Loop, repeat.
PIO assemble 1,".end program list"  'End program, list result.

Copy the above from the manual into MMEdit and send it to the PicoMite.
Make any necessary adjustments in EDIT. Place PIO assemble 1 on the first line and delete it on the remaining lines as well as any " on each line. Change the line .side_set 2 to .side set 2 and line loop: to .label nes: and the line JMP X-- loop side 1 to JMP X-- nes side 1
The assembler program can now be saved with F1 or F2.

The program reads a NES controller (SPI) connected to the Raspberry Pi Pico.
The NES controller consists of a HEF4021 slide register connected to 8 push button switches.

> edit
PIO assembly 1
.program NES             'A program needs a name.
.side set 2              'Uses 2 bits for side set, 3 for delay
.line 0                  'Start code on line 0.
SET pindirs,&b11         'Set GP0,GP1 output, side GP0,GP1 low
.wrap target             'Wrap target = Top of the nes barrel
IN null,32 side 2        'Set ISR to 0, GP1 high (load), GP0 low
SET X,7 side 0           'Set X counter to 7, GP0,GP1 low
.label nes:              'Inner nes label.
IN pins, 1 side 0        'Slide 1 data bit in, keep GP0,GP1 low
JMP X-- nes side 1       'JMP to nes, dec. X, GP0 high(clock)
PUSH side 0 [7]          'Now X=0, PUSH result in FIFO, delay 7
.wrap                    'End outside nes, repeat.
.end program list        'End program, List=program, Run=start program

> run
0: E083
1: 5060
2: E027
3: 4001
4: 0843
5: 8700