![]() |
Forum Index : Microcontroller and PC projects : PicoMite Alpha Firmware - a27 onwards - starting on displays
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4249 |
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 KingdomPosts: 7494 |
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 KingdomPosts: 3994 |
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 KingdomPosts: 7494 |
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: GermanyPosts: 1524 |
@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 KingdomPosts: 4249 |
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: GermanyPosts: 1524 |
@Tom Thanks for explaining! ![]() Best regards Michael causality ≠ correlation ≠ coincidence |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7494 |
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 KingdomPosts: 3994 |
How about EVAL("RESTORE " + a$) John |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4249 |
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: NetherlandsPosts: 4841 |
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 KingdomPosts: 3994 |
Oh :( That's weird. Sorry John |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7494 |
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 KingdomPosts: 10043 |
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 KingdomPosts: 10043 |
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 StatesPosts: 264 |
Here's a picture of the PicoMite interfaced with an Adafruit GPS Featherwing. Thanks Peter. ![]() |
||||
cdeagle Senior Member ![]() Joined: 22/06/2014 Location: United StatesPosts: 264 |
Also works with the Zio Qwiic GPS module. ![]() |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10043 |
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 KingdomPosts: 4249 |
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 KingdomPosts: 10043 |
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 |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |