download and debug speeds

Questions and discussion about the ZBasic IDE.
Post Reply
FFMan
Posts: 502
Joined: 09 January 2010, 12:52 PM

download and debug speeds

Post by FFMan »

in an attempt to debug some time critical code, i think the time taken to output to the debug port is affecting my code.

is there a way of making the port run quicker when using to display debug messages ? if i put the serial port speed up, my downlaod works ok, but then debug seems to revert to 19200

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

Re: download and debug speeds

Post by dkinzer »

FFMan wrote:i think the time taken to output to the debug port is affecting my code.
That is one of the challenges of debugging. Often, the instrumentation used to observe the application affects its operation.

To debug time-critical code, you may need to adopt other strategies. For example, you could log data during a run and then later output it. It may also help to greatly reduce the volume of debug output and/or increase the output queue size for Com1.
FFMan wrote:if i put the serial port speed up, my downlaod works ok, but then debug seems to revert to 19200
How are you changing the serial port speed? Changing the baud rate in the IDE's "Serial Port Options..." dialog only affects the speed of the IDE com port - it doesn't change anything on the ZX itself which will still be running at the default 19.2K speed. If you want the ZX Com1 to run at a different speed the easiest way to accomplish that is to use the "Option Com1Speed" directive in your main module. For example:

Code: Select all

Option Com1Speed 115200[/quote]This directive is only supported for native mode devices.  For VM mode devices you must add code to close Com1 and re-open it at the desired speed.  Of course, with this method the initial sign on is still done at the default speed.  It is probably best to turn off the sign on in this case - something that is not necessary when using Option Com1Speed.
- Don Kinzer
FFMan
Posts: 502
Joined: 09 January 2010, 12:52 PM

Post by FFMan »

thanks don.

i did for a while store the debug data in tables, then write to persistent memory at the end of the run and then download at home, but i ran out of memory, hence the order for the zx24s - which i do hope will not get returned to you again ! its not arrived here yet.

i'm also waiting on an SD card based i2c filing system from byvac as this may help also, and has the bonus of created a FAT filing system so I can just unplug and read direct on the PC.

in the meantime i have reduced the debug output and i'll up the speed as you suggest and i think it will be ok for the time being.
Post Reply