5. Addressing Ports
5.1 Setting the address
The base address of each port of the
A full sixteen bit address decode is implemented to reduce the chance of address conflicts with other adapters in the system. Each serial port on the
Switches SW1 and SW2 select address lines A15 through A3 for Serial 0 and switches SW3 and SW4 select address lines A15 through A3 for Serial 1. The remaining address lines (A2, A1 and A0) are used by the UART to select the register being accessed. The sixth position on SW2 is used to enable or disable Serial 0 and the sixth position on SW4 is used to enable or disable Serial 1.
Figure 5 shows how the switches on the DS-100 represent the address values for serial ports. This figure can be used to explain the examples shown in Figure 6.
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 possible serial port address is 5220 hex. The example below shows how the hex digits are broken down into binary bits.
Binary bits | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 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+4+0+1 | 0+0+2+0 | 0+0+2+0 | 0+0+0+0 | ||||||||||||
Hex digits |
|
| 5 |
|
|
| 2 |
|
|
| 2 |
|
|
| 0 |
|
These address bits are set by the switches.
All other bits are considered to be zero.
0 1 0 1 | 0 0 1 0 | 0 0 1 0 | 0 0 0 0 |
Figure 5 --- Examination of a serial port base address
Quatech Inc. |