Serial I/O

Started by deltapparo December 12, 2005
"300 to 19,200 baud on any I/O pin using Com3"

Does this mean I can use Com3 on any I/O pin - Once ?

Can I use two I/O pins for serial I/O (TTL 5V), one to send to one
device and another to receive to another device?



--- In basicx@basi..., "deltapparo" <DelTapparo@c...> wrote:
> "300 to 19,200 baud on any I/O pin using Com3"
> Does this mean I can use Com3 on any I/O pin - Once ?

You have to define which pins are going to be used for Com3. This
is done using DefineCom3(). Then you need to call OpenCom(),
providing it with the I/O queues to use.

I'm not sure what you mean by "Once". Only one set of pins can be
actively used for Com3 at a time. However, you can call CloseCom()
and redefine the Com3 pins, call OpenCom() again, etc. This topic
has been discussed several times on this forum, including the
pitfalls. You should be able to find the threads by searching for
DefineCom3 or OpenCom.

> Can I use two I/O pins for serial I/O (TTL 5V), one to send to one
> device and another to receive to another device?

There is no requirement that the Com3 output and Com3 input be
attached to the same device. If you have a "send only" device and
a "receive only" device you should be able to connect them in the
way that you describe.

Related to this query, the ZX-24 can have up to three software-
driven serial ports: Com3, Com4, and Com5. For both the BX-24 and
the ZX-24 you should always use the lowest baud possible on the
software-driven serial ports. This is because the overhead imposed
on the processor is higher as the baud goes up, leaving less time
for other processing. This caveat does not apply, of course, to
Com1.

Don
ZBasic Microcontrollers
http://www.zbasic.net