General-purpose I/O Lines
The EM1202 has 32 general-purpose I/O lines (GPIO0 - GPIO31). 24 of these lines are combined into three 8-bit ports. All lines are 3.3V, CMOS, 5V-tolerant. Maximum load current for each I/O line is 10mA.
Simplified structure of one I/O line of the EM1202 is shown on the circuit diagram below. Each line has an independent output buffer control. When the EM1202 powers up all I/O lines have their output buffers tri-stated (in other words, all I/O lines are configured as inputs). You need to explicitly enable the output buffer of a certain I/O line if you want this line to become an output.
Many I/O lines of the EM1202 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 EM1202 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.
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.