kair.us/ projects/ pickitminus/ program spi flash devices with pickit2 and pickit3

Program SPI FLASH devices with PICkit2 or PICkit3

Besides different EEPROMs, now you can read and write SPI FLASH devices with PICkit2 and PICkit3. Support is added to PICkitminus, starting from version 3.21.00 GUI software and 1.24.00 command line software (pk2cmd).

The connection is similar as for SPI EEPROM chips. See below diagram for connection advice for typical chips. Diagram made by Adem Gdk.

Please note that some modern FLASH chips use 1.8 V voltage which is not supported by PICkit2, due to the simple voltage clamp circuit on PICkit2. You would need external voltage level converter to work with 1.8 V chips. Be careful and don't burn your FLASH!

Another note; it is good to keep the wires between PICkit and FLASH chip short. The DO / SO pin has quite low drive strength on some FLASH devices. The clock can cause crosstalk, giving read and verify errors.

SPI FLASH to PICkit
          connection diagram

There are already some chip types added to SPIFLASH family. More can be added with device file editor by dougy83. When you add devices, pay attention to these parameters:

Also ConfigRdScript has special purpose for SPI FLASH chips. It is used to read STATUS register. This is used to check whether chip is busy performing an erase. It is also used to check if the last write has finished. Otherwise the busy bit is read in the write script, before starting new write operation. Note that you don't normally need to touch these scripts, this is just FYI. Usually copying an existing SPI FLASH device and modifying the above listed parameters is enough.

Using
      PICkit2 device file editor to add SPI FLASH chip types

If your chip is not supported, and you don't want to fiddle with device file editor. Then you can select EEPROMS/25LC family instead. There are MP25Pxx flash chips, just pick a chip whose memory size matches your chip. The difference is that 25LC family doesn't have ReadDevIDScript, so the JEDEC ID is not checked. In EEPROMS/SPIFLASH family, the JEDEC ID is checked.

You can also email me and ask to add your chip. I will add it if you provide test results whether it works. If you have added a device yourself and it works, you can send the device file to me and I'll add it to device file distributed with PICkitminus.

If you still can't get it to work, you can try flashrom software. It can be tricky to find a version which runs on Windows and supports PICkit2, but I have succesfully used this software on Linux with PICkit2. It has wide support for different chips, and has more sophisticated algorithms (compares data before writing, and only erases/writes sections which are different).

Beware, writing big FLASH chips with PICkit2 is SLOW. Not practical for production purposes, but suitable for occasional hacking.

Thanks to Adem Gdk for adding flash chips to device file and for performing lot of testing with PICkitminus and pk2cmd.

kair.us/ projects/ pickitminus/ program spi flash devices with pickit2 and pickit3

page created 27.6.2023
last updated 3.12.2023 webmaster@kair.us