Design Ideas: December 7, 1995
The circuit in Figure 1 exploits Strobe B (R/W pin 28) of an M68HC811E2P microcontroller to clock eight 74HC273 latches and thereby expands the output of a single eight-pin port to the equivalent of a 64-pin port. The circuit uses Port B (pins 9 to 16), a dedicated output port in the µC, to take advantage of the Strobe B function.
The 74HC273 octal D-type flip-flops ensure that the 64 digital output lines will start in the off state. The latches' Clear lines, tied to the µC's Reset pin, ensure that if the µC resets, then the latches also reset. Port D (pins 42 to 44) of the µC controls a 74HC237 decoder to select which latch to write to. The assembly-language routine in Listing 1 provides a test for the expansion circuit.
The software simply goes through latches 1 through 8 and turns on each pin for 1 sec and then turns them off one at a time. The µC runs in single-chip mode and exploits the Strobe B pin, which is software-configured to give a logic-high pulse when write data arrives at Port B of the µC. The truth table (Table 1) determines which latch to write to. You'll find Listing 1 attached to EDN BBS /DI_SIG#1784. (DI #1784)
| TABLE 1--TRUTH TABLE FOR LATCH SELECTION | |||
| PD2 | PD1 | PD0 | function |
|---|---|---|---|
| 0 | 0 | 0 | Write to latch 1 |
| 0 | 0 | 1 | Write to latch 2 |
| 0 | 1 | 0 | Write to latch 3 |
| 0 | 1 | 1 | Write to latch 4 |
| 1 | 0 | 0 | Write to latch 5 |
| 1 | 0 | 1 | Write to latch 6 |
| 1 | 1 | 0 | Write to latch 7 |
| 1 | 1 | 1 | Write to latch 8 |