Introduction
Programming and reading SPI memory devices is a common use case for the Aardvark Adapter. There are several ways to do this with the Aardvark adapter, including using Control Center, Flash Center, or the Aardvark API. This article focuses on how to take the information in a flash datasheet and execute the Read Devide ID command in Control Center. Although the following describes the SPI Flash M25P32 found on the SPI Flash Demo Board, similar steps can be used for other devices.
Overview
In this article the Aardvark adapter reads the Device ID from the memory. Here the Aardvark adapter is the SPI master and the SPI flash on the demo board is the SPI slave. The article uses an M25P32 instruction, which is described below.
Figure 1: M25P32 Instructions List
The M25P32 Read Identification instruction (0x9f) allows the identification data to be read. This instruction includes the instruction opcode. Then the identification data is shifted out. The M25P32 Read Identification Data Out Sequence is 20 20 16 h.
Figure 2: M25P32 Read Identification Instruction
Figure 3: M25P32 Read Identification Data Out Sequence
Memory Read Device ID Guidelines
- Download and run the latest version of the Total Phase USB Drivers Installer.
- Download and unzip the latest version of Control Center. (?)
- Connect the Aardvark adapter to the PC via the USB connector.
- Connect the Aardvark adapter to the SPI flash demo board via the I2C/SPI connector. (?)
- Launch Control Center. (?)
- Connect the Aardvark adapter to Control Center. (?)
- Click Configure Aardvark adapter.
- Select the Aardvark adapter.
- Click OK to connect to the adapter.
- Configure the Ploarity to Rising/Falling, Phase to Sample/Setup, Bitrate to 1MHz, Bit Order to MSB, and SS Polarity to SS Active Low. (?)
- Click Aardvark, and enable Target Power. (?)
- Read memory Device ID.
- Enter 9F 00 00 00 in the MOSI Message > Click Send. (The 3 extra 00 bytes are required to clock in the 3-byte Device ID from the memory on the MISO line.)
- The memory responds with Device ID 20 20 16.
Figure 4: Aardvark Adapter Reads M25P32 Device ID
Notes
For additional information, take a look at the Aardvark adapter user manual, Control Center manual and High Speed SPI Flash Demo Board User Manual.