From FPGA-Synth Wiki

FPGASynth: IntelFlashProgramming

Author: Paul Maddox

One of the things I liked most about this board was the fact that it hard a large (16Mbyte) flash memory on board, perfect for storing waveforms and samples!

But, how do you get your own data in the flash?

Those nice people at Xilinx have given us a 'quick' soloution in the Spartan-3E design examples page, its the fifth one down called PicoBlaze SPI Flash Programmer for the Spartan-3E Starter Kit Board This solution uses the PicoBlaze core and Serial port on board the FPGASynth.Spartan3EStarterKit

If you're only interested in programming the data in the Flash, thendo the following

  1. Download the zip file and extract it.
  2. Open Hyper Terminal and set it up according ot page 5 of the instructions.
  3. Run the install_parallel_flash_memory_uart_programmer.bat file.

Xilinx kindly give us a file ready to load, it's a frequency counter (nice chaps aren't they?). But for me what I was really interested in, was getting my own data into the FLASH..

Now, here lies a problem, the .MCS file is an 'intel hex format', this means it's not just a case of sending it a binary file (like an eprom image). You need to format it in the correct way, else the Flash Programmer puts the wrong data in all the wrong places in flash and won't ever 'exit'.

So, what is the correct file format?

Ok, the file is a 'text' file, so have 'notepad' handy. first things first, let's start with the first line, which tells the programmer about the file, I'm not going to go into the full 'blurb' as to why, but this will get you going ;-


next you need to send the data, it needs to be arranged in this format ;-


Lets eplain this line of seemingly random characters

Having played with getting some data into the Flash for about 2 hours, I can confirm that the Xilinx example code ignores the checksum, so just put any value here (I used 'FF').

Finally at the end of the file you must have this line ;-


This is the 'End of file', when the picoblaze sees this it'll stop writing to the Flash.

Points to note:

Finally, I've uploaded a file, which contains three 8 bit waveforms stored as 256byte full cycle waves.

Here it is - SAW_SQUARE_SINE.mcs

This should give you a start to putting your own wavedata into flash.. All that's left to do, is get the oscillator to read from flash, I'll post a soloution once I have it working.

For full details on the Intel Hex File Format, visit this page at

Retrieved from
Page last modified on July 09, 2006, at 09:48 AM