Multiple slots on the X2 - what am I doing wrong?

vshortt

Senior Member
I don't think I'm doing anything too difficult here, but the picaxe editor won't seemto let me do it... so where's my goof up?

I'm trying to load 2 programs into 2 slots... here's what I'm doing:

PROGRAM 1:
Code:
#slot 0
#no_data
... program code...
if pinC.6 = 1 then
   run 1
endif
With this code I Get the following error when I try to upload the program:

Code:
-----------------------------------------------
| run 1                                        |
| ^                                            |
|Error: invalid run program slot on this part! |
|______________________________________________|

The second problem is this:

When I try to upload the second slot, it just runs as though it's in slot 0

Code is:
Code:
#slot 1
# no_data
 
... program code here
I have the editor in "20X2" mode to match the 20x2 chip I am writing to.

According to the manuals, I should be able to store up to 4 independant programs on a 20x2... is this wrong?

Seems like such a simple command... yet I can't get it right... please point me n the right direction guys!

Many thanks.
 

BeanieBots

Moderator
From the manual page about RUN.
The 28X2/40X2 parts have four completely separate internal program slots. By
default program 0 runs whenever the part is reset. The 20X2 only supports slot 0.
So, I guess you can't have "run 1" with a 20X2.
 
Top