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.

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:
- Part name
- DeviceID (3 bytes, first is manufacturer ID, then device ID,
according to JEDEC 9Fh)
- Program memory (in bytes, below example is a 64 Mb chip)
- ConfigMasks[0], EEPROM protocol. Must be 5 for SPI FLASH
devices
- ConfigMasks[4], typical chip erase time in seconds. Used for
progress bar display
- ConfigMasks[5], maximum chip erase time in seconds. Used to
time out if erase doesn't complete
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 could also be used to check
if write has finished. But currently writes are statically timed
within the write script. Note that you don't need to touch this
script, this is just FYI. Usually copying an existing SPI FLASH
device and modifying the above listed parameters is enough.

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 28.6.2023 webmaster@kair.us