Number of gosub's

After searching the forum, I have not found an answer to this question, which suggests that I may be missing something simple.
I am writing a very large program for a project I am working on, but have not yet got the chip (an 18X)
I have more than 16 GoSub commands, so have set it to be 256 gosub commands in the options of the programming editor. 256 is pleanty for my needs.
First of all, when I downlad the code, does the chip automatically adjust to the new number of gosub commands, or is it a different chip. If the answer is simply no, is there a way to change the answer?
If answered yes to either of these questions, then is there any effect in available memory or other side effect?
 
So how much memory would I be expected to loose?
My program is about 1500 bytes out of 2048.
Thanks for your quick reply, much appreciated.
 
I would try it, but I have not got the chip. School is ordering it, but it may take a while.
I am writing the program in advance so that I can download it all when the chip arrives.
I'd be greatful if someone could try it and pass on their findings.
 

hippy

Technical Support
Staff member
The PICAXE determines whether it's using 16 or 256 GOSUB's when it starts running the downloaded program. The token code is slightly different and adds a few bytes of fixed overhead to every program when using 256 GOSUB's. In 16 GOSUB's mode, every GOSUB uses 31 bits, in 256 GOSUB's mode, 35 bits, so not a lot of overhead for the gain given.
 
Thanks for all your help, but as luck would have it, my picaxe arrived earlier than expected, and I got it this morning.
So far so good, BUT when I treid to download it (and even a blank program) I got the following error message:
"Error - incorrect hardware found for this software mode!

Possible causes:
1) Software is in the wrong mode.
2) Wrong hardware connected.

The software is currently in the mode for: PICAXE-18X 4MHz >=8.2
The hardware connected to the computer is: PICAXE-18X 8.1

Do you want to change mode now?
Yes/No"

So... Is there a solution to this error? It sounds like hippy has had sucsess (or is just very knowledgable!) It appears to me that there may be more than one kind of 18X, but I have only seen one kind for sale.
Maybe Technical could state whether or not this is a fault in the editor or me, and if the only solution is to make my program an awful lot bigger by using the same pieces of code coppied.
 

BeanieBots

Moderator
Sounds like you have a very old PICAXE 18X if it is version 8.1
I might be wrong but don't think firmware version can support 256 gosubs.
Unfortunately, I can no longer find the firmware release notes which would have answered that for sure.
Are they still available on-line anyone?
 
Well that would make sense. The chip I have is from another students project (my teacher forgot about it until now), from a couple of years ago, and I beleive that the chip was not new then.
So if I am to get a new chip from Rapid Electronics, rather than scrounge one out of an old circuit, there should be no problem with using 256 gosubs. A quick search on google returned limited results, but it appears that the newest firmware version is 8.6.
Thanks for your diagnosis; I can sleap easy tonight!
 

Technical

Technical Support
Staff member
8.1 is very old and does not support 256 gosubs
BB - firmware.txt is found in the main programming editor folder on your computer
 

hippy

Technical Support
Staff member
Unfortunately, I can no longer find the firmware release notes which would have answered that for sure. Are they still available on-line anyone?
C:\Program Files\Programming Editor\firmware.txt

Version 8.2 and upwards support 256 GOSUB's. There are no dates of release given in that file but most new purchases should be a more recent version, 8.6 or 8.7
 

BeanieBots

Moderator
Found the file, thanks.
Shame there are no dates specified.
Current version = V7
V5 corrected the ReadTemp command which I have a note about in one of my programs dated 02/03/2004, so V1 must be VERY old.
 
Top