In this project, we show how to use the SLG46824 / SLG46826 Arduino programming sketch to program a Dialog SLG46824/6 GreenPAK™ Multiple-Time Programmable (MTP) device. 

Most GreenPAK devices are One-Time Programmable (OTP), meaning that once their Non-Volatile Memory bank (NVM) is written, it cannot be overwritten. GreenPAKs with the MTP feature, like the SLG46824 and SLG46826, have a different type of NVM memory bank that can be programmed more than once.

We’ve written an Arduino sketch that allows the user to program an MTP GreenPAK with a few simple serial monitor commands. In this project we use an SLG46826 as our GreenPAK with MTP.

We provide sample code for the Arduino Uno using an open-source platform based on C/C++. Designers should extrapolate the techniques used in the Arduino code for their specific platform. 

For specific information regarding I²C signal specifications, I²C addressing, and memory spaces, please reference the GreenPAK In-System Programming Guide provided on the SLG46826 product page. This project description provides a simple implementation of this programming guide.

Below we described steps needed to understand how the IC has been programmed. However, if you just want to get the result of programming, download GreenPAK software to view the already completed GreenPAK Design File. Plug the GreenPAK Development Kit to your computer and hit the program to design the solution.

Arduino-GreenPAK Connections

To program the NVM of our SLG46826 GreenPAK with our Arduino sketch, we'll first need to connect four Arduino Uno pins to our GreenPAK. You can connect these pins directly to the GreenPAK Socket Adapter or to a breakout board with the GreenPAK soldered down.

Please note that external I²C pull up resistors are not shown in Figure 1. Please connect a 4.7 kΩ pull up resistor from both SCL and SDA to the Arduino’s 3.3 V output.

Exporting GreenPAK NVM Data from a GreenPAK Design File

We'll put together a very simple GreenPAK design to illustrate how to export the NVM data. The design below is a simple level shifter where the blue pins on the left are tied to VDD (3.3v), while the yellow pins on the right are tied to VDD2 (1.8v).

To export the information from this design, you need to select File → Export → Export NVM, as shown in Figure 3.

You will then need to select Intel HEX Files (*.hex) as the file type and save the file.

Now, you'll need to open the .hex file with a text editor (like Notepad++). To learn more about the Intel’s HEX file format and syntax, check out its Wikipedia page. For this application we’re only interested in the data portion of the file as shown in Figure 5.

Highlight and copy the 256 bytes of NVM configuration data located within the HEX file. Each line that we are copying is 32 characters long, which corresponds to 16 bytes.

Paste the information into the highlighted nvmString[] section of the Arduino sketch as shown in Figure 6. If you’re using a non-Arduino Microcontroller, you could write a function to parse the nvmData saved in the GreenPAK .GP6 file. (If you open a GreenPAK file with a text editor, you’ll see that we store project information in an easily-accessible XML format.)

To set the EEPROM data for your GreenPAK design, select the EEPROM block from the components panel, open its properties panel, and click "Set Data."

Now you can edit each byte in the EEPROM individually with our GUI interface.

Once your EEPROM data is set, you can export it to a HEX file using the same method described previously for exporting the NVM data. Insert these 256 bytes of EEPROM data into the eepromString[] section of the Arduino sketch. 

For each custom design, it is important to check the protection settings within the “Security” tab of the project settings. This tab configures the protection bits for the matrix configuration registers, the NVM, and the EEPROM. Under certain configurations, uploading the NVM sequence...

Read more »