Datasheet

Table Of Contents
SPI and Microwire Master Communications
© 2009 Microchip Technology Inc. DS51647C-page 57
FIGURE 7-4: SPI BASIC OPERATIONS
7.6.1 Basic Communications – Serial EEPROM Example
Figures 7-5 through 7-7 demonstrate how to communicate with a 25LC020A SPI serial
EEPROM. Refer to the 25LC020A Data Sheet (DS21833) for a detailed explanation of
its SPI communications.
Before data can be written to the 25LC020A, the write enable (WREN) latch must be
set. This requires that CS
be enabled, command 0x06 transmitted, and CS disabled.
Figure 7-5 shows only Group 0 enabled. All other groups are disabled. Clicking on the
Execute button will transmit only the WREN command. The command will be logged
in the Transactions window.
FIGURE 7-5: SEEPROM EXAMPLE – WREN COMMAND
Once the WREN latch has been enabled, data can be written to the 25LC020A.
Figure 7-6 shows that Group 0 has been disabled, and Group 1 enabled. Clicking on
the Execute button will send the Write command (0x02), the memory address (0x00),
followed by three bytes of data: 0xAA, 0xBB and 0xCC. The command will be logged
in the Transactions window.