General-Purpose I/O Lines
The EM1206 has 17 general-purpose I/O (GPIO) lines (GPIO0 ~ GPIO16). All lines are 3.3V, CMOS, and 5V-tolerant. The maximum load current for each line is 10mA. Out of 17 available lines, 16 are combined into two 8-bit ports.
The simplified structure of one I/O line of the EM1206 is shown in the circuit diagram below. Each line has an independent output buffer control. When the EM1206 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.
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 the io. object documentation.
Many I/O lines of the EM1206 have alternative functions and serve as inputs or outputs of special function modules: On the EM1206, the special function modules are four serial ports and the square wave generator. When any special function module is enabled, its I/O lines seize to work as inputs/outputs and are controlled by this special function module directly. Depending on the nature of an alternative function a given I/O line is to perform, your application may still have to manually configure this line for input or output. The table below details which special function module lines require manual configuration:
RX lines of serial ports |
Automatically configured as inputs when a corresponding serial port is enabled, revert to previous state when this port is disabled. |
TX lines of serial ports |
Automatically configured as outputs when a corresponding serial port is enabled, revert to previous state when this port is disabled. |
CTS lines of serial ports |
Must be configured as inputs by your application. Note that CTS lines can be "remapped". |
RTS lines of serial ports |
Must be configured as outputs by your application. Note that RTS lines can be "remapped". |
CO (square wave output) |
Automatically configured as output when the square wave is being generated, reverts to previous state when the square wave output stops. |