Page 124 - Embedded Microprocessor Systems Real World Design
P. 124

SPuMicrowire in Multichip Designs


                  Chapter  2  described  the  SPI/Microwire  bus.  Many  microcontrollers  have  a
                  Microwire interface implemented in the hardware. In other cases, you can imple-
                  ment Microwire using port bits and generating the signals in software. Sometimes
                  you need to interface a Microwire device to a microprocessor that does not have a
                  built-in interface and for whatever reason you don’t want to use discrete I/O. Figure
                  3.4 illustrates a means to interface SPI/Microwire to any processor with the capa-
                  bility to access external memory.
                     The interface uses a tristate buffer and a “D” flip-flop. The Microwire SCLOCK
                  signal is connected to a decoded write strobe, and the enable input of the tristate
                  buffer is connected to a decoded read strobe (see Chapter 2).
                     The chip select signal comes from a port bit  or other digital output. Before
                  accessing the Microwire device, the chip select signal is driven low. The width of
                  the decoded write strobe must be sufficient to meet the SCLOCK low specification
                  of the Microwire peripheral.
                     The microprocessor writes data serially to the Microwire device. Each write to
                  the device address strobes the data on bit DO  into the device and clocks the con-




                                                                        D FLIP-FLOP TRISTATE BUFFER
                                                            SPI DEVICE           n
                    MICROPROCESSOR DO                    , DATA IN   DATA OUT
                         ‘CHIP SELECT                    -cs












                                               -  I            * -
                                   SCLK
                                                                     MICROPROCESSOR READS SECOND BIT
                                                                JICROPROCESSOR WRITES SECOND BIT
                                                           ICROPROCESSOR  READS FIRST BIT
                                                     ICROPROCESSOR WRITES FIRST BIT


                  Figure 3.4
                  Microwire Interface.



                  106                                             Embedded Microprocessor Systems
   119   120   121   122   123   124   125   126   127   128   129