Python3 spiflashprogrammerclient.py -f wr703n.orig.bin -flash-offset 16711680 -file-offset 4128768 verify Solder the new chip in. If you try this, let me know! The Batronix Eprom Programmer has been developed for amateur. This popular layout and schematic editor software is a powerful. USB Flash/EPROM Programmer download. USB Flash/EPROM Programmer A memory device programmer. Spi Serial Flash Programmer Schematic Read/Download A Simple Serial (I2C/SPI) EEPROM Programmer.

PagesFavoritedFavorite72

Introduction

Serial Peripheral Interface (SPI) is an interface bus commonly used to send data between microcontrollers and small peripherals such as shift registers, sensors, and SD cards. It uses separate clock and data lines, along with a select line to choose the device you wish to talk to.

Suggested Reading

Stuff that would be helpful to know before reading this tutorial:

Serial Communication

Asynchronous serial communication concepts: packets, signal levels, baud rates, UARTs and more!

Binary

Binary is the numeral system of electronics and programming..so it must be important to learn. But, what is binary? How does it translate to other numeral systems like decimal?

Shift Registers

An introduction to shift registers and potential uses.

Logic Levels

Learn the difference between 3.3V and 5V devices and logic levels.

What's Wrong with Serial Ports?

A common serial port, the kind with TX and RX lines, is called 'asynchronous' (not synchronous) because there is no control over when data is sent or any guarantee that both sides are running at precisely the same rate. Since computers normally rely on everything being synchronized to a single “clock” (the main crystal attached to a computer that drives everything), this can be a problem when two systems with slightly different clocks try to communicate with each other.

To work around this problem, asynchronous serial connections add extra start and stop bits to each byte help the receiver sync up to data as it arrives. Both sides must also agree on the transmission speed (such as 9600 bits per second) in advance. Slight differences in the transmission rate aren't a problem because the receiver re-syncs at the start of each byte.

(By the way, if you noticed that '11001010' does not equal 0x53 in the above diagram, kudos to your attention to detail. Serial protocols will often send the least significant bits first, so the smallest bit is on the far left. The lower nybble is actually 0011 = 0x3, and the upper nybble is 0101 = 0x5.)

Asynchronous serial works just fine, but has a lot of overhead in both the extra start and stop bits sent with every byte, and the complex hardware required to send and receive data. And as you've probably noticed in your own projects, if both sides aren't set to the same speed, the received data will be garbage. This is because the receiver is sampling the bits at very specific times (the arrows in the above diagram). If the receiver is looking at the wrong times, it will see the wrong bits.

A Synchronous Solution

SPI works in a slightly different manner. It's a 'synchronous' data bus, which means that it uses separate lines for data and a 'clock' that keeps both sides in perfect sync. The clock is an oscillating signal that tells the receiver exactly when to sample the bits on the data line. This could be the rising (low to high) or falling (high to low) edge of the clock signal; the datasheet will specify which one to use. When the receiver detects that edge, it will immediately look at the data line to read the next bit (see the arrows in the below diagram). Because the clock is sent along with the data, specifying the speed isn't important, although devices will have a top speed at which they can operate (We'll discuss choosing the proper clock edge and speed in a bit).

One reason that SPI is so popular is that the receiving hardware can be a simple shift register. This is a much simpler (and cheaper!) piece of hardware than the full-up UART (Universal Asynchronous Receiver / Transmitter) that asynchronous serial requires.

Receiving Data

You might be thinking to yourself, self, that sounds great for one-way communications, but how do you send data back in the opposite direction? Here's where things get slightly more complicated.

In SPI, only one side generates the clock signal (usually called CLK or SCK for Serial ClocK). The side that generates the clock is called the 'master', and the other side is called the 'slave'. There is always only one master (which is almost always your microcontroller), but there can be multiple slaves (more on this in a bit).

When data is sent from the master to a slave, it's sent on a data line called MOSI, for 'Master Out / Slave In'. If the slave needs to send a response back to the master, the master will continue to generate a prearranged number of clock cycles, and the slave will put the data onto a third data line called MISO, for 'Master In / Slave Out'.

Notice we said 'prearranged' in the above description. Because the master always generates the clock signal, it must know in advance when a slave needs to return data and how much data will be returned. This is very different than asynchronous serial, where random amounts of data can be sent in either direction at any time. In practice this isn't a problem, as SPI is generally used to talk to sensors that have a very specific command structure. For example, if you send the command for 'read data' to a device, you know that the device will always send you, for example, two bytes in return. (In cases where you might want to return a variable amount of data, you could always return one or two bytes specifying the length of the data and then have the master retrieve the full amount.)

Note that SPI is 'full duplex' (has separate send and receive lines), and, thus, in certain situations, you can transmit and receive data at the same time (for example, requesting a new sensor reading while retrieving the data from the previous one). Your device's datasheet will tell you if this is possible.

Slave Select (SS)

There's one last line you should be aware of, called SS for Slave Select. This tells the slave that it should wake up and receive / send data and is also used when multiple slaves are present to select the one you'd like to talk to.

The SS line is normally held high, which disconnects the slave from the SPI bus. (This type of logic is known as “active low,” and you’ll often see used it for enable and reset lines.) Just before data is sent to the slave, the line is brought low, which activates the slave. When you're done using the slave, the line is made high again. In a shift register, this corresponds to the 'latch' input, which transfers the received data to the output lines.

Multiple slaves

There are two ways of connecting multiple slaves to an SPI bus:

  1. In general, each slave will need a separate SS line. To talk to a particular slave, you'll make that slave's SS line low and keep the rest of them high (you don't want two slaves activated at the same time, or they may both try to talk on the same MISO line resulting in garbled data). Lots of slaves will require lots of SS lines; if you're running low on outputs, there are binary decoder chips that can multiply your SS outputs.
  1. On the other hand, some parts prefer to be daisy-chained together, with the MISO (output) of one going to the MOSI (input) of the next. In this case, a single SS line goes to all the slaves. Once all the data is sent, the SS line is raised, which causes all the chips to be activated simultaneously. This is often used for daisy-chained shift registers and addressable LED drivers.

Note that, for this layout, data overflows from one slave to the next, so to send data to any one slave, you'll need to transmit enough data to reach all of them. Also, keep in mind that the first piece of data you transmit will end up in the last slave.

This type of layout is typically used in output-only situations, such as driving LEDs where you don't need to receive any data back. In these cases you can leave the master's MISO line disconnected. However, if data does need to be returned to the master, you can do this by closing the daisy-chain loop (blue wire in the above diagram). Note that if you do this, the return data from slave 1 will need to pass through all the slaves before getting back to the master, so be sure to send enough receive commands to get the data you need.

Programming for SPI

Many microcontrollers have built-in SPI peripherals that handle all the details of sending and receiving data, and can do so at very high speeds. The SPI protocol is also simple enough that you (yes, you!) can write your own routines to manipulate the I/O lines in the proper sequence to transfer data. (A good example is on the Wikipedia SPI page.)

If you're using an Arduino, there are two ways you can communicate with SPI devices:

  1. You can use the shiftIn() and shiftOut() commands. These are software-based commands that will work on any group of pins, but will be somewhat slow.

  2. Or you can use the SPI Library, which takes advantage of the SPI hardware built into the microcontroller. This is vastly faster than the above commands, but it will only work on certain pins.

You will need to select some options when setting up your interface. These options must match those of the device you're talking to; check the device's datasheet to see what it requires.

  • The interface can send data with the most-significant bit (MSB) first, or least-significant bit (LSB) first. In the Arduino SPI library, this is controlled by the setBitOrder() function.

  • The slave will read the data on either the rising edge or the falling edge of the clock pulse. Additionally, the clock can be considered 'idle' when it is high or low. In the Arduino SPI library, both of these options are controlled by the setDataMode() function.

  • SPI can operate at extremely high speeds (millions of bytes per second), which may be too fast for some devices. To accommodate such devices, you can adjust the data rate. In the Arduino SPI library, the speed is set by the setClockDivider() function, which divides the master clock (16MHz on most Arduinos) down to a frequency between 8MHz (/2) and 125kHz (/128).

  • If you're using the SPI Library, you must use the provided SCK, MOSI and MISO pins, as the hardware is hardwired to those pins. There is also a dedicated SS pin that you can use (which must, at least, be set to an output in order for the SPI hardware to function), but note that you can use any other available output pin(s) for SS to your slave device(s) as well.

  • On older Arduinos, you'll need to control the SS pin(s) yourself, making one of them low before your data transfer and high afterward. Newer Arduinos such as the Due can control each SS pin automatically as part of the data transfer; see the Due SPI documentation page for more information.

Interested in learning more foundational topics?

See our Engineering Essentials page for a full list of cornerstone topics surrounding electrical engineering.

Resources and Going Further

Tips and Tricks

  • Because of the high speed signals, SPI should only be used to send data over short distances (up to a few feet). If you need to send data further than that, lower the clock speed, and consider using specialized driver chips.

  • If things aren't working the way you think they should, a logic analyzer is a very helpful tool. Smart analyzers like the Saleae USB Logic Analyzer can even decode the data bytes for a display or logging.

Advantages of SPI:

  • It's faster than asynchronous serial

    We Get Requests is an album by jazz pianist Oscar Peterson and his trio, released in 1964. It was recorded at RCA Studios New York City over October 19 (tracks 1, 5, 7), October 20 (tracks 2, 3, 4, 6, 8, 9) and November 19 or 20 (track 10). This album is Peterson's last of his fourteen-year work with Verve. Oscar peterson we get requests rar. Discover releases, reviews, credits, songs, and more about The Oscar Peterson Trio - We Get Requests at Discogs. Complete your The Oscar Peterson Trio collection. We Get Requests is an album by jazz pianist Oscar Peterson and his trio, released in 1964. It was recorded at RCA Studios New York City over October 19 (tracks 1, 5, 7), October 20 (tracks 2, 3, 4, 6, 8, 9) and November 19 or 20 (track 10). This album is Peterson’s last of his fourteen-year work with Verve. Additional Info. Oscar Peterson We Get Requests Rar Oscar Peterson Trio. Technically, the album is filled with above- average melodic development and solid rhythmic blend, while the repertoire is a crowd- pleaser. The listener is treated to a tasteful mixing of current pop tunes, standards and originals. Pianist Oscar Peterson has long been such a consistent performer that none of his records are throwaways, but this particular set is weaker than most. Since several of the songs are the type that in the mid-'60s would get requested (such as 'People,' 'The Girl from Ipanema,' and 'The Days of Wine and Roses').

  • The receive hardware can be a simple shift register

  • It supports multiple slaves

Disadvantages of SPI:

Spi
  • It requires more signal lines (wires) than other communications methods

  • The communications must be well-defined in advance (you can't send random amounts of data whenever you want)

  • The master must control all communications (slaves can't talk directly to each other)

  • It usually requires separate SS lines to each slave, which can be problematic if numerous slaves are needed.

Further Reading

Check out the Wikipedia page on SPI, which includes lots of good information on SPI and other synchronous interfaces.

This page presents a more correct way to set up an SPI network amongst your embedded devices, particularly for use with an Arduino microcontroller.

A number of SparkFun products have SPI interfaces. For example, the Bar Graph Breakout kit has an easy-to-use SPI interface that you can use to turn any of 30 LEDs on or off.

Other communication options:

Serial Communication

Asynchronous serial communication concepts: packets, signal levels, baud rates, UARTs and more!

Analog to Digital Conversion

The world is analog. Use analog to digital conversion to help digital devices interpret the world.

I2C

An introduction to I2C, one of the main embedded communications protocols in use today.

AST-CAN485 Hookup Guide

The AST CAN485 is a miniature Arduino in the compact form factor of the ProMini. In addition to all the usual features it has on-board CAN and RS485 ports enabling quick and easy interfacing to a multitude of industrial devices.

Now that you’re a pro on SPI, here are some other tutorials to practice your new skills:

MP3 Player Shield Music Box

Music Box Project based on the Dr. Who TARDIS.

Using the Serial 7-Segment Display

How to quickly and easily set up the Serial 7-Segment Display and the Serial 7-Segment Display Shield.

SparkFun BME280 Breakout Hookup Guide

A guide for connecting the BEM280 sensor to a microcontroller, and for using the Sparkfun Arduino library.

Raspberry Pi SPI and I2C Tutorial

Learn how to use serial I2C and SPI buses on your Raspberry Pi using the wiringPi I/O library for C/C++ and spidev/smbus for Python.

In your journey hacking, modding and making electronics you will bump into many a FLASH chip. Often times these store program memory, settings, data files etc. Some microcontrollers have built-in flash, but an external flash chip allows for field-updating. Also, fitting a large Flash chip inside a micro or FPGA can increase cost a lot, where-as having it be external lets the customer pick exactly the right size they need. They can range from 256 bytes up to 16 MBytes or even more!

SPI Flash Standardization

The good news is that just about every 8-pin Flash chip has a standard pinout and SPI interface, these tend to have the number 25 somewhere in the beginning of the part number. There are also ones that are only I2C - these will have the number 24 somewhere in the part number. This page is just about SPI flash.

Spi serial flash programmer schematic definition test

As you can see, SPI flash part numbers tend to start with 'MX25' or 'W25' or 'AT25' or 'SST25' etc. The first two letters are the manufacturer name.

The rest of the part number will also contain a 3 digit number that indicates the size in 'kilobits' or 'megabits'. E.g. 010 is 1-Megabit (128 KByte), 080 is 8-Megabit (1 MByte), 016 is 16-Mbit/2MByte. For smaller sizes, all 3 digits are used. E.g. 256 is 256-Kbit (32KByte),

Not only do they have a standard pinout, but there is also a standard-ish set of commands you can use to read and write the data. So, if your flash memory chip has this pinout, chances are you can use a standard command set to program it.

If you want to use an microcontroller..

If you have an Arduino or compatible, check out our libraries (https://github.com/adafruit/Adafruit_SPIFlash or https://github.com/adafruit/Adafruit_TinyFlash) on how to read/write to/from these in a mcirocontroller

HOWEVER

you are here because you do not want to mess with an Arduino - your file that you want to read/write is on your computer, and its big so getting it into a microcontroller is a pain. Instead, in this guide we will use an FT232H as a 'gateway' so that you can use any computer and read/write the SPI flash through the command line.

You will need the FT232H breakout, and if you have a chip in a package that is not breadboard-able right away you will need a socket or an adapter board.

Adafruit FT232H Breakout - General Purpose USB to GPIO, SPI, I2C

Wouldn't it be cool to drive a tiny OLED display, read a
IN STOCK

3.3V 250mA Linear Voltage Regulator - L4931-3.3 TO-92

Need a nice little 3.3V regulator? We rather like the very-low-dropout L4931 from ST! This little guy will help you get your 4-20V battery or wall adapter down to a nice clean 3.3V..
IN STOCK

10uF 50V Electrolytic Capacitors - Pack of 10

We like capacitors so much we made a kids show about them. ..
IN STOCK

SMT Test Socket - SOIC-8 Narrow Breakout

You know those ZIF sockets we have for DIP chips? Well these are just like that but for SMT parts! Yeah, that's right, now you can program and test out your favorite new parts in..
IN STOCK

SMT Breakout PCB for SOIC-8, MSOP-8 or TSSOP-8 - 6 Pack!

Beguiled by a fancy new chip that is only available in a SOIC or MSOP/(T)SSOP pinout? This breakout PCB set will make your life much much easier and get you prototyping faster than..
IN STOCK

If you're using Windows, you will need to follow these instructions to set up the Zadig tool and replace the default FTDI driver. Make sure you do this step!

We have adapted a helper program for FPGAs. You can check out our version from github.

The easiest way to get started is to just download a zip of the repository:

Uncompress the zip folder. If you are on mac or linux you will need to install the FTDI library and build the executable. Check out the FT232H guide on where to download those files. For Windows, we provide the .exe already

Because SPI flash chips run at 3.3V, you will need to regulate the 5V supply on the FT232H down.

Using the L4931-3.3 regulator, make the connections shown in the diagram below.

Make sure to add a 10uF capacitor from the regulator output to ground for stability!

Wire up your FT232H breakout to your flash chip like this (use a socket or an adapter board if it is not a DIP package)

  • D0 on the FT232H to pin 6 on the flash
  • D1 on the FT232H to pin 5 on the flash
  • D2 on the FT232H to pin 2 on the flash
  • D4 on the FT232H to pin 1 on the flash
  • pin 3 (Write Protect) on the flash to 3.3V. If you are only reading from the Flash, you can connect this to ground.
  • pin 4 (VSS ground) on the flash to ground
  • pin 7 (HOLD) on the flash to 3.3V
  • pin 8 (VCC power) on the flash to 3.3v

Run the executable from the folder you downloaded. The argument it takes is the path to the binary file you want to write to the flash. An example might look like this

That's it!

This guide was first published on Jul 03, 2017. It was lastupdated on Jul 03, 2017.This page (Overview) was last updated on Feb 19, 2020.

Popular Posts

Python3 spiflashprogrammerclient.py -f wr703n.orig.bin -flash-offset 16711680 -file-offset 4128768 verify Solder the new chip in. If you try this, let me know! The Batronix Eprom Programmer has been developed for amateur. This popular layout and schematic editor software is a powerful. USB Flash/EPROM Programmer download. USB Flash/EPROM Programmer A memory device programmer. Spi Serial Flash Programmer Schematic Read/Download A Simple Serial (I2C/SPI) EEPROM Programmer.

PagesFavoritedFavorite72

Introduction

Serial Peripheral Interface (SPI) is an interface bus commonly used to send data between microcontrollers and small peripherals such as shift registers, sensors, and SD cards. It uses separate clock and data lines, along with a select line to choose the device you wish to talk to.

Suggested Reading

Stuff that would be helpful to know before reading this tutorial:

Serial Communication

Asynchronous serial communication concepts: packets, signal levels, baud rates, UARTs and more!

Binary

Binary is the numeral system of electronics and programming..so it must be important to learn. But, what is binary? How does it translate to other numeral systems like decimal?

Shift Registers

An introduction to shift registers and potential uses.

Logic Levels

Learn the difference between 3.3V and 5V devices and logic levels.

What\'s Wrong with Serial Ports?

A common serial port, the kind with TX and RX lines, is called \'asynchronous\' (not synchronous) because there is no control over when data is sent or any guarantee that both sides are running at precisely the same rate. Since computers normally rely on everything being synchronized to a single “clock” (the main crystal attached to a computer that drives everything), this can be a problem when two systems with slightly different clocks try to communicate with each other.

To work around this problem, asynchronous serial connections add extra start and stop bits to each byte help the receiver sync up to data as it arrives. Both sides must also agree on the transmission speed (such as 9600 bits per second) in advance. Slight differences in the transmission rate aren\'t a problem because the receiver re-syncs at the start of each byte.

(By the way, if you noticed that \'11001010\' does not equal 0x53 in the above diagram, kudos to your attention to detail. Serial protocols will often send the least significant bits first, so the smallest bit is on the far left. The lower nybble is actually 0011 = 0x3, and the upper nybble is 0101 = 0x5.)

Asynchronous serial works just fine, but has a lot of overhead in both the extra start and stop bits sent with every byte, and the complex hardware required to send and receive data. And as you\'ve probably noticed in your own projects, if both sides aren\'t set to the same speed, the received data will be garbage. This is because the receiver is sampling the bits at very specific times (the arrows in the above diagram). If the receiver is looking at the wrong times, it will see the wrong bits.

A Synchronous Solution

SPI works in a slightly different manner. It\'s a \'synchronous\' data bus, which means that it uses separate lines for data and a \'clock\' that keeps both sides in perfect sync. The clock is an oscillating signal that tells the receiver exactly when to sample the bits on the data line. This could be the rising (low to high) or falling (high to low) edge of the clock signal; the datasheet will specify which one to use. When the receiver detects that edge, it will immediately look at the data line to read the next bit (see the arrows in the below diagram). Because the clock is sent along with the data, specifying the speed isn\'t important, although devices will have a top speed at which they can operate (We\'ll discuss choosing the proper clock edge and speed in a bit).

One reason that SPI is so popular is that the receiving hardware can be a simple shift register. This is a much simpler (and cheaper!) piece of hardware than the full-up UART (Universal Asynchronous Receiver / Transmitter) that asynchronous serial requires.

Receiving Data

You might be thinking to yourself, self, that sounds great for one-way communications, but how do you send data back in the opposite direction? Here\'s where things get slightly more complicated.

In SPI, only one side generates the clock signal (usually called CLK or SCK for Serial ClocK). The side that generates the clock is called the \'master\', and the other side is called the \'slave\'. There is always only one master (which is almost always your microcontroller), but there can be multiple slaves (more on this in a bit).

When data is sent from the master to a slave, it\'s sent on a data line called MOSI, for \'Master Out / Slave In\'. If the slave needs to send a response back to the master, the master will continue to generate a prearranged number of clock cycles, and the slave will put the data onto a third data line called MISO, for \'Master In / Slave Out\'.

Notice we said \'prearranged\' in the above description. Because the master always generates the clock signal, it must know in advance when a slave needs to return data and how much data will be returned. This is very different than asynchronous serial, where random amounts of data can be sent in either direction at any time. In practice this isn\'t a problem, as SPI is generally used to talk to sensors that have a very specific command structure. For example, if you send the command for \'read data\' to a device, you know that the device will always send you, for example, two bytes in return. (In cases where you might want to return a variable amount of data, you could always return one or two bytes specifying the length of the data and then have the master retrieve the full amount.)

Note that SPI is \'full duplex\' (has separate send and receive lines), and, thus, in certain situations, you can transmit and receive data at the same time (for example, requesting a new sensor reading while retrieving the data from the previous one). Your device\'s datasheet will tell you if this is possible.

Slave Select (SS)

There\'s one last line you should be aware of, called SS for Slave Select. This tells the slave that it should wake up and receive / send data and is also used when multiple slaves are present to select the one you\'d like to talk to.

The SS line is normally held high, which disconnects the slave from the SPI bus. (This type of logic is known as “active low,” and you’ll often see used it for enable and reset lines.) Just before data is sent to the slave, the line is brought low, which activates the slave. When you\'re done using the slave, the line is made high again. In a shift register, this corresponds to the \'latch\' input, which transfers the received data to the output lines.

Multiple slaves

There are two ways of connecting multiple slaves to an SPI bus:

  1. In general, each slave will need a separate SS line. To talk to a particular slave, you\'ll make that slave\'s SS line low and keep the rest of them high (you don\'t want two slaves activated at the same time, or they may both try to talk on the same MISO line resulting in garbled data). Lots of slaves will require lots of SS lines; if you\'re running low on outputs, there are binary decoder chips that can multiply your SS outputs.
  1. On the other hand, some parts prefer to be daisy-chained together, with the MISO (output) of one going to the MOSI (input) of the next. In this case, a single SS line goes to all the slaves. Once all the data is sent, the SS line is raised, which causes all the chips to be activated simultaneously. This is often used for daisy-chained shift registers and addressable LED drivers.

Note that, for this layout, data overflows from one slave to the next, so to send data to any one slave, you\'ll need to transmit enough data to reach all of them. Also, keep in mind that the first piece of data you transmit will end up in the last slave.

This type of layout is typically used in output-only situations, such as driving LEDs where you don\'t need to receive any data back. In these cases you can leave the master\'s MISO line disconnected. However, if data does need to be returned to the master, you can do this by closing the daisy-chain loop (blue wire in the above diagram). Note that if you do this, the return data from slave 1 will need to pass through all the slaves before getting back to the master, so be sure to send enough receive commands to get the data you need.

Programming for SPI

Many microcontrollers have built-in SPI peripherals that handle all the details of sending and receiving data, and can do so at very high speeds. The SPI protocol is also simple enough that you (yes, you!) can write your own routines to manipulate the I/O lines in the proper sequence to transfer data. (A good example is on the Wikipedia SPI page.)

If you\'re using an Arduino, there are two ways you can communicate with SPI devices:

  1. You can use the shiftIn() and shiftOut() commands. These are software-based commands that will work on any group of pins, but will be somewhat slow.

  2. Or you can use the SPI Library, which takes advantage of the SPI hardware built into the microcontroller. This is vastly faster than the above commands, but it will only work on certain pins.

You will need to select some options when setting up your interface. These options must match those of the device you\'re talking to; check the device\'s datasheet to see what it requires.

  • The interface can send data with the most-significant bit (MSB) first, or least-significant bit (LSB) first. In the Arduino SPI library, this is controlled by the setBitOrder() function.

  • The slave will read the data on either the rising edge or the falling edge of the clock pulse. Additionally, the clock can be considered \'idle\' when it is high or low. In the Arduino SPI library, both of these options are controlled by the setDataMode() function.

  • SPI can operate at extremely high speeds (millions of bytes per second), which may be too fast for some devices. To accommodate such devices, you can adjust the data rate. In the Arduino SPI library, the speed is set by the setClockDivider() function, which divides the master clock (16MHz on most Arduinos) down to a frequency between 8MHz (/2) and 125kHz (/128).

  • If you\'re using the SPI Library, you must use the provided SCK, MOSI and MISO pins, as the hardware is hardwired to those pins. There is also a dedicated SS pin that you can use (which must, at least, be set to an output in order for the SPI hardware to function), but note that you can use any other available output pin(s) for SS to your slave device(s) as well.

  • On older Arduinos, you\'ll need to control the SS pin(s) yourself, making one of them low before your data transfer and high afterward. Newer Arduinos such as the Due can control each SS pin automatically as part of the data transfer; see the Due SPI documentation page for more information.

Interested in learning more foundational topics?

See our Engineering Essentials page for a full list of cornerstone topics surrounding electrical engineering.

Resources and Going Further

Tips and Tricks

  • Because of the high speed signals, SPI should only be used to send data over short distances (up to a few feet). If you need to send data further than that, lower the clock speed, and consider using specialized driver chips.

  • If things aren\'t working the way you think they should, a logic analyzer is a very helpful tool. Smart analyzers like the Saleae USB Logic Analyzer can even decode the data bytes for a display or logging.

Advantages of SPI:

  • It\'s faster than asynchronous serial

    We Get Requests is an album by jazz pianist Oscar Peterson and his trio, released in 1964. It was recorded at RCA Studios New York City over October 19 (tracks 1, 5, 7), October 20 (tracks 2, 3, 4, 6, 8, 9) and November 19 or 20 (track 10). This album is Peterson\'s last of his fourteen-year work with Verve. Oscar peterson we get requests rar. Discover releases, reviews, credits, songs, and more about The Oscar Peterson Trio - We Get Requests at Discogs. Complete your The Oscar Peterson Trio collection. We Get Requests is an album by jazz pianist Oscar Peterson and his trio, released in 1964. It was recorded at RCA Studios New York City over October 19 (tracks 1, 5, 7), October 20 (tracks 2, 3, 4, 6, 8, 9) and November 19 or 20 (track 10). This album is Peterson’s last of his fourteen-year work with Verve. Additional Info. Oscar Peterson We Get Requests Rar Oscar Peterson Trio. Technically, the album is filled with above- average melodic development and solid rhythmic blend, while the repertoire is a crowd- pleaser. The listener is treated to a tasteful mixing of current pop tunes, standards and originals. Pianist Oscar Peterson has long been such a consistent performer that none of his records are throwaways, but this particular set is weaker than most. Since several of the songs are the type that in the mid-\'60s would get requested (such as \'People,\' 'The Girl from Ipanema,\' and \'The Days of Wine and Roses\').

  • The receive hardware can be a simple shift register

  • It supports multiple slaves

Disadvantages of SPI:

\'Spi\'
  • It requires more signal lines (wires) than other communications methods

  • The communications must be well-defined in advance (you can\'t send random amounts of data whenever you want)

  • The master must control all communications (slaves can\'t talk directly to each other)

  • It usually requires separate SS lines to each slave, which can be problematic if numerous slaves are needed.

Further Reading

Check out the Wikipedia page on SPI, which includes lots of good information on SPI and other synchronous interfaces.

This page presents a more correct way to set up an SPI network amongst your embedded devices, particularly for use with an Arduino microcontroller.

A number of SparkFun products have SPI interfaces. For example, the Bar Graph Breakout kit has an easy-to-use SPI interface that you can use to turn any of 30 LEDs on or off.

Other communication options:

Serial Communication

Asynchronous serial communication concepts: packets, signal levels, baud rates, UARTs and more!

Analog to Digital Conversion

The world is analog. Use analog to digital conversion to help digital devices interpret the world.

I2C

An introduction to I2C, one of the main embedded communications protocols in use today.

AST-CAN485 Hookup Guide

The AST CAN485 is a miniature Arduino in the compact form factor of the ProMini. In addition to all the usual features it has on-board CAN and RS485 ports enabling quick and easy interfacing to a multitude of industrial devices.

Now that you’re a pro on SPI, here are some other tutorials to practice your new skills:

MP3 Player Shield Music Box

Music Box Project based on the Dr. Who TARDIS.

Using the Serial 7-Segment Display

How to quickly and easily set up the Serial 7-Segment Display and the Serial 7-Segment Display Shield.

SparkFun BME280 Breakout Hookup Guide

A guide for connecting the BEM280 sensor to a microcontroller, and for using the Sparkfun Arduino library.

Raspberry Pi SPI and I2C Tutorial

Learn how to use serial I2C and SPI buses on your Raspberry Pi using the wiringPi I/O library for C/C++ and spidev/smbus for Python.

In your journey hacking, modding and making electronics you will bump into many a FLASH chip. Often times these store program memory, settings, data files etc. Some microcontrollers have built-in flash, but an external flash chip allows for field-updating. Also, fitting a large Flash chip inside a micro or FPGA can increase cost a lot, where-as having it be external lets the customer pick exactly the right size they need. They can range from 256 bytes up to 16 MBytes or even more!

SPI Flash Standardization

The good news is that just about every 8-pin Flash chip has a standard pinout and SPI interface, these tend to have the number 25 somewhere in the beginning of the part number. There are also ones that are only I2C - these will have the number 24 somewhere in the part number. This page is just about SPI flash.

\'Spi

As you can see, SPI flash part numbers tend to start with \'MX25\' or \'W25\' or \'AT25\' or \'SST25\' etc. The first two letters are the manufacturer name.

The rest of the part number will also contain a 3 digit number that indicates the size in \'kilobits\' or \'megabits\'. E.g. 010 is 1-Megabit (128 KByte), 080 is 8-Megabit (1 MByte), 016 is 16-Mbit/2MByte. For smaller sizes, all 3 digits are used. E.g. 256 is 256-Kbit (32KByte),

Not only do they have a standard pinout, but there is also a standard-ish set of commands you can use to read and write the data. So, if your flash memory chip has this pinout, chances are you can use a standard command set to program it.

If you want to use an microcontroller..

If you have an Arduino or compatible, check out our libraries (https://github.com/adafruit/Adafruit_SPIFlash or https://github.com/adafruit/Adafruit_TinyFlash) on how to read/write to/from these in a mcirocontroller

HOWEVER

you are here because you do not want to mess with an Arduino - your file that you want to read/write is on your computer, and its big so getting it into a microcontroller is a pain. Instead, in this guide we will use an FT232H as a \'gateway\' so that you can use any computer and read/write the SPI flash through the command line.

You will need the FT232H breakout, and if you have a chip in a package that is not breadboard-able right away you will need a socket or an adapter board.

Adafruit FT232H Breakout - General Purpose USB to GPIO, SPI, I2C

Wouldn\'t it be cool to drive a tiny OLED display, read a
IN STOCK

3.3V 250mA Linear Voltage Regulator - L4931-3.3 TO-92

Need a nice little 3.3V regulator? We rather like the very-low-dropout L4931 from ST! This little guy will help you get your 4-20V battery or wall adapter down to a nice clean 3.3V..
IN STOCK

10uF 50V Electrolytic Capacitors - Pack of 10

We like capacitors so much we made a kids show about them. ..
IN STOCK

SMT Test Socket - SOIC-8 Narrow Breakout

You know those ZIF sockets we have for DIP chips? Well these are just like that but for SMT parts! Yeah, that\'s right, now you can program and test out your favorite new parts in..
IN STOCK

SMT Breakout PCB for SOIC-8, MSOP-8 or TSSOP-8 - 6 Pack!

Beguiled by a fancy new chip that is only available in a SOIC or MSOP/(T)SSOP pinout? This breakout PCB set will make your life much much easier and get you prototyping faster than..
IN STOCK

If you\'re using Windows, you will need to follow these instructions to set up the Zadig tool and replace the default FTDI driver. Make sure you do this step!

We have adapted a helper program for FPGAs. You can check out our version from github.

The easiest way to get started is to just download a zip of the repository:

Uncompress the zip folder. If you are on mac or linux you will need to install the FTDI library and build the executable. Check out the FT232H guide on where to download those files. For Windows, we provide the .exe already

Because SPI flash chips run at 3.3V, you will need to regulate the 5V supply on the FT232H down.

Using the L4931-3.3 regulator, make the connections shown in the diagram below.

Make sure to add a 10uF capacitor from the regulator output to ground for stability!

Wire up your FT232H breakout to your flash chip like this (use a socket or an adapter board if it is not a DIP package)

  • D0 on the FT232H to pin 6 on the flash
  • D1 on the FT232H to pin 5 on the flash
  • D2 on the FT232H to pin 2 on the flash
  • D4 on the FT232H to pin 1 on the flash
  • pin 3 (Write Protect) on the flash to 3.3V. If you are only reading from the Flash, you can connect this to ground.
  • pin 4 (VSS ground) on the flash to ground
  • pin 7 (HOLD) on the flash to 3.3V
  • pin 8 (VCC power) on the flash to 3.3v

Run the executable from the folder you downloaded. The argument it takes is the path to the binary file you want to write to the flash. An example might look like this

That\'s it!

This guide was first published on Jul 03, 2017. It was lastupdated on Jul 03, 2017.This page (Overview) was last updated on Feb 19, 2020....'>Spi Serial Flash Programmer Schematic Definition(05.02.2020)
  • laserqplus.netlify.com〓 Spi Serial Flash Programmer Schematic Definition
  • Python3 spiflashprogrammerclient.py -f wr703n.orig.bin -flash-offset 16711680 -file-offset 4128768 verify Solder the new chip in. If you try this, let me know! The Batronix Eprom Programmer has been developed for amateur. This popular layout and schematic editor software is a powerful. USB Flash/EPROM Programmer download. USB Flash/EPROM Programmer A memory device programmer. Spi Serial Flash Programmer Schematic Read/Download A Simple Serial (I2C/SPI) EEPROM Programmer.

    PagesFavoritedFavorite72

    Introduction

    Serial Peripheral Interface (SPI) is an interface bus commonly used to send data between microcontrollers and small peripherals such as shift registers, sensors, and SD cards. It uses separate clock and data lines, along with a select line to choose the device you wish to talk to.

    Suggested Reading

    Stuff that would be helpful to know before reading this tutorial:

    Serial Communication

    Asynchronous serial communication concepts: packets, signal levels, baud rates, UARTs and more!

    Binary

    Binary is the numeral system of electronics and programming..so it must be important to learn. But, what is binary? How does it translate to other numeral systems like decimal?

    Shift Registers

    An introduction to shift registers and potential uses.

    Logic Levels

    Learn the difference between 3.3V and 5V devices and logic levels.

    What\'s Wrong with Serial Ports?

    A common serial port, the kind with TX and RX lines, is called \'asynchronous\' (not synchronous) because there is no control over when data is sent or any guarantee that both sides are running at precisely the same rate. Since computers normally rely on everything being synchronized to a single “clock” (the main crystal attached to a computer that drives everything), this can be a problem when two systems with slightly different clocks try to communicate with each other.

    To work around this problem, asynchronous serial connections add extra start and stop bits to each byte help the receiver sync up to data as it arrives. Both sides must also agree on the transmission speed (such as 9600 bits per second) in advance. Slight differences in the transmission rate aren\'t a problem because the receiver re-syncs at the start of each byte.

    (By the way, if you noticed that \'11001010\' does not equal 0x53 in the above diagram, kudos to your attention to detail. Serial protocols will often send the least significant bits first, so the smallest bit is on the far left. The lower nybble is actually 0011 = 0x3, and the upper nybble is 0101 = 0x5.)

    Asynchronous serial works just fine, but has a lot of overhead in both the extra start and stop bits sent with every byte, and the complex hardware required to send and receive data. And as you\'ve probably noticed in your own projects, if both sides aren\'t set to the same speed, the received data will be garbage. This is because the receiver is sampling the bits at very specific times (the arrows in the above diagram). If the receiver is looking at the wrong times, it will see the wrong bits.

    A Synchronous Solution

    SPI works in a slightly different manner. It\'s a \'synchronous\' data bus, which means that it uses separate lines for data and a \'clock\' that keeps both sides in perfect sync. The clock is an oscillating signal that tells the receiver exactly when to sample the bits on the data line. This could be the rising (low to high) or falling (high to low) edge of the clock signal; the datasheet will specify which one to use. When the receiver detects that edge, it will immediately look at the data line to read the next bit (see the arrows in the below diagram). Because the clock is sent along with the data, specifying the speed isn\'t important, although devices will have a top speed at which they can operate (We\'ll discuss choosing the proper clock edge and speed in a bit).

    One reason that SPI is so popular is that the receiving hardware can be a simple shift register. This is a much simpler (and cheaper!) piece of hardware than the full-up UART (Universal Asynchronous Receiver / Transmitter) that asynchronous serial requires.

    Receiving Data

    You might be thinking to yourself, self, that sounds great for one-way communications, but how do you send data back in the opposite direction? Here\'s where things get slightly more complicated.

    In SPI, only one side generates the clock signal (usually called CLK or SCK for Serial ClocK). The side that generates the clock is called the \'master\', and the other side is called the \'slave\'. There is always only one master (which is almost always your microcontroller), but there can be multiple slaves (more on this in a bit).

    When data is sent from the master to a slave, it\'s sent on a data line called MOSI, for \'Master Out / Slave In\'. If the slave needs to send a response back to the master, the master will continue to generate a prearranged number of clock cycles, and the slave will put the data onto a third data line called MISO, for \'Master In / Slave Out\'.

    Notice we said \'prearranged\' in the above description. Because the master always generates the clock signal, it must know in advance when a slave needs to return data and how much data will be returned. This is very different than asynchronous serial, where random amounts of data can be sent in either direction at any time. In practice this isn\'t a problem, as SPI is generally used to talk to sensors that have a very specific command structure. For example, if you send the command for \'read data\' to a device, you know that the device will always send you, for example, two bytes in return. (In cases where you might want to return a variable amount of data, you could always return one or two bytes specifying the length of the data and then have the master retrieve the full amount.)

    Note that SPI is \'full duplex\' (has separate send and receive lines), and, thus, in certain situations, you can transmit and receive data at the same time (for example, requesting a new sensor reading while retrieving the data from the previous one). Your device\'s datasheet will tell you if this is possible.

    Slave Select (SS)

    There\'s one last line you should be aware of, called SS for Slave Select. This tells the slave that it should wake up and receive / send data and is also used when multiple slaves are present to select the one you\'d like to talk to.

    The SS line is normally held high, which disconnects the slave from the SPI bus. (This type of logic is known as “active low,” and you’ll often see used it for enable and reset lines.) Just before data is sent to the slave, the line is brought low, which activates the slave. When you\'re done using the slave, the line is made high again. In a shift register, this corresponds to the \'latch\' input, which transfers the received data to the output lines.

    Multiple slaves

    There are two ways of connecting multiple slaves to an SPI bus:

    1. In general, each slave will need a separate SS line. To talk to a particular slave, you\'ll make that slave\'s SS line low and keep the rest of them high (you don\'t want two slaves activated at the same time, or they may both try to talk on the same MISO line resulting in garbled data). Lots of slaves will require lots of SS lines; if you\'re running low on outputs, there are binary decoder chips that can multiply your SS outputs.
    1. On the other hand, some parts prefer to be daisy-chained together, with the MISO (output) of one going to the MOSI (input) of the next. In this case, a single SS line goes to all the slaves. Once all the data is sent, the SS line is raised, which causes all the chips to be activated simultaneously. This is often used for daisy-chained shift registers and addressable LED drivers.

    Note that, for this layout, data overflows from one slave to the next, so to send data to any one slave, you\'ll need to transmit enough data to reach all of them. Also, keep in mind that the first piece of data you transmit will end up in the last slave.

    This type of layout is typically used in output-only situations, such as driving LEDs where you don\'t need to receive any data back. In these cases you can leave the master\'s MISO line disconnected. However, if data does need to be returned to the master, you can do this by closing the daisy-chain loop (blue wire in the above diagram). Note that if you do this, the return data from slave 1 will need to pass through all the slaves before getting back to the master, so be sure to send enough receive commands to get the data you need.

    Programming for SPI

    Many microcontrollers have built-in SPI peripherals that handle all the details of sending and receiving data, and can do so at very high speeds. The SPI protocol is also simple enough that you (yes, you!) can write your own routines to manipulate the I/O lines in the proper sequence to transfer data. (A good example is on the Wikipedia SPI page.)

    If you\'re using an Arduino, there are two ways you can communicate with SPI devices:

    1. You can use the shiftIn() and shiftOut() commands. These are software-based commands that will work on any group of pins, but will be somewhat slow.

    2. Or you can use the SPI Library, which takes advantage of the SPI hardware built into the microcontroller. This is vastly faster than the above commands, but it will only work on certain pins.

    You will need to select some options when setting up your interface. These options must match those of the device you\'re talking to; check the device\'s datasheet to see what it requires.

    • The interface can send data with the most-significant bit (MSB) first, or least-significant bit (LSB) first. In the Arduino SPI library, this is controlled by the setBitOrder() function.

    • The slave will read the data on either the rising edge or the falling edge of the clock pulse. Additionally, the clock can be considered \'idle\' when it is high or low. In the Arduino SPI library, both of these options are controlled by the setDataMode() function.

    • SPI can operate at extremely high speeds (millions of bytes per second), which may be too fast for some devices. To accommodate such devices, you can adjust the data rate. In the Arduino SPI library, the speed is set by the setClockDivider() function, which divides the master clock (16MHz on most Arduinos) down to a frequency between 8MHz (/2) and 125kHz (/128).

    • If you\'re using the SPI Library, you must use the provided SCK, MOSI and MISO pins, as the hardware is hardwired to those pins. There is also a dedicated SS pin that you can use (which must, at least, be set to an output in order for the SPI hardware to function), but note that you can use any other available output pin(s) for SS to your slave device(s) as well.

    • On older Arduinos, you\'ll need to control the SS pin(s) yourself, making one of them low before your data transfer and high afterward. Newer Arduinos such as the Due can control each SS pin automatically as part of the data transfer; see the Due SPI documentation page for more information.

    Interested in learning more foundational topics?

    See our Engineering Essentials page for a full list of cornerstone topics surrounding electrical engineering.

    Resources and Going Further

    Tips and Tricks

    • Because of the high speed signals, SPI should only be used to send data over short distances (up to a few feet). If you need to send data further than that, lower the clock speed, and consider using specialized driver chips.

    • If things aren\'t working the way you think they should, a logic analyzer is a very helpful tool. Smart analyzers like the Saleae USB Logic Analyzer can even decode the data bytes for a display or logging.

    Advantages of SPI:

    • It\'s faster than asynchronous serial

      We Get Requests is an album by jazz pianist Oscar Peterson and his trio, released in 1964. It was recorded at RCA Studios New York City over October 19 (tracks 1, 5, 7), October 20 (tracks 2, 3, 4, 6, 8, 9) and November 19 or 20 (track 10). This album is Peterson\'s last of his fourteen-year work with Verve. Oscar peterson we get requests rar. Discover releases, reviews, credits, songs, and more about The Oscar Peterson Trio - We Get Requests at Discogs. Complete your The Oscar Peterson Trio collection. We Get Requests is an album by jazz pianist Oscar Peterson and his trio, released in 1964. It was recorded at RCA Studios New York City over October 19 (tracks 1, 5, 7), October 20 (tracks 2, 3, 4, 6, 8, 9) and November 19 or 20 (track 10). This album is Peterson’s last of his fourteen-year work with Verve. Additional Info. Oscar Peterson We Get Requests Rar Oscar Peterson Trio. Technically, the album is filled with above- average melodic development and solid rhythmic blend, while the repertoire is a crowd- pleaser. The listener is treated to a tasteful mixing of current pop tunes, standards and originals. Pianist Oscar Peterson has long been such a consistent performer that none of his records are throwaways, but this particular set is weaker than most. Since several of the songs are the type that in the mid-\'60s would get requested (such as \'People,\' 'The Girl from Ipanema,\' and \'The Days of Wine and Roses\').

    • The receive hardware can be a simple shift register

    • It supports multiple slaves

    Disadvantages of SPI:

    \'Spi\'
    • It requires more signal lines (wires) than other communications methods

    • The communications must be well-defined in advance (you can\'t send random amounts of data whenever you want)

    • The master must control all communications (slaves can\'t talk directly to each other)

    • It usually requires separate SS lines to each slave, which can be problematic if numerous slaves are needed.

    Further Reading

    Check out the Wikipedia page on SPI, which includes lots of good information on SPI and other synchronous interfaces.

    This page presents a more correct way to set up an SPI network amongst your embedded devices, particularly for use with an Arduino microcontroller.

    A number of SparkFun products have SPI interfaces. For example, the Bar Graph Breakout kit has an easy-to-use SPI interface that you can use to turn any of 30 LEDs on or off.

    Other communication options:

    Serial Communication

    Asynchronous serial communication concepts: packets, signal levels, baud rates, UARTs and more!

    Analog to Digital Conversion

    The world is analog. Use analog to digital conversion to help digital devices interpret the world.

    I2C

    An introduction to I2C, one of the main embedded communications protocols in use today.

    AST-CAN485 Hookup Guide

    The AST CAN485 is a miniature Arduino in the compact form factor of the ProMini. In addition to all the usual features it has on-board CAN and RS485 ports enabling quick and easy interfacing to a multitude of industrial devices.

    Now that you’re a pro on SPI, here are some other tutorials to practice your new skills:

    MP3 Player Shield Music Box

    Music Box Project based on the Dr. Who TARDIS.

    Using the Serial 7-Segment Display

    How to quickly and easily set up the Serial 7-Segment Display and the Serial 7-Segment Display Shield.

    SparkFun BME280 Breakout Hookup Guide

    A guide for connecting the BEM280 sensor to a microcontroller, and for using the Sparkfun Arduino library.

    Raspberry Pi SPI and I2C Tutorial

    Learn how to use serial I2C and SPI buses on your Raspberry Pi using the wiringPi I/O library for C/C++ and spidev/smbus for Python.

    In your journey hacking, modding and making electronics you will bump into many a FLASH chip. Often times these store program memory, settings, data files etc. Some microcontrollers have built-in flash, but an external flash chip allows for field-updating. Also, fitting a large Flash chip inside a micro or FPGA can increase cost a lot, where-as having it be external lets the customer pick exactly the right size they need. They can range from 256 bytes up to 16 MBytes or even more!

    SPI Flash Standardization

    The good news is that just about every 8-pin Flash chip has a standard pinout and SPI interface, these tend to have the number 25 somewhere in the beginning of the part number. There are also ones that are only I2C - these will have the number 24 somewhere in the part number. This page is just about SPI flash.

    \'Spi

    As you can see, SPI flash part numbers tend to start with \'MX25\' or \'W25\' or \'AT25\' or \'SST25\' etc. The first two letters are the manufacturer name.

    The rest of the part number will also contain a 3 digit number that indicates the size in \'kilobits\' or \'megabits\'. E.g. 010 is 1-Megabit (128 KByte), 080 is 8-Megabit (1 MByte), 016 is 16-Mbit/2MByte. For smaller sizes, all 3 digits are used. E.g. 256 is 256-Kbit (32KByte),

    Not only do they have a standard pinout, but there is also a standard-ish set of commands you can use to read and write the data. So, if your flash memory chip has this pinout, chances are you can use a standard command set to program it.

    If you want to use an microcontroller..

    If you have an Arduino or compatible, check out our libraries (https://github.com/adafruit/Adafruit_SPIFlash or https://github.com/adafruit/Adafruit_TinyFlash) on how to read/write to/from these in a mcirocontroller

    HOWEVER

    you are here because you do not want to mess with an Arduino - your file that you want to read/write is on your computer, and its big so getting it into a microcontroller is a pain. Instead, in this guide we will use an FT232H as a \'gateway\' so that you can use any computer and read/write the SPI flash through the command line.

    You will need the FT232H breakout, and if you have a chip in a package that is not breadboard-able right away you will need a socket or an adapter board.

    Adafruit FT232H Breakout - General Purpose USB to GPIO, SPI, I2C

    Wouldn\'t it be cool to drive a tiny OLED display, read a
    IN STOCK

    3.3V 250mA Linear Voltage Regulator - L4931-3.3 TO-92

    Need a nice little 3.3V regulator? We rather like the very-low-dropout L4931 from ST! This little guy will help you get your 4-20V battery or wall adapter down to a nice clean 3.3V..
    IN STOCK

    10uF 50V Electrolytic Capacitors - Pack of 10

    We like capacitors so much we made a kids show about them. ..
    IN STOCK

    SMT Test Socket - SOIC-8 Narrow Breakout

    You know those ZIF sockets we have for DIP chips? Well these are just like that but for SMT parts! Yeah, that\'s right, now you can program and test out your favorite new parts in..
    IN STOCK

    SMT Breakout PCB for SOIC-8, MSOP-8 or TSSOP-8 - 6 Pack!

    Beguiled by a fancy new chip that is only available in a SOIC or MSOP/(T)SSOP pinout? This breakout PCB set will make your life much much easier and get you prototyping faster than..
    IN STOCK

    If you\'re using Windows, you will need to follow these instructions to set up the Zadig tool and replace the default FTDI driver. Make sure you do this step!

    We have adapted a helper program for FPGAs. You can check out our version from github.

    The easiest way to get started is to just download a zip of the repository:

    Uncompress the zip folder. If you are on mac or linux you will need to install the FTDI library and build the executable. Check out the FT232H guide on where to download those files. For Windows, we provide the .exe already

    Because SPI flash chips run at 3.3V, you will need to regulate the 5V supply on the FT232H down.

    Using the L4931-3.3 regulator, make the connections shown in the diagram below.

    Make sure to add a 10uF capacitor from the regulator output to ground for stability!

    Wire up your FT232H breakout to your flash chip like this (use a socket or an adapter board if it is not a DIP package)

    • D0 on the FT232H to pin 6 on the flash
    • D1 on the FT232H to pin 5 on the flash
    • D2 on the FT232H to pin 2 on the flash
    • D4 on the FT232H to pin 1 on the flash
    • pin 3 (Write Protect) on the flash to 3.3V. If you are only reading from the Flash, you can connect this to ground.
    • pin 4 (VSS ground) on the flash to ground
    • pin 7 (HOLD) on the flash to 3.3V
    • pin 8 (VCC power) on the flash to 3.3v

    Run the executable from the folder you downloaded. The argument it takes is the path to the binary file you want to write to the flash. An example might look like this

    That\'s it!

    This guide was first published on Jul 03, 2017. It was lastupdated on Jul 03, 2017.This page (Overview) was last updated on Feb 19, 2020....'>Spi Serial Flash Programmer Schematic Definition(05.02.2020)