element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Embedded and Microcontrollers
  • Technologies
  • More
Embedded and Microcontrollers
Blog Easy Programmable Analog and Digital Circuits: A First Experiment with Renesas GreenPAK
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Embedded and Microcontrollers to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: shabaz
  • Date Created: 23 Aug 2024 6:42 PM Date Created
  • Views 1720 views
  • Likes 14 likes
  • Comments 11 comments
  • USB-to-I2C
  • SLG47004V
  • greenpak
  • pico
  • renesas
  • mixed-signal
  • pi pico
Related
Recommended

Easy Programmable Analog and Digital Circuits: A First Experiment with Renesas GreenPAK

shabaz
shabaz
23 Aug 2024

Table of Contents

  • Introduction
  • QFN Adapter Board
  • Designing Blinky
  • Simulation
  • Building the Circuit
  • Using the Pi Pico as a SLG47004V Programmer
  • Programming the GreenPAK chip
  • Summary

Introduction

The Renesas GreenPAK family of integrated circuits is interesting; they contain a mix of digital circuitry, such as flip-flops, counters, and logic gates, plus analog circuitry that can include op-amps and comparators. All of these internals can be connected together under command from an I2C serial bus and programmed into the built-in storage inside the chip.

image

I have not used GreenPAK devices before. This blog post describes my first ‘blinky’ level of experiment, to achieve a square wave output from one of the pins! This blog post contains the detail to follow along, and also try out circuits for yourself with minimal hardware needed.

image

To get there, we need to design the blinky circuit, simulate it, and then generate the output binary ‘bit file’ (it is actually a text file containing the binary values) that needs to be programmed into the non-volatile memory (NVM) inside the chip. The GreenPAK chip is programmed using I2C. A Pi Pico will be used as the programmer tool, with some Python code running on the PC to transfer the NVM file contents.

image

If you wish to replicate the experiment, you don’t need any hardware to perform the design and simulation. After that, you’ll need the SLG47004V  GreenPAK chip (it is in a surface-mount QFN package so an IC adapter is needed), and a Pi Pico  to act as the USB-to-I2C programmer. If you don’t have the hardware but have an interesting design simulated, please send it to me, and I’ll try it out and post the results!

QFN Adapter Board

An off-the-shelf QFN adapter board could be used, alternatively, there are Adapter Board Gerber files that can be sent to any PCB manufacturer.

image

There is space on the underside for soldering passives to the ground or adjacent pins if required. I used the space to solder decoupling capacitors (100nF across the digital supply pins, and 10uF across the analog supply pins), and connecting the analog and digital ground pins together with zero-ohm resistors.

image

Then, the board can be used with usual SIL pin headers or soldered to a 24-pin DIP IC-style header, as shown in the photo below.

image

Designing Blinky

Install Renesas Go Configure Software Hub, and then when it starts up, select the SLG47004V and double-click the part number.

image

A Project Settings window will appear. I want the circuit to operate at 3.3V and at room temperature, so I set the values accordingly, and then pressed OK.

image

A GreenPAK Designer window appears with a black area in the center for schematics. There are panes on the left and right side. The left side initially shows a pane containing components external to the chip. The right side has a Components list that contains things that are internal to the chip (you have to scroll down inside the Components list to see them).

The center schematic area shows the chip pins around the outside, and some circuit elements are already drawn. I ignored those for now.

The schematic is zoomed by holding down Ctrl and using the mouse scroll wheel. The display is panned by holding down the mouse center button and moving the mouse.

image

I selected the OSC0 component (it’s an oscillator!), and a green box appeared in the schematic, as shown in the screenshot above. I dragged it toward the desired output pin.

If you hover your mouse over the OSC0 component in the schematic, you’ll see all the input and output connections annotated. The color code is simple.

Green nodes provide connections that the user can make; click on a node, and a dotted elastic wire will be attached to the cursor. Click on another node, and a green wire will automatically be routed and drawn.

The user cannot make connections to orange items in this way. Orange means that something else must be configured, and then the connection will be automatically made. For instance, some op-amp connections may be dedicated to specific pins on the chip. The op-amp first needs to be configured to be powered on (perhaps by connecting a green power enable connection first), and then the remainder of the connections will be automatically drawn to the allowed pins in orange.

At the bottom of the left pane, you can click on Properties to examine what you can do with the OSC0 component (or just double-click on the OSC0 component in the schematic, and the left pane will automatically display the properties).

image

As seen in the screenshot above, I forced the oscillator on (it has a frequency of 2.048 kHz) and then selected to divide by 8 and 64 to achieve 4 Hz (a fast blinky). Then, I clicked on Apply by scrolling to the bottom of the properties list, clicked on the oscillator OUT0 node to see the dashed elastic line, and clicked on Pin 18. The blinky circuit is now complete!

Optionally, for the simulation, you could add an external resistor (to act as a load) onto pin 18, but it’s unnecessary. I saved the circuit at this point. Now, it’s time to simulate!

image

Simulation

Click on the green triangle Debug icon at the top, and then click on Software Simulation. Now you’ll be able to add virtual ‘scope probes by right-clicking on a node and selecting Add Probe. I decided to simulate for 4 seconds, with a step size of 1 ms.

image

Click on Simulate. After a few seconds, you’ll see the oscilloscope output! The first two charts are labelled V1 and V2 and they represent the voltage at the VDDA and VDD pins (if you zoom out in the schematic, you’ll see those pins are pre-attached to V1 and V2 voltage sources). The third chart shows the output for the user-added probe.

image

That looks pretty good, so it’s time to try it for real. Click on File->Export->Export NVM and save to a file called (say) blinky.txt. The file contains three columns of values for a total of 2048 binary bits (i.e. 256 bytes). That’s the size of the configuration NVM inside the chip.

Building the Circuit

The diagram here shows what was assembled.

image

Check out the separate blog on the topic of how to convert a Pi Pico into a USB-to-I2C adapter.

image

Using the Pi Pico as a SLG47004V Programmer

Download greenpak-utils from GitHub which contains the Python gp_prog.py GreenPak programmer code. 

When you run it, a menu will be displayed (you’ll get an error message if you run it without the USB-to-I2C adapter connected):

image

The GreenPAK device internally contains 256 bytes of general-purpose EEPROM and 256 bytes of NVM, which stores the configuration generated by the Renesas software.

The program is arranged to work with three sources/destinations of data:

(a) The GreenPAK device memory (either NVM or EEPROM)

(b) Files of data on the PC (either bit-files generated by the Renesas development environment or raw 256-byte files

(c) A 256-byte RAM buffer on the PC

The gp_prog Python code allows the data (a) (b) (c) listed above to be transferred in any direction, e.g. send (a) to (b), but (c) is always used as an intermediary.

For example, if you wish to transfer data from a raw binary file on the PC to EEPROM, then you’ll need to first transfer it to the RAM buffer on the PC and then transfer that buffer into the EEPROM. Here’s what you’d see and type to perform such an operation:

*** Menu ***
GreenPAK<->Local Buffer device operations:
1. Read EEPROM into buffer
2. Write buffer to EEPROM
3. Read NVM into buffer
4. Write buffer to NVM
File<->Local Buffer operations:
5. Retrieve GreenPAK bit file into buffer
6. Store buffer to GreenPAK bit file
7. Retrieve Raw Bytes File into buffer
8. Store buffer to Raw Bytes File
9. Retrieve Dickens content into buffer
Enter choice (1-9)
>7
Enter the raw bytes file name to read (e.g. rawbytes.bin):
testraw.bin
Data from file 'testraw.bin' in hex format:
00: 68 6f 6d 65 73 3f 20 57 68 61 74 20 77 61 73 20 : homes? What was
10: 6d 65 72 72 79 20 43 68 72 69 73 74 6d 61 73 20 : merry Christmas
20: 74 6f 20 53 63 72 6f 6f 67 65 3f 20 4f 75 74 20 : to Scrooge? Out
30: 75 70 6f 6e 20 6d 65 72 72 79 20 43 68 72 69 73 : upon merry Chris
40: 74 6d 61 73 21 0a 57 68 61 74 20 67 6f 6f 64 20 : tmas!.What good
50: 68 61 64 20 69 74 20 65 76 65 72 20 64 6f 6e 65 : had it ever done
60: 20 74 6f 20 68 69 6d 3f 0a 0a 22 54 68 65 20 73 : to him?.."The s
70: 63 68 6f 6f 6c 20 69 73 20 6e 6f 74 20 71 75 69 : chool is not qui
80: 74 65 20 64 65 73 65 72 74 65 64 2c 22 20 73 61 : te deserted," sa
90: 69 64 20 74 68 65 20 47 68 6f 73 74 2e 20 22 41 : id the Ghost. "A
a0: 20 73 6f 6c 69 74 61 72 79 20 63 68 69 6c 64 2c : solitary child,
b0: 0a 6e 65 67 6c 65 63 74 65 64 20 62 79 20 68 69 : .neglected by hi
c0: 73 20 66 72 69 65 6e 64 73 2c 20 69 73 20 6c 65 : s friends, is le
d0: 66 74 20 74 68 65 72 65 20 73 74 69 6c 6c 2e 22 : ft there still."
e0: 0a 0a 53 63 72 6f 6f 67 65 20 73 61 69 64 20 68 : ..Scrooge said h
f0: 65 20 6b 6e 65 77 20 69 74 2e 20 41 6e 64 20 68 : e knew it. And h
*** Menu ***
GreenPAK<->Local Buffer device operations:
1. Read EEPROM into buffer
2. Write buffer to EEPROM
3. Read NVM into buffer
4. Write buffer to NVM
File<->Local Buffer operations:
5. Retrieve GreenPAK bit file into buffer
6. Store buffer to GreenPAK bit file
7. Retrieve Raw Bytes File into buffer
8. Store buffer to Raw Bytes File
9. Retrieve Dickens content into buffer
Enter choice (1-9)
>2
Are you sure you want to write to the EEPROM? (y/n)
y
Erasing entire eeprom...
Writing 256 bytes to the eeprom...
*** Menu ***
GreenPAK<->Local Buffer device operations:
1. Read EEPROM into buffer
2. Write buffer to EEPROM
3. Read NVM into buffer
4. Write buffer to NVM
File<->Local Buffer operations:
5. Retrieve GreenPAK bit file into buffer
6. Store buffer to GreenPAK bit file
7. Retrieve Raw Bytes File into buffer
8. Store buffer to Raw Bytes File
9. Retrieve Dickens content into buffer
Enter choice (1-9)
>

For test purposes, for convenience, there is a menu option 9 which fills the RAM buffer with random text from A Christmas Carol.

Programming the GreenPAK chip

Now that the programmer has been described, here are the steps to program a chip.

Select menu option 5, and enter the name of the bit-file saved by the Renesas development environment earlier (e.g. blinky.txt). The data will be read into the gp_prog software RAM buffer mentioned earlier.

Next, select menu option 4 and press ‘y’ when prompted to confirm the write operation. Within seconds, the NVM will be programmed.

Power-cycle the chip, and the configuration will begin execution. If all is well, pin 18 will have a square wave; an attached LED (with a current-limiting resistor) should be blinking!

Summary

The Renesas Go Configure Software Hub is very easy to use to design and simulate a circuit. A simple blinky circuit was designed, and then the physical circuit, consisting of the Renesas GreenPAK chip and an LED, was assembled. It was attached to a USB-to-I2C adapter, and Python software was used to program the chip to achieve the blinking result.

The GreenPAK chip contains a lot of interesting analog and digital functionality that can be explored.

If you found it interesting too and wish to try it out, you'll need a Pi Pico, a SLG47004V chip, and a 0.4 mm TQFN 24-pin breakout board. Alternatively, there are ready-made eval boards for the chip.

Thanks for reading!

  • Sign in to reply
  • shabaz
    shabaz 10 months ago in reply to manojroy123

    I saw some app-note regarding a 10 MHz frequency counter, I don't know if that's a limit, or if that was just a round number they chose for the app-note. A pre-scaler could increase that.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • manojroy123
    manojroy123 10 months ago

    Can it be programed to works as frequency counter if so, what is the maximum frequency it can detect.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz 10 months ago in reply to manojroy123

    Yes I think that's feasible. I saw some app note earlier that used the GreenPAK devices as a voltmeter. They used one chip per digit. There are 4-input look-up tables that are easily configured, so they can be used for 7-segment LEDs. But for granularity and precision it would be better to use a microcontroller and ADC, since there are limits to this $1 part.

    I've been messing with a decoder to make an electronic dice using the LUTs, just as an experiment to see how things work. I've simulated that but will hopefully try it for real in the next day or two.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • manojroy123
    manojroy123 10 months ago

    Can a BCD decoder circuit be made from the Green PAK ic that get interfaced with the their build in ADC.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz 10 months ago in reply to manojroy123

    I don't have a full answer to that, but the Renesas website has about 300 app-notes for the various GreenPAK chips.

    From what little I know so far, I think the parts could be useful for very low-power applications (since there's no processor), e.g., permanently on, perhaps monitoring batteries and waking up a microcontroller to send an alert. I think it could also handle user input from a few buttons, maybe even implement a charger, or provide supervision since there's a built-in reference and temperature sensor.

    If you've got circuitry that needs a few logic ICs and some op-amps, then replacing them with GreenPAK could eliminate a lot of space. The price is low (less than $1 in quantities of a few hundred), and they are simple to configure over I2C.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube