PICAXE Variable, Memory and Storage Summary

hippy

Technical Support
Staff member
Standard PICAXE range

Program Memory - Up to 2048 bytes - The PICAXE-18X has 2048 bytes of program storage ( approximately 600 lines of code ), the PICAXE-08 has up to 128 bytes ( approximately 40 lines of code ), the rest of the current range have up to 256 bytes ( approximately 80 lines of code ).

General Purpose Variables - 14 bytes - b0-b13 ( and other overlayed 'bit and 'w' variables ), used by name and can also be accessed via Peek and Poke commands at addresses $32 to $3F.

Special Function Variables - Variables which are used to control the chip operation through firmware; the 'pin' and 'dir' variables etc. Used by name as general purpose variables are.

User Ram - up to 112 bytes - Areas within SFR which can be used as temporary byte and word storage, accessed via Peek and Poke commands. The amount of User Ram available varies between PICAXE variants. All but the PICAXE-08 have a minimum of 48 bytes at Peek/Poke addresses $50 to $7F.

Data Eeprom - up to 256 bytes - Non-volatile read and writeable data, defined by Eeprom or Data commands, accessed via Read and Write Commands. Data Eeprom is shared with Program Memory on some PICAXE variants.

SFR - Chip control registers, accessed by Peek and Poke commands. The PICAXE-08 does not allow access to SFR.


PICAXE-X1 range

Program Memory - 4096 bytes - Allowing approximately 1000 lines of code.

General Purpose Variables - 28 bytes - b0-b27 ( and other overlayed 'bit and 'w' variables ), used by name. Partly accessible via Peek and Poke commands.

Special Function Variables - Variables which are used to control the chip operation through firmware; the 'pin' and 'dir', 'ptr' and '@ptr' variables etc. Used by name as general purpose variables are.

System Variables - 8 words - An additional set of Special Function Variables which reflect what's going on within the firmware / hardware of the chip - interrupt flags, timers etc. Used by name as general purpose variables are.

User Ram - 95 bytes - Areas within SFR which can be used as temporary byte and word storage, accessed via Peek and Poke commands at addresses $50 to $7E and $C0 to $EF.

Scratchpad - 128 bytes - Accessible via 'ptr' and '@ptr' variables and Get and Put commands. Can be filled in the background through high-speed serial and read and written by another PICAXE when operating as an I2C slave.

Table - 256 bytes - Non-Volatile, read only data, defined by Table command, accessed via ReadTable command.

Data Eeprom - 256 bytes - Non-volatile read and writeable data, defined by Eeprom or Data commands, accessed via Read and Write Commands.

SFR - 256 bytes - Chip control registers, accessed via Peek and Poke commands.


PICAXE-X2 range

Program Memory - 4096 bytes per slot - Allowing approximately 1000 lines of code per slot. The PICAXE-20X2 supports a single internal slot, the 28X2 and 40X2 have four internal slots. An additional four slots can be provided for by using an external I2C Eeprom. With multiple I2C Eeproms, up to 32 external slots can be supported, more with additional Eeprom selection hardware added.

General Purpose Variables - 256 bytes - The first 56 map to b0-b55 ( and other overlayed 'bit and 'w' variables ), used by name and all can be accessed via the 'bptr' and '@bptr' variables or Peek and Poke commands ( b0 is at address $00 ).

Special Function Variables - Variables which are used to control the chip operation through firmware; the 'pin' and 'dir', 'ptr' and '@ptr' variables etc. Used by name as general purpose variables are.

System Variables - 8 words - An additional set of Special Function Variables which reflect what's going on within the firmware / hardware of the chip - interrupt flags, timers etc. Used by name as general purpose variables are.

User Ram - 200 bytes ( 72 bytes for 20X2 ) - User Ram is mapped to the General Purpose Variables area, the bytes above those occupied by variables b0-b55. Accessed via the 'bptr' and '@bptr' variables or Peek and Poke commands.

Scratchpad - 1024 bytes ( 128 bytes for 20X2 ) - Accessible via 'ptr' and '@ptr' variables and Get and Put commands. Can be filled in the background through high-speed serial and read and written by another PICAXE when operating as an I2C slave.

Table - 256 bytes - Non-Volatile, read only data, defined by Table command, accessed via ReadTable command.

Data Eeprom - 256 bytes - Non-volatile read and writeable data, defined by Eeprom or Data commands, accessed via Read and Write Commands.

SFR - 256 bytes - Chip control registers, accessed via PeekSfr and PokeSfr commands.

E&OE
 
Last edited:

Dippy

Moderator
Can't you stick these useful summary tables into the Manuals hippy?
That's where they belong.


How long can a copy/paste/publish take?
 

hippy

Technical Support
Staff member
I won't detail the internal processes but I think everyone realises that, when they don't have sole and total control over everything, things are never as simple as people would otherwise imagine they are and considerations arise which in other circumstances wouldn't matter.
 

BeanieBots

Moderator
These situations are understood. Besides, it's only possible to do ten 6 minute jobs every hour without breaks.
However, couldn't we have a "Hippy manual of little gems" that could be updated by yourself that was not part of the "official" rigourously document controlled suite of manuals?

Even a simple (locked) forum sticky would prevent it from eventually falling into the bowels of the archives.
 

Dippy

Moderator
Good idea.

Isn't there a Rev-Ed 'Suggestion Box' just by the coffee machine?

Maybe plans for a "Manual 4 Hippy's Product Summary and Circuit Hints 'n' Tips" (incorporating WestAusts Table Collective) ?

I would have thought there is enough data now to justify it. Is it really that difficult?
 
Top