Many devices require programming through a serial bus, such as I2C. The programming can be done during final test, after the circuit board has been assembled. In many cases, the pins used for programming can then be utilized for something else during normal operation. In fact, the bus itself can also be used for another function.
A simple analog multiplexer circuit facilitates this dual-function operation (see Figure 1). The multiplexer is a bidirectional analog switch (MAX4525). During normal operation, its input is pulled to ground by R1, causing the serial lines to connect to the rest of the circuit. During programming mode, the programming header asserts a logic high on the pin connected to the multiplexer input, causing the multiplexer to switch over to the pins on the programming header.
|Figure 1.||By using an analog switch to create a multiplexer circuit, two lines (SDA and SCL)
on the programmable device can serve a dual purpose. In programming mode,
they connect to the programming header, and for normal operation they connect
to other circuitry.
Because of the I2C bus, pullup resistors are provided for other circuitry on the board. The device programmer that connects to the programming header must have its own pullup resistors. The series resistance added by the multiplexer should be accounted for by other circuitry on the board. To avoid forward-biasing the electrostatic discharge diodes, the serial data lines should not go below ground or above the VCC voltage of the MAX4525.