Changing The IDE's Serial Port Settings

Questions and discussion about the ZBasic IDE.
Post Reply
Don_Kirby
Posts: 341
Joined: 15 October 2006, 3:48 AM
Location: Long Island, New York

Changing The IDE's Serial Port Settings

Post by Don_Kirby »

Is there any way to modify any of the serial port settings that the IDE uses to communicate with an attached device besides the Baud rate?

With our new-ish ability to download without a DTR signal, the IDE needs to transmit the ATN character. THe problem arises when the device is configured to use settings other than the standard XXX, 8, N, 1. If the device is configured to something else (i.e. XXX, 8, E, 1), it doesn't recognize the ATN Character being sent.

Would it be possible to add a few more options to the Serial Port Options screen, or is all of this handled in the ZLoad code?

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

Re: Changing The IDE's Serial Port Settings

Post by dkinzer »

Don_Kirby wrote:Would it be possible to add a few more options to the Serial Port Options screen, or is all of this handled in the ZLoad code?
The IDE uses code similar to that used by ZLoad but it isn't identical. For one thing, the IDE's code is written in C++ while the ZLoad code is standard C. For another, the IDE code must contend with Windows GUI issues while ZLoad is simpler because it is a console application.

That said, the "serial open" code in the IDE probably could be modified to support additional serial configuration choices. I'd have to review the code to determine the effort it would take.

The other option would be to modify the ZLoad source code (copied to your disk during installation) and build you own customized loader.
- Don Kinzer
Don_Kirby
Posts: 341
Joined: 15 October 2006, 3:48 AM
Location: Long Island, New York

Post by Don_Kirby »

Is this the correct bit of code?

Code: Select all

sprintf(commSpec, "COM%u:%u,N,8,1", port, ZX_STD_SPEED);
Seems like it shouldn't be too much trouble to change ZLoad to accept the other parameters.


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

Post by dkinzer »

Don_Kirby wrote:Is this the correct bit of code?
Yes, that's it.

I took a quick look at the IDE code and concluded that it will be fairly simple to implement a way to override the default configuration by adding a line to the User.Properties file something like this:

Code: Select all

port.config.2=E,8,1
This would set the configuration for Com2 to E,8,1. In the absence of such a configuration line, the default N,8,1 configuration would be used.
- Don Kinzer
Post Reply