Name:
#slot
Syntax:

#SLOT number

Description:

Select the internal program slot for program download. 

If no #slot directive is used the program will be downloaded into slot 0.

As the eeprom data memory is shared between each slot it is normal to add a #no_data directive to all slots other than slot 0, so that the eeprom data memory is only programmed during a slot 0 download.

 

14M2, 18M2+, 20M2 parts -

2 internal slots (0-1)

When the chip is reset, slot 0 automatically runs. Slot 1 can be started with a 'run 1' command within slot 0.

 

28X2, 40X2 -

4 internal slots (0-3) or 4 i2c program slots (4-7)

When the chip is reset, slot 0 automatically runs. Slot 1 (or any other slot) can be started with a 'run 1' command within slot 0.

 
Applies To:
14M2, 18M2, 20M2, 20X2, 28X2, 40X2
See Also:
Related Create:
Share:
Print:

Using #'slot

Download a program into slot 1 instead of slot 0.

Code Example:
#slot 1
#no_data
do
   toggle b.1
   pause 1000
loop
Copy Code Submit an Example

Using two slots

This program uses two slots and jumps between the two slots as it executes. The two programs should be saved in separate source files, for example, "slot0.bas" and "slot1.bas".

Code Example:
; This file is "slot0.bas" -

#slot 0

b0 = b0 + 1
sertxd( "Slot 0 = ", #b0, cr, lf )
pause 500
run 1

; This file is "slot1.bas" -

#slot 1

b0 = b0 + 1
sertxd( "Slot 1 = ", #b0, cr, lf )
pause 500
run 0
Copy Code Submit an Example

Submit Your Own Code!

You must be logged in to submit code examples. Login now.