Com1 even parity and Tx 115 k,problem

Discussion about the ZBasic language including the System Library. If you're not sure where to post your message, do it here. However, do not make test posts here; that's the purpose of the Sandbox.
Post Reply
marcelo_bahia
Posts: 4
Joined: 15 May 2009, 10:44 AM
Location: argentine

Com1 even parity and Tx 115 k,problem

Post by marcelo_bahia »

1)I have problem to tx Z24p, using Com1 to Hyperterminal PC, in the following format with eight bits of data, even bit parity and 2 stop bits 8-E-2
when you put even parity error and is not tx to PC, if I do not use even parity works ok , you can help me.Thank you

' initialize the queue
Call OpenQueue(oq)

' define the characteristics of the serial channel 1,8bit data,even parity par,2 bit stop &H38
Call DefineCom(1, 0, 0, &H38,2)

' open the serial channel
Call OpenCom(1, 19200, 0, oq)

2)another query, I must Tx to 115k, when using 115 k, also fails.
Attachments
Com1_8E2.bas
(748 Bytes) Downloaded 2403 times
mikep
Posts: 796
Joined: 24 September 2005, 15:54 PM

Post by mikep »

COM1 is explicitly opened by ZBasic as part of its startup procedures so that when you call Debug.Print, the output has somewhere to go. It is ok to reconfigure COM1 to a different setting but you must first call CloseCom(). That should fix your problem but there are also some other considerations to what you are trying to do.

The ZX24p has a second serial port (COM2) on pins 11 and 6 (TX, RX). Perhaps you are already using these I/O pins. If not then it might make sense to use this COM port instead and leave COM1 for debug print messages.

COM1 (pins 1 and 2) is also used for downloading ZBasic programs so you may need to disconnect external circuitry so that it doesn't interfere with downloading a new program. Also COM1 is setup to receive RS232 (inverted) signals. If you are trying to connect to a logic level (TTL) device on COM1, that may not work for you and again COM2 may be a better choice. Worst case you can use a software-based serial port that has a maximum speed of 19,200 BAUD.

One final comment is that the 40-pin versions of these devices (e.g. Oak Micros ZX-24pe) allows you to use COM1 as a logic level serial port as well as a RS232 or download serial port by using a DPDT switch. The COM1 logic levels are available on pins 19 and 20 of the device.
Mike Perks
Post Reply