DIY Spi Flash programmer

Table of contents:

DIY Spi Flash programmer
DIY Spi Flash programmer

Firmware is pre-installed in flash memory devices before PCB fabrication, maintaining high throughput. However, there are advantages to programming flash memory after it's been released, that is, before it's been soldered to the board. The Spi Flash (SF) programmer with discrete flash memory has significant advantages over conventional SD. Its price is usually less than 1/10 of the cost of a flash drive, uses a much smaller form factor, and requires little special hardware.

Choice: SF & SD

Justification for use: SF & SD
Justification for use: SF & SD

There are many reasons for choosing a discrete flash chip over an SD subsystem, or vice versa, so the user must make trade-offs before purchasing a device. The list below contains a few considerations you need to know before choosing a DIP chip or full SD solution:

  1. Hardware complexity, SF takes precedence. A DIP package with a discrete flash chip is much easier to use than SD.
  2. Software complexity, SF takes precedence. The SD flash subsystem typically relies on SD Fat16/32 libraries. Although the devices are SPI interface, it makes sense to use FAT since any PC/MAC can read the card. These libraries are large and can take up valuable EEPROM space on small embedded controllers.
  3. Capacity and portability, SD has the advantage. It is possible to use a higher capacity SD card in an existing design without modification. Discrete SPI has lower density limits.
  4. Cost, SF has the advantage.
  5. Power, SF has the advantage. SD cards generally have higher leakage power due to higher density and high dynamic power due to access speed.
  6. Speed, SD has the advantage. SD flash comes in many different SKUs based on speed mainly due to the demands of digital photography and the use of raw image formats.

SPI Flash

SPI flash memory is a type of non-volatile memory based on MOSFET technology. Non-volatile means that the device retains all data, including when not turned on. Flash memory works by transferring a group of charge carriers to a dielectric. This is called programming and is usually done with a higher voltage. The process is not harmless, it actually damages the material, and after 100 thousand cycles the device fails. To remove charge carriers fromdielectric, at the same high voltage at the reverse potential, the carriers are removed from the gate. This is called erasing.

The programmed flash bit is 0 and the erased bit is 1, the erased flash byte is 0xFF in hexadecimal. Currently, flash memory can store multiple bits per cell using voltage levels. With increasing memory requirements, this is becoming increasingly difficult to achieve by design.

The advantage of USB Spi Flash programmers is the simplicity of the software, the code basically shifts the data of the DI and DO pins, respectively, on the rising edge of the clock frequency. The clock is controlled by the host and does not require a fancy timing scheme: the phases can be as asymmetric as desired, as long as the device's minimum cycle width requirements are met.

Utility for identification

Flashrom is a utility for identifying, reading, writing, checking and deleting flash chips. It is designed to flash BIOS/EFI/coreboot/firmware/optionROM images on motherboards, network/graphics/storage controller cards, and various other programming devices. Functionality:

  1. Supports over 476 flash memory chips, 291 chipsets, 500 motherboards, 79 PCI devices, 17 USB devices, and various parallel/serial based Spi Flash programmers.
  2. Supports parallel interfaces, LPC, FWH and SPI flash memory interfaces and various chip packages (DIP32,PLCC32, DIP8, SO8/SOIC8, TSOP32, TSOP40, TSOP48, BGA and others).
  3. Physical access is not required, root access is sufficient or not required at all for some programmers.
  4. No boot floppy, CD-ROM or other media required.
  5. Keyboard and monitors are not required, just reflash remotely via SSH.
  6. No instant reboot required.
  7. Rewrite the chip in the running system and test it, the new firmware will work on the next boot.
  8. Windows partial support available.

DIY: versatile creation programs

DIY universal
DIY universal

This is the best Spi Flash programmer for PIC and AVR microcontrollers, it may not be possible to create it yourself, but the device is not expensive, costs less than $ 10 and is made from readily available components.


  1. Free and open source software.
  2. No need to install additional drivers, uses HID (Human Interface Device) driver, which is commonly used for keyboard and mouse.
  3. Supports many PIC and AVR devices.
  4. Supports Windows and Linux platforms.
  5. Consists of a PIC18F2550 microcontroller - the brain of the Spi Flash programmer.
  6. USB-B connector connects to the computer.
  7. There are two LED indicators, one to indicate the programmer is connected, the other to show the programming status.

PIC18F2550 microcontroller

Microcontroller PIC18F2550
Microcontroller PIC18F2550

The main three serial headers (J1, J2 and J3) are used to communicate with the MCU slave device. The use of pins is different in different microcontrollers. A reset switch is added to the controller block to set the reset of the programmer. PIC18F2550 flashes with hex firmware code, other serial or parallel Spi Flash PIC programmers can be used.

It checks the communication between the microcontroller and the PC. HID (Human Interface Device) detection testing is required, which will eliminate many errors, such as problems with the microcontroller, crystals and USB. Before starting to use the program, make sure that the LED is blinking, which then slows down the blinking process. If the programmer is not found, check the cross connections and instructions. If it is found, go to the next step.

Programming via OpenProg

Programming via OpenProg
Programming via OpenProg

Install the OpenProg program on the PC, run and check the connected device. Spi Flash programmer firmware sequence:

  1. Connect USB to PC.
  2. Open OpenProg and make sure the programmer is found.
  3. Press "Settings" -> "Hardware check".
  4. Perform a hardware test. It checks all programming pins and the user can easily debug the device when errors are found.
  5. Hardware test shows the voltage on VODU, VPPU, CLK, DATA, PGM at different points in time, which is important to consider whendo-it-yourself Spi Flash programmer on SMD.
  6. Measure the voltage between the VODU, VPPU, CLK, DATA, PGM pins and check it with the values on the screen.
  7. VPP may have 1V difference due to AC to DC conversion.
  8. If the voltage of these pins of the controller part and what is displayed on the screen are similar, the programmer works fine.
  9. If the voltage is different, check the circuit of the corresponding contacts.

PCB design

PCB design
PCB design

This PCB is designed in Eagle 7.2. The size of the plate is 7.5 x 7 cm, it is made on an automatic pickling machine. PCB can also be made by chemical etching at home.

Components JA, JB, JC are jumpers. According to the scheme, this is carefully checked and at first, during the assembly of the components, jumpers are installed. To ensure the safety of the PIC18F2550 during soldering, a 28-pin IC base is used.

The expansion board connects the programmer to the microcontroller. Different series of microcontrollers have different pins and configuration for programming. This gives users the advantage of ease of programming the microcontroller.

Expansion boards can be easily made using perforated board or commercially available special board blanks. For series of microcontrollers, different expansion boards are used. LVICP from 5V to 3.3V needs voltage regulator like LM1117 or similarhim.

The 3.3V device must only be programmed using the 3.3V expansion board, otherwise irreversible damage may occur. Some of the boards have a 5V option. If you want to program for 5V, you can select the Don't Require Low Voltage Board option. It is also not recommended to place 24F-33F in a 30F socket that operates at 5V.

Completing the creation process

Completing the creation process
Completing the creation process

After manufacturing part of the controller and the expansion board, you can immediately proceed to programming the device:

  1. Find the device and device series for programming.
  2. Select a suitable device expansion board.
  3. Connect the device to the expansion board.
  4. Connect the expansion board to the controller box.
  5. Connect the USB B connection cable to the programmer and to the PC.
  6. Open OpenProg.exe and make sure the programmer is found.
  7. Open devices and select the one you want to program.
  8. Click the green arrow at the top to read the device.
  9. For writing/flashing, press the left button on the top to select the ".hex" code, and press "Ok".
  10. Press the red arrow button next to the green arrow button to program the device.
  11. Make sure the LED blinks during programming to show the status of the process.
  12. Check the result and make sure the flashing was successful.
Software programming status
Software programming status

Serial SPI AT45DB161D

Simple Spi Flash SPI Programmer (AT45DB161D) is a 16Mbit (2MB) 2.5V or 2.7V serial flash memory, ideal for a wide range of code storage applications and data.

Total 2097152 bytes (0x1FFFFF) organized into 4096 pages with 512 bytes per page. Although the chip offers various erasing options, the software library supports block erasing, with one block containing 4 KB.

To overwrite existing data, you must first delete the corresponding block. Reading and writing data is done in a fairly simple way, mainly by providing a read/write address (from 0 to 0x1FFFFF) and information about the length of the data. Using the existing base functions, you can extend the code to support a rich file access system.



25 Series Spi Flash EEPROM Programmer with Software and Driver Support and 25-SPI Flash 8-pin/16-pin has the following functionality:

  1. Automatic chip model identification 25 series.
  2. USB to TTL support.
  3. Auto-detect 25 series chip.
  4. Support STC series download.
  5. The Spi Flash ch341a single-chip STC microcontroller procedure supports a full range of program downloads for a variety of software: backup, erase,programming, calibration and other movements.
  6. Provides 5V - 3.3V power output.
  7. Size: 70mm x 27mm
  8. CH341SER. EXE - self install archive from USB to serial driver.

Troubleshooting microcontrollers

When a user starts working with microcontrollers, he is likely to encounter programming problems that take hours or days to solve, and sometimes they are simply unsolvable. Experienced programmers shared their best practices for eliminating various violations, here are some of them:

  1. In case of any failure, first check the power supply. Sometimes it happens that the power supply does not fit the programmer and an external power supply is required.
  2. Select the correct serial port in the software.
  3. Before using the programmer, you must install the drivers necessary for its operation. When the programmer is connected for the first time, it will automatically install them, if there is an Internet connection, sometimes you will need to specify the location of the drivers.
  4. Voltage increase. Many microcontrollers require a pull-up in their circuitry before they can be programmed, so the picace microcontroller requires a 10k ohm pull-up resistor on the serial pin, otherwise it will show an error.
  5. The programming software does not detect the microcontroller - this is again a problem with the power supply, check the power supply again and connect the programmer to the computer.

AfterDo-it-yourself USB programmer Spi Flash user will get SF made by himself for system programming. It will be easily controlled by a computer via USB bus with user-friendly interface and powerful functions.

Popular topic

Editor's choice

  • The Psijic Order from The Elder Scrolls - who are they?
    The Psijic Order from The Elder Scrolls - who are they?

    The Psijics are the name of a mysterious and ancient Order from the Elder Scrolls game universe. Its members practice magic and are notorious for being at odds with the Thalmor. Even more interesting information about the Psijic Order can be found in today's guide

  • Three easy ways to turn off notifications in Viber
    Three easy ways to turn off notifications in Viber

    "Viber" today is one of the most popular and widespread instant messengers. Sometimes a situation arises that the sound of constantly incoming messages bothers or distracts a person from important matters. How to turn off notifications in Viber? The article presents three of the simplest and easiest ways to do this, and they will help you set the silent mode on both Android and iOS

  • How to advertise on Instagram yourself?
    How to advertise on Instagram yourself?

    One of the most effective methods of website promotion and business development at the moment is advertising on social networks. Social networks, where people actively communicate, are more willing to pay attention to useful posts, join groups, like posts and make reposts, are an almost inexhaustible source of traffic. A properly built advertising campaign will allow you to get new customers, keep the attention of existing ones and again win over those who were dissatisfied with the service

  • Google - what is it?
    Google - what is it?

    The article talks about the multidisciplinary corporation Google. Its services and the company's work as a device manufacturer are considered

  • How to remove a user from important friends on VKontakte: all ways
    How to remove a user from important friends on VKontakte: all ways

    Important friends of "VKontakte" are determined automatically. When friends, family, and a loved one appear first on the list, this is convenient. But relationships can change for various reasons, and the need to constantly see a person’s page may disappear. In this article, we will tell you how to remove from important VKontakte friends those users whom you do not want to see at the top of the list