Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 12:26 05 Dec 2024 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 : Draft PicoMite 6.00.01 User Manual

     Page 2 of 5    
Author Message
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3210
Posted: 10:22am 29 Nov 2024
Copy link to clipboard 
Print this post

  Volhout said  Do you want me to include an example how to use these ? I think I can include the PIO program that I made to test the assembler for these new PIO instructions.

There is already a demo program in there although I don't know how worthwhile it is.  If you have something better that is a few pages or less, that would be good.

Geoff
Geoff Graham - http://geoffg.net
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4276
Posted: 10:37am 29 Nov 2024
Copy link to clipboard 
Print this post

Hi Geoff,

The demo programs are there to support MMBasic commands (how to use them).
IN this version I updated the existing MMBasic (helper) functions, and added a demo to explain the use of the new MMBasic commands for RP2350 PIO. In this particular case the demo is usefull because it shows how to alter the PIO config to use the FIFO when changing data direction in the FIFO registers.

Alter or compress as required.

The PIO Programming Package update.zip

I noticed the the new command
PIO WRITEFIFO a,b,c,d

And function
PIO(READFIFO a,b,c)

are not in the command/function lists. Please add "RP2350 only". The WORD document shows the a,b,c,d

Volhout

P.S. Geoff, check with Peter. I currently do not have a pico2 at hand, so cannot verify this RP2350 program which was written to test 6.00.00 beta 2. IN the weekend I can check it myself.

'only for RP2350 assembler. this does not work on RP2040

pio clear 1

pio assemble 1,".program test"
pio assemble 1,".line 0"
pio assemble 1,"set y,4"            'just a value 4 in Y
pio assemble 1,"mov isr,y"          'copy Y to isr
pio assemble 1,"jmp y--,next"       'y=y-1 always to next
pio assemble 1,"next:" ‘label
pio assemble 1,"mov rxfifo[y],isr"  'should program 4 in fifo [3]
pio assemble 1,"mov isr,y"          'copy Y to isr
pio assemble 1,"mov rxfifo[2],isr"  'should program 3 in fifo [2]
pio assemble 1,"jmp 0"              'repeat
pio assemble 1,".end program"
'pio assemble 1,".end program list"

f=1e6 '1MHz

'PIO(EXECCTRL a,b,c)
e=pio(execctrl gp0,0,31)   'default value, not actually changed

'PIO(SHIFTCTRL a,b,c,d,e,f,g,h,i,j)
sr=pio(shiftctrl 0,0,0,0,0,0,0,0,0,1) 'read individual RX, RX=4 deep
sw=pio(shiftctrl 0,0,0,0,0,0,0,0,1,0) 'write individual RX, RX=4 deep

'PIO(PINCTRL a,b,c,d,e,f,g)
p=pio(pinctrl 0,0,0,gp0,gp0,gp0,gp0) 'defaultvalue , not actually changed


'test the use of FIFO as individual registers

'fill the fifo with pre-determined values
pio init machine 1,0,f,p,e,sw,0   'init machine for writing to RX fifo
for i=0 to &h3                    'write the 4 RXFIFO registers
pio writefifo 1,0,i,&h100*(i+1)  'write values &h100, &h200, &h300, &h400
next

'check the values are written correctly
print "3 RXFIFO registers before running the program"
pio init machine 1,0,f,p,e,sr,0   'init machine for reading the RX fifo
for i=0 to 3      'read the 4 RXFIFO registers
  print i,hex$(pio(readfifo 1,0,i))  'verify they are correctly written
next
print

'run the PIO program. That should (continuously) write to reg 2 and 3 in the FIFO, but not alter register 0 and 1
pio start 1,0

'show the updated FIFO registers
print "3 RXFIFO registers after running the program"
for i=0 to 3   'read the 4 FIFO registers to see if the program works
  print i,hex$(pio(readfifo 1,0,i))
next

Edited 2024-11-29 21:07 by Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9187
Posted: 12:08pm 29 Nov 2024
Copy link to clipboard 
Print this post

Is this what you expected?
Saved 2021 bytes
3 RXFIFO registers before running the program
0      100
1      200
2      300
3      400

3 RXFIFO registers after running the program
0      100
1      200
2      3
3      4
>
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4276
Posted: 12:15pm 29 Nov 2024
Copy link to clipboard 
Print this post

Yes, exactly !!

Thanks for confirming the code (for the user manual) works as in earlier versions.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3210
Posted: 01:18pm 29 Nov 2024
Copy link to clipboard 
Print this post

Thanks Volhout (and Peter).  That is great.

Geoff
Geoff Graham - http://geoffg.net
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1264
Posted: 02:09pm 29 Nov 2024
Copy link to clipboard 
Print this post

@Harm
pio assemble 1,"next:" ‘label

There is an incorrect "single quotation mark" before the word "label".
Should be:
pio assemble 1,"next:" 'label

Regards
Michael

Thanks for that example!
causality ≠ correlation ≠ coincidence
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2152
Posted: 03:45pm 29 Nov 2024
Copy link to clipboard 
Print this post

  Geoffg said  Thanks for the edits guys.

Most will make it into the final doco, although please don't be upset if some miss out.
Special thanks to Peter, Volhout and disco4now.  That is a lot of reading that you have done.

If there is anyone with expert PIO knowledge, I could do with some help.  I know nothing of the PIO and I don't have time to come up to speed.  But I feel that there is a lot missing.  Attached is a Word doco with the chapter on PIO programming and a hunk of text that I found that implies that there is more that has not made it into the manual.  If there is anyone who can make sense of it and possibly edit the PIO chapter accordingly I would be grateful: PIO Stuff.zip

Keep the changes coming,
Geoff

who wrote the vga pio for core 2? and where did hdmi come from?
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6839
Posted: 04:07pm 29 Nov 2024
Copy link to clipboard 
Print this post

From the manual:
The VGA driver code was derived from work by Miroslav Nemecek

Dunno about DVI (it doesn't pass the spec for HDMI. HDMI includes support for DVI.).
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9187
Posted: 06:34pm 29 Nov 2024
Copy link to clipboard 
Print this post

Geoff: page 40: Max program size for the WebMite RP2350 is 208Kb
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1264
Posted: 06:52pm 29 Nov 2024
Copy link to clipboard 
Print this post

  matherp said  Geoff: page 40: Max program size for the WebMite RP2350 is 208Kb

I'm not Geoff, but: page 80?
causality ≠ correlation ≠ coincidence
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3210
Posted: 11:24pm 29 Nov 2024
Copy link to clipboard 
Print this post

Peter writes code almost at the speed of light and therefore experiences length contraction.  Thus, 80 pages to us looks like 40 to him.  

Geoff
Edited 2024-11-30 10:55 by Geoffg
Geoff Graham - http://geoffg.net
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2155
Posted: 01:01am 30 Nov 2024
Copy link to clipboard 
Print this post

A trivial nit-pick.
p83 MMINFO(SYSTEM I2C) missing "."
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1619
Posted: 03:22am 30 Nov 2024
Copy link to clipboard 
Print this post

Page 16 under the heading:
HDMI/USB Reference Design (Raspberry Pi Pico 2)
The link given for the "The construction pack for this design" is actually for the VGA version. I cannot find the construction pack for the HDMI/USB Reference Design.

Bill
Keep safe. Live long and prosper.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1619
Posted: 03:45am 30 Nov 2024
Copy link to clipboard 
Print this post

Page 18 under the heading:
Configuring the Keyboard
"If you need to remove the keyboard you can do this with the OPTION KEYBOARD DISABLE command."

I cannot find that command in the OPTIONS list. There is an OPTION KEYBOARD NO_KEYBOARD command though. How do you reenable the keyboard?

Bill
Keep safe. Live long and prosper.
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 905
Posted: 04:03am 30 Nov 2024
Copy link to clipboard 
Print this post

I just loaded my HDMIUSB Picomite. Some suggestions for the manual if not already in progress.

Getting Started
 Loading The Picomite Firmware
    add in there somewhere  words like "select the firmware to match your device/board i.e platform"

 Configure the Device/Board
    MMBasic will start and run but the peripherals (SDCARD,Audio etc) on the platform will require configuration. They can be configured manually for an unknown platform, however the MMBasic firmware knows about the commonly available platforms and the command  CONFIGURE LIST (or OPTION RESET LIST) will list those boards that match the loaded firmware. Command CONFIGURE cfg (or OPTION RESET cfg) will configure the peripherals.
Edited 2024-11-30 14:06 by disco4now
Latest F4 Latest H7
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3210
Posted: 04:54am 30 Nov 2024
Copy link to clipboard 
Print this post

  Turbo46 said  Page 16 under the heading:
HDMI/USB Reference Design (Raspberry Pi Pico 2)
The link given for the "The construction pack for this design" is actually for the VGA version. I cannot find the construction pack for the HDMI/USB Reference Design.

All that sort of thing will be fixed before 6.00.01 goes live.  At this time the website is still supporting the old version.

Geoff
Geoff Graham - http://geoffg.net
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1619
Posted: 05:25am 30 Nov 2024
Copy link to clipboard 
Print this post

Page 26 under the heading:
Pulse Width Modulated (PWM) Signal
I think it is worth adding that the LC circuit is a notch filter designed to remove most of the 44.1 kHz PWM carrier from the audio as designed by Volhout. Where this is not necessary a simpler RC circuit may be used, see the Game*Mite and the Pico Gamer for examples.

CRCs
CRCs are a bit of a hobby horse of mine and not used nearly enough in my opinion especially when data is transmitted from one 'Mite to another. Many people are put off by the "perceived" complexity although using them is quite simple when the CRC generation routine is already provided as in some versions of MMBASIC (and on Fruit of the Shed). The MMB4W manual includes an appendix describing their use and for what it's worth the appendix is included here.

Cyclic Redundancy Check.zip


Bill
Keep safe. Live long and prosper.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6839
Posted: 08:31am 30 Nov 2024
Copy link to clipboard 
Print this post

You've done a fantastic job on this manual, Geoff. We're doing our best to catch you out, but it's hard work. ;)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9187
Posted: 08:35am 30 Nov 2024
Copy link to clipboard 
Print this post

Geoff: another trivial one

OPTION RESOLUTION 640/640x1280 [,252000/315000]

In the case of HDMI 640x480 you can choose the display frequency 60Hz (252MHz) or 75Hz (315MHz)

Also in then acknowledgements:

"The CRC calculations are copyright Rob Tillaart"
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3210
Posted: 09:30am 30 Nov 2024
Copy link to clipboard 
Print this post

  matherp said  Geoff: another trivial one
OPTION RESOLUTION 640/640x1280 [,252000/315000]

Sorry, that does not make sense.  What page, what context?
And anyway, how can you have a resolution of 252000/315000.

  matherp said  In the case of HDMI 640x480 you can choose the display frequency 60Hz (252MHz) or 75Hz (315MHz)

Is this correct?



Geoff
Geoff Graham - http://geoffg.net
 
     Page 2 of 5    
Print this page
© JAQ Software 2024