171
TIDE and Tibbo BASIC User Manual
©2000-2008 Tibbo Technology Inc.
8.1.5.4
Platform-dependent Programming Information
This section contains miscellaneous information pertaining to the DS1202 platform.
Various objects described in the
direct you to this topic in all
cases when object capabilities or behavior depends on the platform and, hence,
cannot be described in the object reference itself. Each platform section in this
manual has its own "Platform-dependent Programming Information" topic. If you
are reading documentation top-to-bottom (we have never actually met anyone
who does) you can skip this section now.
You have to explicitly configure I/O lines as inputs or outputs
On the DS1202 platform you need to explicitly enable or disable the output driver
of each I/O line (controlled by the
property allows
you to do this. When the driver is enabled (ser.enabled= 1-YES) and you read the
state of the pin you will get back the state of your own output buffer. To turn the
line into an input switch the output buffer off (ser.enabled= 0- NO). This will allow
you to sense the state of the external signal applied to the I/O line:
...
io.num=
PL_IO_NUM_4
'just to select some line as an example
io.enabled= NO
'now the output driver is off
x=io.state
'read line state into x
...
When the device boots up all pins are configured as inputs. If you want to use any
particular I/O pin as an output you need to enable the output driver first:
...
io.num=
PL_IO_NUM_5
'select the line
io.enabled= YES
'enable output driver (you need to do this only
once)
io.state= LOW
'set the state
...
Make sure that your external circuitry does not attempt to drive the I/O
lines that have their output buffers enabled. Severe damage to the
device and/or your circuitry may occur if this happens!
You can remap RTS/W0out/cout and CTS/W0&1in/cin lines of the serial
port
Two lines of the
-- RTS/W0out/cout output, and CTS/W0&1in/
cin input -- can be reassigned (remapped) to other I/O pins of the device. This is
done through
and
properties.
By default, the mapping of these two lines is different for each serial port. See
for details.
Positions of TX/W1out/dout output and RX/W1in/din input are fixed and
cannot be changed.
You have to explicitly configure certain I/O lines of the serial port as
212
365
370
224
261
249
142