External Slot on AXE022 with X2

tarzan

Senior Member
I’m trying to download to external slot on AXE022 at address 001. This should be a straightforward task but I get the same error on two different PCs.

I assume that Hi2csetup is not necessary and that using the #slot directive will perform this task automatically.

Code:
#slot %00100100 'external i2c eeprom axe022 address 001 slot 0
 

Attachments

Last edited:

westaust55

Moderator
Certainly no X2 experience here, but looking at your attachment you have 4 slot commands.

From the PICAXE Manual 2 page 164:
A new program is downloaded into any slot via the #slot directive, which is
added as a line to the program. It is only possible to download one program to one slot at a time.
That suggests only one slot directive can be used at a time.
Presume that your External EEPROM is 24LC128 or larger . . .


EDIT:
your #slot command seems correct otherwise.

PICAXE Manual 2 page 164
states:
Bits 7-5 of the slot number are used as the EEPROM address, e.g. for an EEPROM with address pins A2 low, A1 high and A0 high, running slot 5 would be
run %011x1001 (where x = 0 or 1, don’t care)
think that run statement should read:

run %011x0101 for slot 5
 
Last edited:

tarzan

Senior Member
I'm using 24LC256 EEPROM.

Note Bit0,Bit1 slot number & Bit2 i2c doesn't leave room for slot number 5.

Page 166:
For an 24LC128 at address 0 (ie pins A0, A1, A2 all connected to 0V) the
program slots are simply numbered 4 to 7. For other 24LC128 addresses the run
(and #slot) number must be calculated as follows

Bit7 24LC128 A2
Bit6 24LC128 A1
Bit5 24LC128 A0

Bit4 reserved for future use
Bit3 reserved for future use
Bit2 1 = I2C, 0 = internal
Bit1, 0 slot number (0-3)
 

tarzan

Senior Member
picaxex2.pdf

Page 5:

External Program Slots
As well as the internal memory slots, 4 additional slots can be used by connecting an external i2c EEPROM chip (part 24LC128 or 24LC256). As up to 8 different I2C chips could be used on the same I2C bus, this gives a theoretical 32 additional program slots.
 

hippy

Ex-Staff (retired)
I will look at the download issue though I haven't had any serial port errors like that.

The #slot directive should be as described in post #1, %00100100, for your configuration.
 

Technical

Technical Support
Staff member
This is a simple compiler bug when using binary notation for #slot and having any other text or whitespace after the final 0 or 1 (e.g. a comment as you have). Sorry for any confusion.

We will fix this for the next release, but in the mean time please use decimal and/or do not leave a comment on the same line!

#slot 36
or
#slot %00100100
not
#slot %00100100 'comment
 
Last edited:

Technical

Technical Support
Staff member
I'm using 24LC256 EEPROM.

Note Bit0,Bit1 slot number & Bit2 i2c doesn't leave room for slot number 5.

Page 166:
For an 24LC128 at address 0 (ie pins A0, A1, A2 all connected to 0V) the
program slots are simply numbered 4 to 7. For other 24LC128 addresses the run
(and #slot) number must be calculated as follows

Bit7 24LC128 A2
Bit6 24LC128 A1
Bit5 24LC128 A0

Bit4 reserved for future use
Bit3 reserved for future use
Bit2 1 = I2C, 0 = internal
Bit1, 0 slot number (0-3)
Thats a terminology mixup depending oin how you read it - basically for i2c there are 4 slots defined by bits 0 and 1. But as bit2 is also fixed to a '1' all three bits together then technically define the real life numbers 4-7 rather than 0-3. Whichever way you look at it there are 4 internal slots (0xx) and 4 external slots (1xx) available (per EEPROM address).
 

hippy

Ex-Staff (retired)
Slot 0 %00000000 Internal Slot 0
Slot 1 %00000001 Internal Slot 1
Slot 2 %00000010 Internal Slot 2
Slot 3 %00000011 Internal Slot 3

Slot 4 %00000100 External $A0 Eeprom, block 0 ( A2=0, A1=0, A0=0 )
Slot 5 %00000101 External $A0 Eeprom, block 1 ( A2=0, A1=0, A0=0 )
Slot 6 %00000110 External $A0 Eeprom, block 2 ( A2=0, A1=0, A0=0 )
Slot 7 %00000111 External $A0 Eeprom, block 3 ( A2=0, A1=0, A0=0 )

Slot 36 %00100100 External $A2 Eeprom, block 0 ( A2=0, A1=0, A0=1 )
Slot 37 %00100101 External $A2 Eeprom, block 1 ( A2=0, A1=0, A0=1 )
Slot 38 %00100110 External $A2 Eeprom, block 2 ( A2=0, A1=0, A0=1 )
Slot 39 %00100111 External $A2 Eeprom, block 3 ( A2=0, A1=0, A0=1 )

: etc :

Slot 228 %11100100 External $AE Eeprom, block 0 ( A2=1, A1=1, A0=1 )
Slot 229 %11100101 External $AE Eeprom, block 1 ( A2=1, A1=1, A0=1 )
Slot 230 %11100110 External $AE Eeprom, block 2 ( A2=1, A1=1, A0=1 )
Slot 231 %11100111 External $AE Eeprom, block 3 ( A2=1, A1=1, A0=1 )
 

BeanieBots

Moderator
Similar issues also exist for many of the directives when text is added on the same line.

eg
#no_data:#no_table:#slot N

is accepted but does not do as intended.
Only works as expected when each is on a seperate line.
 

Technical

Technical Support
Staff member
Manual part 2 page 7
Code:
[FONT=Times New Roman][SIZE=1][COLOR=#292526][FONT=Times New Roman][SIZE=1][COLOR=#292526][FONT=Times New Roman][SIZE=1][COLOR=#292526][LEFT]All directives start with a # and must be used on a single line. Any other nonrelevant[/LEFT]
line content after the directive is ignored.
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
 
Top