How Can I Use LabVIEW to Automate Programming SPI EEPROMs?

Question from the Customer:

We purchased four Aardvark I2C/SPI Host Adapters for programming SPI EEPROMs (AT25160A series).  I’m having problems getting started – can you help me read and write data to an SPI EEPROM?  I’ve tried using the Control Center Serial Software and Flash Center Software, but so far, no luck getting started.

After I verify the programs, I will need to set up the Aardvark adapters for automated programming. For that environment, I’ll be using LabVIEW.

Response from Technical Support:

Thanks for your questions! We have information about accessing EEPROMs for read/write functions, and how to do so using LabVIEW. We’ll start with enabling the chip for programming, then move on to using LabVIEW.

Enable EEPROM for Programming

To get started, it looks like you’ll need to “unlock” the chip to be able to read and write.  When a chip is inaccessible, it indicates a “restriction” or “protection” mode of the chip has been activated. The data sheets for the chips you are working with should provide information about deactivating the Block Write Protection, which may be through software or hardware. If you have been using a pull-up resistor to access the device, consider using the Chip Select pin of the Aardvark adapter.

For an overview of using Flash Center Software, take a look at Programming SPI Flash Using Aardvark Adapter and Flash Center. For an example of using Control Center Serial software, see Reading Device ID from SPI Flash Using Aardvark Adapter and Control Center.

Using LabVIEW

For your project, using the Control Center Serial Software or Flash Center Software will make it easy to test and verify your software, but neither application supports LabVIEW. Instead, you can create a script using Aardvark Software API and Aardvark LabVIEW drivers. For your automated process, the API allows customization for greater efficiency and speed.

The Aardvark LabVIEW Driver is a free open-source LabVIEW Instrument Driver, which is targeted for Windows. This driver package is based on the Aardvark Software Library, available in the C programming language.

Examples of Using LabVIEW

The Aardvark LabVIEW package includes a functional example, Aardvark Example SPI.vi, which you can customize for your requirements. For information about the API, please refer to the API Documentation section of the Aardvark I2C/SPI Host Adapter User Manual. To become familiar with using LabVIEW, you can use our example of using two Aardvark adapters to communicate with each other via LabVIEW. We have other articles about using LabVIEW. They may use different serial protocols or Total Phase host adapters, but you can adapt the examples as needed for your setup.

Reading Error Codes in LabVIEW

If an error occurs while using LabVIEW, error codes will be remapped per LabVIEW conventions, so it important to note that the codes you see will not match what is listed in the Aardvark User Manual. However, there is a simple formula to translate the remapped codes:

] labview_error_no = 8000 + -1 * user_manual_error_no

We hope this answers your questions. Additional resources that you may find helpful include the following:

If you want more information, feel free to contact us with your questions, or request a demo that applies to your application.

Request a Demo