SX/B code page/Addresses
Dunnsept
Posts: 115
I am finally putting together the complete code for my project and now am getting
"Address 259 is not within lower half of memory page"
"Address 257 is not within lower half of memory page"
"Error 30, Pass 2 overwriting same program counter location"
In reading the docs, it says "Note that as of version 1.2, it is not (sic) longer necessary for the programmer to manually set code page addresses."
so,.... how do I get around these errors? I tried setting the address manually anyway as per the online help, but
that didn't change anything. A search on the forums only turned up a couple references saying "well, you have to setup your
code so your subroutines are in the lower half" but the entries were for ASM and not SX/B.
I had working code and all I did was put in my ISR code. I sure hope this is a simple fix as I dont have anywhere
near complete code yet.. I still have to add in all of my PID routines and error checking.
paul...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
stand back! I have a slide rule and I know how to use it!
"Address 259 is not within lower half of memory page"
"Address 257 is not within lower half of memory page"
"Error 30, Pass 2 overwriting same program counter location"
In reading the docs, it says "Note that as of version 1.2, it is not (sic) longer necessary for the programmer to manually set code page addresses."
so,.... how do I get around these errors? I tried setting the address manually anyway as per the online help, but
that didn't change anything. A search on the forums only turned up a couple references saying "well, you have to setup your
code so your subroutines are in the lower half" but the entries were for ASM and not SX/B.
I had working code and all I did was put in my ISR code. I sure hope this is a simple fix as I dont have anywhere
near complete code yet.. I still have to add in all of my PID routines and error checking.
paul...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
stand back! I have a slide rule and I know how to use it!
Comments
Don't set the address manually.
What is happening (probably, you didn't post your code) is that your interrupt code is pushing down your SUBs out of the 1st half of the code page.
Do this...
'
INTERRUPT
GOTO IntHandler
MySub1 SUB
MySub2 SUB
PROGRAM Start
IntHandler:
' Interrupt code
RETURNINT
Start:
' Program code
END
'
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
"I'm a man, but I can change, if I have to, I guess" The Red Green Show
·
and I still have to put in all of the PID routines and tons more code.. hope I don't run into this again.
thanks!
paul...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
stand back! I have a slide rule and I know how to use it!
I've attached the code this time.. it is getting close to being complete, but is still missing all of the work in the middle, PLUS I still need to add the code to drive the
SSR with pwm. So, even if I remove the stuff from main: about prompting for times, I still have lots of code to put in it's place.
is there some method to organize the subs to get around this or do I have to keep "playing" around to get them to fit properly?
this is going to keep coming back to bite me as the first time I had to remove portions of my ISR to get it to compile happily. That portion removed
was something I really didn't want to.
any advice appreciated.. maybe there are portions I could 'optimize' to make smaller so it would all fit in .
thanks!
paul...
what all of the above means is that once the address issue is resolved, this code may still not compile properly. It's beyond work in progress
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
stand back! I have a slide rule and I know how to use it!
Post Edited (Dunnsept) : 7/5/2006 3:16:12 PM GMT
You MUST declare the SUBs AFTER the interrupt GOTO "IntHandler" and BEFORE your interrupt code.
Here is the reason... The INTERRUPT keyword must be the first keyword that generate code. Because the interrupt code MUST start at address $000. The SUB declarations must be in the first 256 code words, because the CALL address is only 8 bits.
Even with SUB moved up, you have run out of code space. That is what the "Overwriting same program counter location" error is telling you.
You need to put the 1-wire commands into subroutines. That will save a bunch of code space. Oh and the PULSOUT command too.
Your trying to do quite a lot with only 2K of code space. If you have much more to add, you may want to consider switching to the SX48 protoboard. The SX48 has 4K of code space.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
"I'm a man, but I can change, if I have to, I guess" The Red Green Show
Post Edited (Bean (Hitt Consulting)) : 7/5/2006 4:12:08 PM GMT
thanks, I'll move the sub declaration and put in the rest of my code and see what happens.. I was planning on running this on the sx48 protoboard anyway, it's just easier to do the prototype work on the sx tech board with the solderless breadboard in place
thanks again
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
stand back! I have a slide rule and I know how to use it!
i soldered female sip's around the proto area where the pinouts and power were, then glued a breadbosrd in the middle... makes a good test bed that way.
dan