Having trouble with... Debug.print?

Discussion specific to the DIP and TQFP packaged ZX devices like the ZX-40, ZX-44, ZX-32 and ZX-328 series. The differences between these devices is primarily the packaging and pinout so most issues will apply to all devices.
Post Reply
drapal
Posts: 25
Joined: 24 January 2006, 8:07 AM
Location: Denver

Having trouble with... Debug.print?

Post by drapal »

OK, it's been a long time. I have some ZX-40's that I'm trying to re-purpose. Got the dev board going again, and tried a simple program (alternate flash 2 led's) and it worked fine. Then I made a suttle change and all hell broke loose...

BTW, the ZX-40 in question is running the latest VM (2.6.3) from the web site.

Here is the code that works fine:

Code: Select all

Sub Main()
Do While True
Call PutPin(C.0,1):Call PutPin(C.1,1):Call Sleep(0.5)
Call PutPin(C.0,0):Call PutPin(C.1,1):Call Sleep(0.5)
Call PutPin(C.0,1):Call PutPin(C.1,0):Call Sleep(0.5)
Call PutPin(C.0,0):Call PutPin(C.1,0):Call Sleep(0.5)
Loop
End Sub
When I make one change:

Code: Select all

Sub Main()
Do While True
Call PutPin(C.0,1):Call PutPin(C.1,1):Call Sleep(0.5):debug.print "1"
Call PutPin(C.0,0):Call PutPin(C.1,1):Call Sleep(0.5)
Call PutPin(C.0,1):Call PutPin(C.1,0):Call Sleep(0.5)
Call PutPin(C.0,0):Call PutPin(C.1,0):Call Sleep(0.5)
Loop
End Sub
The ZX-40 crashes the second time through the loop. Total garbage in the debug window of the IDE and the LEDs don't flash anymore. I even went more basic (no pun intended):

Code: Select all

Sub Main()
Do While True
	debug.print "1"
	debug.print "2"
	debug.print "3"
Loop
End Sub
Debug window says 1 3 "crash".

I know I'm going to feel really dumb when I get the answer here. :o
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: Having trouble with... Debug.print?

Post by dkinzer »

drapal wrote:Got the dev board going again, and tried a simple program
Which development board are you using?
- Don Kinzer
drapal
Posts: 25
Joined: 24 January 2006, 8:07 AM
Location: Denver

Post by drapal »

I'm using the NetMedia development board.

Another question: Does the speed of the debug port matter for this (e.g. is it possible that I'm over-running the queue of the debug port? I am using the standard speed (19200).
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

drapal wrote:I'm using the NetMedia development board.
I thought that might be the case. Does it have the A version of the AT25256? If not, that could be the problem since the non-A version is too slow for the ZX-40.
drapal wrote:Does the speed of the debug port matter for this (e.g. is it possible that I'm over-running the queue of the debug port?
You can't overrun the queue. Debug.Print puts the string content in the output queue character-by-character, waiting for space to be available before proceeding.
- Don Kinzer
drapal
Posts: 25
Joined: 24 January 2006, 8:07 AM
Location: Denver

Post by drapal »

I'll have to check on the A part or not, though I think it is - in fact, I remember that it is a new part (from my parts bin :) ), so I'm sure it is an A part.

Another test I tried: Debug.Print => Console.WriteLine. Same results :cry:
drapal
Posts: 25
Joined: 24 January 2006, 8:07 AM
Location: Denver

Post by drapal »

OK, so I predicted I'd feel stupid... A non-A part from the parts drawer (into the trashcan now, of course). 8)
Post Reply