
13
Programmable Hardware Manual (PHM)
© Tibbo Technology Inc.
Many I/O lines of the EM2000 also serve as inputs or outputs of special function
modules, such as serial ports. Majority of those lines need to be correctly configured
as inputs or outputs — this won't happen automatically. Several lines — such as TX
and RX lines of the serial port when in the UART mode — are configured as outputs
and inputs automatically when the serial port (or some other hardware block) is
enabled. For details see "Platform-dependent Programming Information inside the
EM2000 platform documentation (TIDE, TiOS, Tibbo BASIC, and Tibbo C Manual).
Each I/O line has a weak pull-up resistor that prevents the line from floating when
the output buffer is tri-stated.
8-bit ports
Forty I/O lines are grouped into five 8-bit ports. To preserve compatibility with the
module, the grouping of I/O lines into ports is exactly the same as on the
EM2000. Unfortunately, this preservation of compatibility has turned the ports of
the EM2000 into "pseudo ports", meaning that GPIO lines of these ports actually
belong to several different physical ports of the onboard microcontroller. As a result,
port operations such as io.portset, io.portget, or io.portstate do not access port
pins in perfect unison. In port operations, writing or reading of some lines will
happen sooner than writing or reading of other lines. This "dissonance" is very small
and will not matter for most applications, but do keep in mind that it does exist.
Port mapping arrangement is different for different ports, so their performance varies
slightly as well. Ports P0 and P1 are about 10% slower than P2, P3, and P4. In most
cases this difference is negligible, especially considering that GPIO line and port
manipulation on the EM2000 is about 7 times faster compared to the EM1000.
I/O line control is described in detail in the documentation for the I/O (io.) object
found inside the TIDE, TiOS, Tibbo BASIC, and Tibbo C Manual.
4.1.1.2
Wireless Add-on Port, Wi-Fi Communications
The wireless add-on port of the EM2000 is a separate 10-pin connector (or pads on
the PCB). It is primarily intended for connecting our
port carries 5
. In the absence of the wireless module
these 5 lines may be used for other purposes.