Design Ideas: February 15, 1996
Adapting off-the-shelf, general-purpose single-board computers for real-time and other special-purpose applications can require additional peripheral chips. Most of the Intel-compatible ICs have a multiplexed address/data bus, and thus you can't readily interface these ICs with a single-board computer's general-purpose I/O bus. Chips with demultiplexed address and data consume almost double the number of I/O lines. Some single-board computers provide demultiplexed address/data buses for the addition of peripheral interface cards which, again, you can't readily interface with multiplexed-bus chips.
However, software can help the I/O bus to emulate the multiplexed address/data bus. The design in Figure 1 adds the DS1287 RTC IC to an 8086-based single-board computer for providing real-time support. The design fits on a tiny daughterboard, which you can hook to the onboard, general-purpose I/O connector. In the circuit, the multiplexed address/data bus of the DS1287 connects to the onboard I/O bus. The I/O bus emulates the multiplexed bus by acting as an input bus during data reading and an output bus during address latching and data write. The software achieves this bidirectional emulation by programming the onboard 8255 control port to configure the address/data port as input during reading and output during writing. Listing 1 consists of the C driver routines.
Port A of the 8255 serves as the emulated address/data bus. Three lines from port C emulate the three control signals, ALE, WR, and RD; two inverters in the read and write lines make these signals active high, and hence deactivate these signals whenever 8255 resets. A 2-Hz square wave at the square-wave pin of DS1287, which serves as the heartbeat of the RTC daughterboard, toggles the LED every half-second. Sixty-four RAM locations inside the DS1287 provide nonvolatile storage.
The read and write operations are somewhat slower compared to the onboard chips. However, most of the peripheral applications don't demand high-speed access. Another application of this idea is to add an IC, such as the 8155, which would provide additional I/O, a timer/counter, and a scratch-pad memory. You can also interface nonvolatile RAMs and EEPROMs using this technique. (DI #1833)