Monday, 20 March 2017

programming - How do I write to SPI flash memory?



I'm working on an audio application where instead of storing audio data on an SD card (Waveshield on Arduino) I'm storing it on an SPI flash memory IC and rolling my own board with MCU, DAC, and amp.


I am using a Winbond W25Q80BVSSIG.


I'm pretty familiar with programming AVR using the AVRISP mkII or the USBTiny, is writing data to flash done with the same programmer? I haven't been able to find anything when looking for SPI flash memory programmers specifically.


This question is a follow up to this one.



Answer



If you are simply looking for a way to program the Winbond SPI flash with "pre-loaded" data that your microcontroller would read for use when it is running then what you will want to look into is a programmer that can do in-circuit programming of the SPI Flash chip. This also known as in-system-programming (ISP).


One choice is the programmer from DediProg. This USB connected device can program in circuit if you design your board correctly. They even sell an adapter clip that can attach into the SOW-16 package without having to design in a separate programming header on your board. DediProg has application information bulletins available to help with correct design for in circuit use. The main strategy for the design is to find a simple way to isolate the SPI interface drivers in your MCU system so that they do not interfere with the drivers in the SPI programming pod. The simplest way to do this is to put series resistors in the MCU driven lines between the MCU and the SPI Flash. The programmer would connect on the SPI flash side of the series resistors. Alternate methods could include adding a MUX or analog switches in the driven interface lines. An even more clever scheme is to add a "programming enable" input to the MCU that makes the software disconnect all the SPI I/Os from the SPI Flash chip (i.e. make all those GPIOs as inputs).


enter image description here


A second choice to also consider is the USB programer from ASIX. The Presto is able to do various types of SPI and I2C devices including SPI Flash devices. I have one of these devices specifically for programming Atmel MCUs and various types of SPI Flash devices. It is a more cost effective solution than the above unit but not quite as flexible. Their more expensive device called the Forte is able to do more things because it has more target interface pins.


enter image description here



Sometimes it can be beneficial to be able to connect a programmmer to a target board without having to add a programming header. One nice solution for this is to place a small set of pads in a special footprint defined by a company called TagConnect. They manufacture and sell a series of quick connect programming cables that have pogo pins that engage the special footprint on the board. There are 6-pin, 10-pin and 14-pin versions of the cable available to suit a range of applications. Cost of the cables are very reasonable.


enter image description here


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...