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

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:
- Hardware complexity, SF takes precedence. A DIP package with a discrete flash chip is much easier to use than SD.
- 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.
- 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.
- Cost, SF has the advantage.
- Power, SF has the advantage. SD cards generally have higher leakage power due to higher density and high dynamic power due to access speed.
- 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:
- Supports over 476 flash memory chips, 291 chipsets, 500 motherboards, 79 PCI devices, 17 USB devices, and various parallel/serial based Spi Flash programmers.
- 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).
- Physical access is not required, root access is sufficient or not required at all for some programmers.
- No boot floppy, CD-ROM or other media required.
- Keyboard and monitors are not required, just reflash remotely via SSH.
- No instant reboot required.
- Rewrite the chip in the running system and test it, the new firmware will work on the next boot.
- Windows partial support available.
DIY: versatile creation programs

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

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

Install the OpenProg program on the PC, run and check the connected device. Spi Flash programmer firmware sequence:
- Connect USB to PC.
- Open OpenProg and make sure the programmer is found.
- Press "Settings" -> "Hardware check".
- Perform a hardware test. It checks all programming pins and the user can easily debug the device when errors are found.
- 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.
- Measure the voltage between the VODU, VPPU, CLK, DATA, PGM pins and check it with the values on the screen.
- VPP may have 1V difference due to AC to DC conversion.
- If the voltage of these pins of the controller part and what is displayed on the screen are similar, the programmer works fine.
- If the voltage is different, check the circuit of the corresponding contacts.
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

After manufacturing part of the controller and the expansion board, you can immediately proceed to programming the device:
- Find the device and device series for programming.
- Select a suitable device expansion board.
- Connect the device to the expansion board.
- Connect the expansion board to the controller box.
- Connect the USB B connection cable to the programmer and to the PC.
- Open OpenProg.exe and make sure the programmer is found.
- Open devices and select the one you want to program.
- Click the green arrow at the top to read the device.
- For writing/flashing, press the left button on the top to select the ".hex" code, and press "Ok".
- Press the red arrow button next to the green arrow button to program the device.
- Make sure the LED blinks during programming to show the status of the process.
- Check the result and make sure the flashing was successful.

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.
USB EEPROM

25 Series Spi Flash EEPROM Programmer with Software and Driver Support and 25-SPI Flash 8-pin/16-pin has the following functionality:
- Automatic chip model identification 25 series.
- USB to TTL support.
- Auto-detect 25 series chip.
- Support STC series download.
- 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.
- Provides 5V - 3.3V power output.
- Size: 70mm x 27mm
- 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:
- 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.
- Select the correct serial port in the software.
- 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.
- 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.
- 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.