Intel Flash Programming

FPGASynth.IntelFlashProgramming History

Hide minor edits - Show changes to markup

July 09, 2006, at 09:48 AM by Paul Maddox -
Changed lines 24-25 from:

:020000040000FA

to:

:020000040000FA

Changed lines 28-29 from:

:10246200464C5549442050524F46494C4500464C33

to:

:10246200464C5549442050524F46494C4500464C33

Changed lines 44-45 from:

:00000001FF

to:

:00000001FF

July 09, 2006, at 09:47 AM by Paul Maddox -
Changed lines 59-60 from:

SAW_SQUARE_SINE.mcs

to:

Here it is - SAW_SQUARE_SINE.mcs

July 06, 2006, at 09:07 PM by PaulMaddox -
Changed lines 5-6 from:

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

to:

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

July 06, 2006, at 09:07 PM by PaulMaddox -
Added line 64:

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

July 06, 2006, at 09:04 PM by PaulMaddox -
Changed lines 50-51 from:
  • make sure that there are no trailing spaces at the end of the line (after the checksum) this confuses the hell out of the programming software, and you'll start seeing wierd addresses shooting up the screen as it's programming!
to:
  • Make sure that there are no trailing spaces at the end of the line (after the checksum) this confuses the hell out of the programming software, and you'll start seeing wierd addresses shooting up the screen as it's programming!
  • You can have 'Carriage Returns' between lines that start with a ':'
July 06, 2006, at 09:02 PM by PaulMaddox -
Changed lines 58-59 from:

http://www.fpga.synth.net/pmwiki/uploads/FPGASynth/SAW_SQUARE_SINE.mcs

to:

SAW_SQUARE_SINE.mcs

July 06, 2006, at 09:02 PM by PaulMaddox -
Changed lines 58-59 from:

http://www.fpga.synth.net/pmwiki/uploads/SAW_SQUARE_SINE.MCS

to:

http://www.fpga.synth.net/pmwiki/uploads/FPGASynth/SAW_SQUARE_SINE.mcs

July 06, 2006, at 09:01 PM by PaulMaddox -
Changed line 53 from:

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

to:

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

Added lines 58-59:

http://www.fpga.synth.net/pmwiki/uploads/SAW_SQUARE_SINE.MCS

July 06, 2006, at 08:56 PM by PaulMaddox -
Added lines 1-60:

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 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 ;-

:020000040000FA

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

:10246200464C5549442050524F46494C4500464C33

Lets eplain this line of seemingly random characters

  • The ':' tells the progammer we've got something comming, you need this a fresh new line.
  • The next two digits are the record length, in hex, in this case '10' which is 16 bytes.
  • The next four digits are the address, again, in this case '2462'.
  • The next two are the 'record type' for us, this will almost certainly always be '00' (data record).
  • Then we have 16 lots of 8 bit data, again, in hex
  • Finally an 8 bit checksum

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 ;-

:00000001FF

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

Points to note:

  • All the alpha characters used in file to donate hex values (a, b, c, d, e and f) MUST be in UPPER CASE, if you don't use upper case you're data will become corrupt!
  • make sure that there are no trailing spaces at the end of the line (after the checksum) this confuses the hell out of the programming software, and you'll start seeing wierd addresses shooting up the screen as it's programming!
  • You can check your data is correct by using the 'r' command in hyperterminal (whilst the FPGA is still running the Flash programmer).

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

  • a rising sawtooth,
  • a square wave (50/50 duty cycle)
  • a sine wave

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.