Serial Port and General-Purpose I/O Lines*
#16 |
TX |
Output |
Serial transmit line |
#15 |
RX |
Input |
Serial receive line |
#18 |
P5 (RTS/DIR) |
Input/output (output) |
General-purpose input/output line Request to send output (full-duplex mode) Data direction control output (half-duplex mode) |
#17 |
P4 (CTS/SEL) |
Input/output (input) |
General-purpose input/output line Clear to send input Full-/half-duplex selection input |
#20 |
P3 (DTR) |
Input/output (output) |
General-purpose input/output line Data terminal ready output |
#19 |
P2 (DSR) |
Input (input) |
General-purpose input line Data set ready input |
#13 |
P1 |
Input/output |
General-purpose I/O line |
#12 |
P0 |
Input/output |
General-purpose I/O line |
Line functions defined by the application firmware are shown in blue
The EM100 features a serial port (RX, TX lines) and several general-purpose I/O lines (P0-P5). All of the above lines are of CMOS type. From the hardware point of view, all general-purpose I/O lines except P2 can serve as inputs or outputs. Line P2 can only work as an input. Maximum load current for each I/O line is 10mA.
Simplified structure of EM100's I/O lines is shown on the circuit diagram below. All lines are "quasi-bidirectional" and can be viewed as open collector outputs with weak pull-up resistor. There is no explicit direction control. To "measure" an external signal applied to a pin the OUT line must first be set to HIGH. It is OK to drive the pin LOW externally when the pin outputs HIGH internally.
The application firmware of the EM100 maps certain serial port functions onto the general-purpose I/O pins- these functions are shown in blue in the table at the top of this topic. For example, P5 is a universal input/output but the application firmware can be set to turn this line into the RTS output of the serial port. Therefore, depending on your application you can view P5 as a general-purpose I/O line or specific control line of the serial port (RTS).
Being of CMOS type, the serial port and I/O lines of the EM100 can be connected directly to the serial port pins and I/O lines of most microcontrollers, microprocessors, etc. An interface IC* must be added to the EM100 externally if you want to connect the module to a "true" serial port (for example, COM port of the PC).
Logical signals on the serial port lines of the EM100 are active LOW. TX and RX lines are high when idle, start bit is LOW, stop bit is HIGH; LOW on CTS and RTS lines means "transmission allowed" and HIGH means "transmission not allowed". This is standard for CMOS-level serial ports and is exactly opposite to the signalling on the RS232 cables. Logical signals on the EM100 are inverted because standard interface ICs* invert the signals internally too.
As explained earlier, actual functionality of the I/O lines is firmware-dependent. See serial port and serial communications for details.
* Such as MAX232 for RS232, MAX485 for RS485, etc.