155
TIDE and Tibbo BASIC User Manual
©2000-2008 Tibbo Technology Inc.
You have to explicitly configure I/O lines as inputs or outputs
On the EM1202(W) 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
inputs or outputs
On the EM1202(W), it is necessary to configure the lines of the
as
inputs our outputs. Depending on the mode of the serial port (see
)
you need to set the following:
365
370
224
261
249
151
224
255