Skip to main content

Posts

Showing posts from May, 2014

Interfacing M45PE16 SPI Flash to ATMEGA32

       As many people need some sort of storage in their embedded project, they prefer to use SPI flash. Hence I decided to try this interfacing with ATMEGA32 microcontroller. This SPI flash is 16Mb flash, works on SPI interface. You can reuse below code if you want to integrate this flash to your project. I tested this code using proteus simulation, you can also test and comment. Features of M45PE16- 16Mb of page-erasable Flash memory Page size: 256 bytes Sector erase: 512Kb 75 MHz clock frequency (MAX) In current interfacing I only did Page Write/ Read API's. The SPI needs to configure in Mode 0, and Master at Microcontroller side as given in code below. The result or Page read bytes are displayed over terminal using UART. Code- M45PE16.c /*  *  *  *  Created on: Apr 18, 2014  *      Author: Shrenik Shikhare  *      File: M45PE16.c  *      Discription: Interfacing M45PE16 SPI Flash to ATMEGA32  *      Copyrights(C)-April 2014  */ //#define F_CPU 10000