III. ENABLING AND ADDRESSING PORTS
Setting the address
Each serial port on the
Switch SW1 selects address lines A10 through A3 for Serial 1. Switch SW2 serves the same purpose with respect to Serial 2. The remaining address lines (A2, A1 and A0) are used by the UART to select the register being accessed. Address lines A11 through A15 must be at logic 0 for a port to be selected. The serial ports may be independently enabled or disabled by installing or removing a jumper from jumper pack J4.
Figure 3 shows how the switches on the DS-102 represent the address values for serial ports. This figure can be used to explain the examples shown in Figure 4.
A serial port's address is a
in four hexadecimal (base 16) digits. A hex digit can hold a value from 0 to 15 (decimal), and is made up of four binary bits given weights of eight, four, two, and one, hence the maximum value of 8+4+2+1 = 15.
A common serial port address is 03F8 hex. The example below shows how the hex digits are broken down into binary bits.
Binary bits | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 |
Bit weight | 8 | 4 | 2 | 1 | 8 | 4 | 2 | 1 | 8 | 4 | 2 | 1 | 8 | 4 | 2 | 1 |
Sum of bits | 0+0+0+0 | 0+0+2+1 | 8+4+2+1 | 8+0+0+0 | ||||||||||||
Hex digits |
| 0 |
|
|
|
| 3 |
|
| F |
|
|
| 8 |
|
|
These address bits are set by the switches.
All other bits are considered to be zero.
0 0 0 0 | 0 0 1 1 | 1 1 1 1 | 1 0 0 0 |
|
|
|
|
|
|
|
|
Figure 3 --- Examination of a serial port base address
4 | Quatech |