Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 15:45 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 : PicoMite Memory Map

Author Message
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 425
Posted: 07:14pm 19 Sep 2022
Copy link to clipboard 
Print this post

Hi all

Is there a PicoMite (non VGA if that makes a difference) memory map available?

I am attempting to teach all things "memory" and have resorted to the ZX Spectrum and Vic20 / Electron memory maps as they are relatively easy to explain / understand.   Using such I can add things to memory and retrieve them with PEEK / POKE or equivalent.

I have checked the manual ;-)

Cheers
N
Entropy is not what it used to be
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8304
Posted: 07:21pm 19 Sep 2022
Copy link to clipboard 
Print this post

If you just want an area to peek and poke in then you can use PEEK(VARADDR var) to find the start address of a string then POKE and PEEK using that address with an offset to select the address. This has the advantage that, if you keep the POKEable area less than 250 bytes or so it's completely safe. ADDR+0 is the string length (default is 256 bytes IIRC). ADDR+1 is the first byte of the string.
Note that PRINTing the string may not be reliable as not all characters from &H0 to &HFF are printable, although you can PEEK and POKE them.
Edited 2022-09-20 05:25 by Mixtel90
Mick

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

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 425
Posted: 07:34pm 19 Sep 2022
Copy link to clipboard 
Print this post

  Mixtel90 said  If you just want an area to peek and poke in then you can use PEEK(VARADDR var) to find the start address of a string then POKE and PEEK using that address with an offset to select the address. This has the advantage that, if you keep the POKEable area less than 250 bytes or so it's completely safe. ADDR+0 is the string length (default is 256 bytes IIRC). ADDR+1 is the first byte of the string.
Note that PRINTing the string may not be reliable as not all characters from &H0 to &HFF are printable, although you can PEEK and POKE them.


Perfect - works a treat.  Thank you.

Is there a "map" though somewhere -- as the above require me to define a variable first.  What if I just want to write/read memory at the get go?

For example, in recent threads, getting the internal temperature is mentioned.  Presumably somewhere in memory this exists in a raw version and the MMBasic OS just interprets / calculates something from this?   So, can I pull the raw value from the Pico -- to do so needs a memory map?  (Happy to be told I'm wrong about all this ;-) )

N
Entropy is not what it used to be
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8304
Posted: 09:00pm 19 Sep 2022
Copy link to clipboard 
Print this post

This is the closest I know of.

The PicoMite isn't what you might expect. The program is in flash, the variables are in RAM. Consequently you don't have large chunks of contiguous memory area to play in.
Edited 2022-09-20 07:04 by Mixtel90
Mick

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

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2681
Posted: 10:13pm 19 Sep 2022
Copy link to clipboard 
Print this post

  Mixtel90 said  This is the closest I know of.

The PicoMite isn't what you might expect. The program is in flash, the variables are in RAM. Consequently you don't have large chunks of contiguous memory area to play in.

I have not needed to use peek/poke but it is in the manual. Not much about bit usage.
Is it handled fast in mmbasic before I try? Using integers for bit values I can not access apart from masking using and.
If one dim'd an array is there no pointer to it that could be used as a start of an "address" in ram?
A blit buffer seems constant so could a blit buffer be used as ram in that it is writable and readable? Just a beginner.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4147
Posted: 10:48pm 19 Sep 2022
Copy link to clipboard 
Print this post

  Nimue said  What if I just want to write/read memory at the get go?

With care, you can.

  Nimue said  For example, in recent threads, getting the internal temperature is mentioned.  Presumably somewhere in memory this exists in a raw version and the MMBasic OS just interprets / calculates something from this?   So, can I pull the raw value from the Pico -- to do so needs a memory map?

Refer to the MMBasic pico sources / pico datasheet e.g. for the addresses of hardware / examples of accessing hardware (I/O registers etc).

Expect some grief (CPU resets etc).

John
Edited 2022-09-20 08:49 by JohnS
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2832
Posted: 11:54pm 19 Sep 2022
Copy link to clipboard 
Print this post

@stanleyella
Mixtel90 explains it clearly in post 2 of this thread.


S$ = "The quick brown fox jumps over the lazy God."
> ? PEEK(VARADDR S$)
537024256
> ? PEEK(byte 537024256+0)
44
> For n=1 to 44 : Print chr$(PEEK(byte 537024256+n)); : next
The quick brown fox jumps over the lazy God.

> ? PEEK(byte 537024256+41)
71
> ? PEEK(byte 537024256+43)
100
>  POKE byte 537024256+43,71
>  POKE byte 537024256+41,100
> For n=1 to 44 : ? chr$(PEEK(byte 537024256+n)); : next
The quick brown fox jumps over the lazy doG.
>
> ? s$
The quick brown fox jumps over the lazy doG.
>

Byte 0 of a string is its length. In normal use it is hidden.
.
Edited 2022-09-20 11:15 by phil99
 
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