Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 16:04 21 Nov 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 : Flash Memory on Pi Pico

Author Message
rea23
Newbie

Joined: 16/09/2022
Location: Switzerland
Posts: 26
Posted: 08:24am 06 Oct 2022
Copy link to clipboard 
Print this post

Hi,
maybe a stupid question. But is it possible to use the 2 MB flash memory of the pi pico to store/load a ranking list (two small text files), or an image pic.bmp of about 250 KB? So you don't have to use an SD card.

By the way, i bought a pi pico that has a USB-C connector, an RGB LED, a user button and 8 MB QSPI (XiP) flash on board.

https://mikroshop.ch/Home.html?gruppe=3&artikel=2431

This pin compatible pico runs as expected so far. The RGB LED is accessible via GP23 and the button via GP24.


 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8304
Posted: 08:35am 06 Oct 2022
Copy link to clipboard 
Print this post

No. You can't write files to the flash slots. They are for programs only as they store them tokenized.

You can use flash to transfer variables using  VAR SAVE and VAR RESTORE though, if that's of any use.
Mick

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

Joined: 30/03/2016
Location: United Kingdom
Posts: 1646
Posted: 11:28am 06 Oct 2022
Copy link to clipboard 
Print this post

  Quote  
https://mikroshop.ch/Home.html?gruppe=3&artikel=2431


USB-C  
 
rea23
Newbie

Joined: 16/09/2022
Location: Switzerland
Posts: 26
Posted: 12:03pm 06 Oct 2022
Copy link to clipboard 
Print this post

@Mick: Thank you for the tip. This really helps, as I can at least wrap the rankings in two text variables.

Still, it would be very helpful, if one could use the flash memory to store other files as well. Most of the time there is only one program installed on a PI Pico anyway (means one project per Pico). So then the flash memory remains essentially unused. This is even more the case when the capacity of the memory increases to 8, 16 or even more MB.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8304
Posted: 02:35pm 06 Oct 2022
Copy link to clipboard 
Print this post

It's not going to happen, apparently. :)

The flash slots are *extremely* useful during program development, I've found, as you can keep incremental versions very easily.

Because you can chain flash slots (keeping the variables) you can write a single program that's several times the size of the available memory! You could, for example, start your main program. That chains (it's almost like a GOSUB) another that configures a load of variables and stuffs an array or two then returns to the main program, which has remained in memory.

SD cards are so easy to interface and use that, unless you are short of I/O pins and/or space, there's no real reason not to have one. If you are using a SPI display then you only need one more pin - and it can be any of them.
Mick

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

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8304
Posted: 02:38pm 06 Oct 2022
Copy link to clipboard 
Print this post

  Tinine said  
  Quote  
https://mikroshop.ch/Home.html?gruppe=3&artikel=2431


USB-C  


Agreed - but these things are all little extras that put the price up, which was why the original Pico doesn't have USB-C, apparently. Nice to have though.
Mick

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

Joined: 31/12/2012
Location: New Zealand
Posts: 2466
Posted: 02:54pm 06 Oct 2022
Copy link to clipboard 
Print this post

FLASH CHAIN n

Runs the program in flash location n, leaving all variables intact (allows for
a program that is much bigger than the program memory). Does not change
the program memory.


... so as long as you can encode your data within basic statements, such as
DATA "012...789,abc...xyz,ABC...XYZ"
you can chain the flash slot with the particular set of data you want to use next, then at the end of the program in that slot chain back to the flash slot containing your main code. just use a flag to tell your main program that it needs to continue with the new data rather than starting afresh.

with 0..9, a..z, A..Z, plus a couple of punctuation symbols, you have 64 possible unique symbols per byte, which gives a 75% memory usage efficiency (less the overhead of each DATA line).


cheers,
rob   :-)
Edited 2022-10-07 01:05 by robert.rozee
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025