Debug issue?

Questions and discussion about the ZBasic IDE.
Post Reply
lwcyb
Posts: 11
Joined: 11 September 2013, 7:12 AM

Debug issue?

Post by lwcyb »

Hello,

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.

Here's what I have:

Code: Select all

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?
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: Debug issue?

Post by dkinzer »

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.
- Don Kinzer
lwcyb
Posts: 11
Joined: 11 September 2013, 7:12 AM

Post by lwcyb »

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?
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

lwcyb wrote:Any other ideas?
I'll attempt to reproduce the issue here. What version of the IDE are you using? (Hint: in the IDE, select the "About ZBasic IDE" from the Help menu.)

Just so we're on the same page, please post a complete compilable program that exhibits the problem.
- Don Kinzer
lwcyb
Posts: 11
Joined: 11 September 2013, 7:12 AM

Post by lwcyb »

Zbasic IDE: v1.6.6
Compiler version: v4.1.7

Code: Select all

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 
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

lwcyb wrote:Any other ideas?
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.
- Don Kinzer
lwcyb
Posts: 11
Joined: 11 September 2013, 7:12 AM

Post by lwcyb »

No problem, thanks very much for the help, and I'll be looking forward to what you find.

Lee W
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

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.

ZX24p v3.0.6 ZVM.
- Don Kinzer
Post Reply