Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:07 07 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 : PicoMite Alpha Firmware - a27 onwards - starting on displays

     Page 11 of 14    
Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4249
Posted: 03:58pm 01 Jul 2021
Copy link to clipboard 
Print this post

  Mixtel90 said  While I'm developing...

RESTORE <variable$> would be *really* handy! lol


I thought exactly this a couple of days ago, and you can do it on the CMM2 using EXECUTE. But before I could recommend it to you I recalled that EXECUTE (in my case for use with RUN) was amongst the things I asked Peter for on the PicoMite and he said "No"  

Best wishes,

Tom
Edited 2021-07-02 02:06 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7494
Posted: 04:18pm 01 Jul 2021
Copy link to clipboard 
Print this post

It's hardly essential really, just something I'd have found handy at the moment because I put the main RESTORE at the beginning, but moved the display sub to the end to get it out of the way - so it's RESTORE command is now at the end...  Not one of my better decisions. :)
Mick

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

Joined: 18/11/2011
Location: United Kingdom
Posts: 3994
Posted: 05:36pm 01 Jul 2021
Copy link to clipboard 
Print this post

With something along the lines of

DATA "Sample1:"
DATA
DATA
etc...

DATA "Sample2:"
DATA
DATA

I suppose you can just use RESTORE then READ in a loop until you find the embedded label.

John
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7494
Posted: 06:48pm 01 Jul 2021
Copy link to clipboard 
Print this post

You can, yeah, but it's just not "classy". Something akin to serving ice cream with a fork. :)

Not a bad idea though, thanks.
Mick

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

Joined: 02/06/2014
Location: Germany
Posts: 1524
Posted: 08:16pm 01 Jul 2021
Copy link to clipboard 
Print this post

@Mick

I don't understand what's wrong with RESTORE <LABEL>.
Maybe I missed something?
I use the DATA statement not very often.

Kind regards
causality ≠ correlation ≠ coincidence
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4249
Posted: 08:41pm 01 Jul 2021
Copy link to clipboard 
Print this post

  twofingers said  @Mick

I don't understand what's wrong with RESTORE <LABEL>.


The label has to be a hardcoded identifier, you can do:
RESTORE foo


You can't do the following which would open up many more options:
a$ = "foo"
RESTORE a$


A similar restriction applies to RUN.

Best wishes,

Tom
Edited 2021-07-02 06:42 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1524
Posted: 08:49pm 01 Jul 2021
Copy link to clipboard 
Print this post

@Tom
Thanks for explaining!

Best regards
Michael
causality ≠ correlation ≠ coincidence
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7494
Posted: 08:54pm 01 Jul 2021
Copy link to clipboard 
Print this post

There's nothing at all wrong with RESTORE <label>. I use it all the time and have done for years. However, consider this:

label1:
data
data

label2:
data
data

label3:
data
data

now,
RESTORE <label> can take you to any one of those data blocks.

whereas
a$="label"+n
RESTORE a$

can load data from a block controlled by value n, so you can access them in 2,1,3 or 3,2,1 or whatever order *without having to scan through all the data to reach the last block*. No matter how big the data blocks are, you get to where you want virtually instantly.

Also, you can have the data read from several parts of your program at different times with one value to decide which data block is going to be used by *all* reads.

All this can be done by reading the data into arrays, but that's very wasteful on memory space as you are having to store everything twice - and string arrays are especially wasteful.

I can't think offhand of a BASIC that implements RESTORE <variable>. The old TRS-80 could do a neat trick: scan through the entire data block once, with a recognisable data statement in various places. As you find the key, peek the address in the data pointer and store it. You can now restore to any recorded point simply by poking one of those addresses into the data pointer.
Mick

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

Joined: 18/11/2011
Location: United Kingdom
Posts: 3994
Posted: 08:27am 02 Jul 2021
Copy link to clipboard 
Print this post

How about
EVAL("RESTORE " + a$)

John
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4249
Posted: 08:31am 02 Jul 2021
Copy link to clipboard 
Print this post

  JohnS said  How about
EVAL("RESTORE " + a$)

John


EVAL only evaluates expressions/functions, RESTORE is a command.
EXECUTE was added to the CMM2 to perform the equivalent for commands.

Best wishes,

Tom
Edited 2021-07-02 18:31 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4841
Posted: 11:51am 02 Jul 2021
Copy link to clipboard 
Print this post

Documentation continuation:

Picomite doc a45.zip

For those who do not wat to read the whole thread...

V.
PicomiteVGA PETSCII ROBOTS
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3994
Posted: 12:26pm 02 Jul 2021
Copy link to clipboard 
Print this post

  thwill said  EVAL only evaluates expressions/functions, RESTORE is a command.
EXECUTE was added to the CMM2 to perform the equivalent for commands.

Oh :(
That's weird.

Sorry

John
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7494
Posted: 07:28am 03 Jul 2021
Copy link to clipboard 
Print this post

With apologies to Volhout ;) - I've restructured the docs a little to split off the PIO stuff. It's not something that will interest everyone so I think it's better in its own file.

PicoMite docs a45.zip
Mick

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 10043
Posted: 08:42am 03 Jul 2021
Copy link to clipboard 
Print this post

a46


PicomiteV5.07.00a46.zip


Fixes some issues with PIO

Test program for Volhout. This outputs on 5 SET pins and then changes the set base between runs

PIO stop 0,0
PIO clear 0
SetPin 1,pio0
SetPin 2,pio0
SetPin 4,pio0
SetPin 5,pio0
SetPin 6,pio0
PIO PROGRAM LINE 0,0,&he09F
PIO program line 0,1,&He11f
PIO program line 0,2,&He000
PIO program line 0,3,1
PIO init machine 0,0,100000,Pio(PINCTRL 0,5,0,0,0,0,0)
PIO start 0,0
Pause 10000
PIO stop 0,0
SetPin 1,off
SetPin 7,pio0
PIO init machine 0,0,100000,Pio(PINCTRL 0,5,0,0,0,1,0)
PIO start 0,0
Pause 10000
PIO stop 0,0
SetPin 2,off
SetPin 9,pio0
PIO init machine 0,0,100000,Pio(PINCTRL 0,5,0,0,0,2,0)
PIO start 0,0
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10043
Posted: 12:07pm 03 Jul 2021
Copy link to clipboard 
Print this post

a47


PicomiteV5.07.00a47.zip


Background GPS processing now implemented as per CMM2
OPEN "COMn:baud" as GPS [,time_offset_from_UTC_in_hours] [,monitor_on]
CLOSE GPS
PRINT #GPS,"string$"
GPS function e.g. ? GPS(TIME)

A good use is:

rtc settime gps(date)+" "+gps(time)
Edited 2021-07-03 23:23 by matherp
 
cdeagle
Senior Member

Joined: 22/06/2014
Location: United States
Posts: 264
Posted: 04:32pm 03 Jul 2021
Copy link to clipboard 
Print this post

Here's a picture of the PicoMite interfaced with an Adafruit GPS Featherwing. Thanks Peter.



 
cdeagle
Senior Member

Joined: 22/06/2014
Location: United States
Posts: 264
Posted: 08:03pm 03 Jul 2021
Copy link to clipboard 
Print this post

Also works with the Zio Qwiic GPS module.


 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10043
Posted: 12:19pm 04 Jul 2021
Copy link to clipboard 
Print this post

a48


PicomiteV5.07.00a48.zip


Audio

Setting up audio takes one of the PWM channels

OPTION AUDIO PWMnApin, PWMnBpin

e.g.

OPTION AUDIO GP18,GP19

This is a permanent option and blocks other use of the pins. As the audio output is generated using PWM you will need a low pass filter on the output (e.g. the circuit on the CMM1)

You can then use the following commands as per the CMM2

PLAY TONE
PLAY SOUND (but not the noises)
PLAY WAV (up to stereo at 48KHz)

I haven't implemented PLAY MP3 or PLAY FLAC as they take too much working memory and would have unacceptably reduced memory availability for programs and/or variables.

Note though the power supply on the Pico board is CATASTROPHIC

Everything the CPU does can be heard on the audio - in particular reading from the SDcard. Look at the signals on a scope and you will see massive spikes on the lines.
I would strongly recommend if you want to use the audio you use a separate 3.3V supply (preferably with a linear regulator) and turn off the Pico supply by grounding the 3V3_EN pin
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4249
Posted: 01:05pm 04 Jul 2021
Copy link to clipboard 
Print this post

  matherp said  Note though the power supply on the Pico board is CATASTROPHIC


No doubt I'm opening myself up to a level of derision, but if the Pico power supply (3V3/OUT) is such a pig in a poke then why hasn't there been a hue and cry from the Maker community ? Perhaps there has been and I'm too lazy to have seen it, or is the PicoMite just trying to push it beyond its intended use case ?

Edit: and I suppose I should also ask is the problem with the RP2040 silicon, or just with how the Pico board chooses to present it.

Best wishes,

Tom
Edited 2021-07-04 23:07 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10043
Posted: 01:20pm 04 Jul 2021
Copy link to clipboard 
Print this post

  Quote   suppose I should also ask is the problem with the RP2040 silicon, or just with how the Pico board chooses to present it


One or both. They use a tiny switching regulator with bugger all bulk capacitance and there could be cross-talk inside the chip

I think you have a Maker board? Plug an amp in to the audio socket and play a WAV file. You will hear the issue and see the noise correlating with the SD_CS

UPDATE

More info: I've wired the SDcard via a 4R7 resistor with a 33uF and 100nF capacitor across the SD power rails and this has dramatically improved things.

I've also tied 3V3_EN low and used an external 3.3 low dropout linear regulator and this improves things still further.

I think I feel a new RP2040 PCB design coming on with on-board linear regulator, properly wired SDcard, and reset switch as well as the bootsel switch
Edited 2021-07-05 00:12 by matherp
 
     Page 11 of 14    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025