Debug Screen
Newzed
Posts: 2,503
I have a program that writes to an EEPROM.· Immediately before I write to EEPROM, the program goes to another bank to get the time so I can time-stamp each packet that is written to EEPROM.· This works fine with one exception -· each time the program returns with the time, the debug screen is cleared and I can only see the last packet entered.· Is there any way to avoid this "automatic" CLSing of the debug screen?
Here is the portion of the code in question:
main:
com = 2················ 'go get time - returns to cont1
RUN 2
cont1:
HIGH grn
PAUSE 200
v1 = v1 + 1
v2 = v2 + 1
Thanks
Sid
Here is the portion of the code in question:
main:
com = 2················ 'go get time - returns to cont1
RUN 2
cont1:
HIGH grn
PAUSE 200
v1 = v1 + 1
v2 = v2 + 1
Thanks
Sid
Comments
· First of all I think you are going to need more of the code to see what's going on.· There's no DEBUG statement in the sample you provided to see where that is even happening...
·· Second...Your code is not going to work as listed.· When you use RUN in a program, it does not return to the statement following the RUN command.· You get back to that bank via a RUN from the target bank, and that starts program execution at the beginning.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--==<{Chris}>==--
init:
HIGH cs
HIGH reset
IF com = 1 THEN start
IF com = 2 THEN atdata
IF com = 3 THEN cont3
I wrote later in the program:
com = 2················ 'go get time - returns to cont1
RUN 2
The program jumps to bank 2 and bank 2 says:
IF com = 1 THEN set1
IF com = 2 THEN readit1
IF com = 3 THEN timeit
and then readit1 says:
GOSUB getclk
com = 3
RUN 0
whcih takes me directly to cont1 to continue the program.
About the debug statements - I didn't feel they were necessary.· If I disable the "go get time" statements, all packets appear on the screen like always.· Only when the "go get time" statements is active does the screen CLS each time it displays a new packet.
Sid
· Flags, huh?· Clever...Still the DEBUG statement is apparently what's causing your problem, so seeing the DEBUG statements themselves would seem to be the logical place to look.· The only thing I can think of without seeing them is that some value you are sending to the DEBUG screen isn't what you expect it to be, and the value is say an ASCII 12, which would clear the screen.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--==<{Chris}>==--
Sid
GOSUB getclk
Now everything works fine.· I would still like an answer to the CLSing problem if anybody has one.
Sid
IF com = 1 THEN set1
IF com = 2 THEN readit1
IF com = 3 THEN timeit
to:
BRANCH (com - 1), [noparse][[/noparse]Set1, ReadIt1, TimeIt]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
Here are the first few statements in your clock slot:
Could your mysterious clearing of the screen have anything to do with the DEBUG CLS statement on line 4?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--==<{Chris}>==--
·· As long as I already looked at that one segment of code, I will point out one more thing, although it's probably insignificant.
In this segment of code you are getting input from the DEBUGIN statement.· There is no trap for characters other than those you are testing for.· If the user inputs, for example, J, the set1 routine will still be executed.
In fact, you could just test for the "R" or "r" and anything else would execute the set1 routine, saving you a few bytes testing for the "S" or "s".· Just an observation.· I noticed it while looking for the rogue CLS statement...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--==<{Chris}>==--
Removed it and now everything works great.
Chris, I'll add the trap in the clock slot.· This was the first pass at the new program so I have a bit of tidying up to do.
Jon, on the BRANCH statement, I had that in at one time, then deleted it because one of the COM statements was deleted and the sequence was
1-3-4.· Will the BRANCH statement still work or will BRANCH be looking for
COM = 2.
Thanks to all - this somewhat ambitious project is about ready to fly.
Sid
LOOKDOWN com, [noparse][[/noparse]1, 3, 4], com
BRANCH com, [noparse][[/noparse]Set1, ReadIt1, TimeIt]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA