I have a ZX24p that I've been playing around with on a Parallax USB Board of Education. I've managed to get an RCtime circuit working and printing out to the debug window in the ZBasic IDE. The only issue is, after (hundreds?) of lines it seems to stop displaying. The red comm LED goes dark, but I'm not sure if it's a hardware issue or an issue with the debug in the IDE. There's nothing in my code that would suggest it to stop, I have the RCTime call in an infinite do loop.
do
Call PutPin(pin, 1) ' make the pin an output high to start charging
Call Delay(1.4e-4) ' delay a bit to allow nearly full charging
i = RCTime(pin, 1)
debug.print(cstr(i))
Call Delay(0.05)
loop
During searching of the forums I found a post about a debug line limit, would that have anything to do with this?
lwcyb wrote:During searching of the forums I found a post about a debug line limit, would that have anything to do with this?
I don't think so but you can try changing it and observing the effect. The purpose of debug.line.limit is to limit the number of lines of output that are kept in the Debug window. Once the limit has been reached, earlier output lines are deleted as new output lines are generated.
Changing the line limit does not seem to prevent the issue from occurring but it does seem to delay it. A longer delay seems to do the same thing. Any other ideas?
Const pin as Byte = 15
dim i as integer = 0
Sub Main()
do
Call PutPin(pin, 1) ' make the pin an output high to start charging
Call Delay(1.4e-4) ' delay a bit to allow nearly full charging
i = RCTime(pin, 1)
debug.print(cstr(i))
Call Delay(0.05)
loop
end sub
It appears that the issue is related to the use of RCTime(). If that call is commented out the problem does not present. We'll have to look into it further to see what is going on.
Thanks for posting the compilable test case. That makes it much more likely that we are on the same page.
lwcyb wrote:I'll be looking forward to what you find.
The issue was, in fact, related to the use of RCTime(). It turns out that there has been a stack imbalance in the calling sequence. The problem has been fixed and an experimental version is available for you to try.