BS2e Programming
hmlittle59
Posts: 404
Hello to all,
Ok call me slow, I have printed out Jon Williams instructions from Nuts & Volts column #71, and I've read and re-read on how to do it and it's not clicking in my head. I know the overall concept, but I'm drawing a blank on what to do when it comes to the actual programming. I'm trying to learn by using the DS1302 Demo code, what part/parts would I move over with variables and what would stay. I want to put the clock programming routine in the 2nd bank, when it needs to be set just move over set it and move back. Can all the variables be in the 2nd bank also? I need more examples or this one explained at a THIRD Graders level so the light in my head will come on.
Any help Please.
1) Start from 1st bank
2) Move DS1302 Demo Code to 2nd bank(I think this is a separate file) and the first has both
3) jump to that bank and prg. the DS1302 Chip
4) return to 1st bank
5) is there an additional 26 var.
I have both BS2 and BS2e
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I HAVE LEARN SO MUCH...BUT STILL KNOW SO LITTLE!!!
hmlittle59
Ok call me slow, I have printed out Jon Williams instructions from Nuts & Volts column #71, and I've read and re-read on how to do it and it's not clicking in my head. I know the overall concept, but I'm drawing a blank on what to do when it comes to the actual programming. I'm trying to learn by using the DS1302 Demo code, what part/parts would I move over with variables and what would stay. I want to put the clock programming routine in the 2nd bank, when it needs to be set just move over set it and move back. Can all the variables be in the 2nd bank also? I need more examples or this one explained at a THIRD Graders level so the light in my head will come on.
Any help Please.
1) Start from 1st bank
2) Move DS1302 Demo Code to 2nd bank(I think this is a separate file) and the first has both
3) jump to that bank and prg. the DS1302 Chip
4) return to 1st bank
5) is there an additional 26 var.
I have both BS2 and BS2e
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I HAVE LEARN SO MUCH...BUT STILL KNOW SO LITTLE!!!
hmlittle59
Comments
Remember that, when control is transferred back to slot #0, it's with a RUN statement which starts the "main program" over from the beginning, but without clearing the variables. The "main program" remembers where it came from by checking a shared variable for a non-zero value (starting the program with a reset or power on clears all the variables to zero).
Post Edited (Mike Green) : 11/10/2008 6:21:49 AM GMT
From bank 0 then....(RUN 1) will switch me to the other bank were my clock setting routine resides. Then starting from the top clear/set all variables and execute the DS1302 Demo code from that same bank. then return to bank 0(RUN 0) with var. intack. You said the "main program" remembers where it came from by chk a shared variable. What is a "shared variable", where is it? Do I bother with it at all? You said the "main program" starts over from the "TOP" without changing any variables correct? (not like a GOSUB).
thanks Mike
hope this makes sense, its 1:20 am here in TEXAS, after this question, bed time
thanks again
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I HAVE LEARN SO MUCH...BUT STILL KNOW SO LITTLE!!!
hmlittle59
If I have 2 routines that need(use) the same "SUB-Routine" in Bank 0 and then move one(1) of those routines to the next Bank 1, can I move an "EXACT" copy of that "SUB-Routine" to Bank 1 with out any clash of any kind?
Hope this is clear.
thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I HAVE LEARN SO MUCH...BUT STILL KNOW SO LITTLE!!!
hmlittle59
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· -- Carl, nn5i
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I HAVE LEARN SO MUCH...BUT STILL KNOW SO LITTLE!!!
hmlittle59
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· -- Carl, nn5i