After the small set back with the bell ringer I decided to work on another part of the project for a bit. Scanning of the keypad matrix. For this I've decided to use a greenpak device, the SLG46826V.
The SLG46826V is one of the MTP devices (Multiple time programmable) it's NVRAM can be written to 1000 times. This allows you to perform in-circuit updates of the chip if for example a design fault is found.
Here is the block diagram of the device. Image is from the datasheet.
There are 3 memory spaces, Register, NVRAM and an emulated EEPROM which can be used to store calibration data, settings and other things.
The emulated EEPROM is seperate and acts kinda like a I2C EEPROM and is not usable by the SLG46826V alone but it could remove the need for an EEPROM on your board. It does however have the same 2Kbits of memory with 1000 times writable as the NVRAM. It features write protect for all or certain parts of the emulated EEPROM memory space which can be made permanent read only if you want.
You can change register settings while the device is operating which means that you can alter settings using a MCU for example. This allows you to do many cool things. Which is why I got interested in greenpaks when I first discovered their existance. If you are interested check out their GreenPak cookbook.
The 10 year counter example in the cookbook is a bit scary and hopefully will not be used to make designs that will brick the device shortly after the warranty ends. Skeptical me comes out sometimes. Hopefully that type of design only used for counting when a AED battery or something like that should be changed.
Anyways...
The offical debug tool for the SLG46826V isn't very cheap so I decided to not get it. The SLG46826V like other greenpaks are setup through I2C. First I thought about using my Beagle bone black as an interface for it. Then I found the MCP2221A which is interesting so I ordered one. After I ordered the device I looked at the offical tool from renesas and it also uses a MCP2221A. Although the renesas debug tool have all the protection you'd want, there is probably a joke to be made here but I'll refrain this time. I can still use their software to make the design for the SLG46826V and then extract the data needed to program it through any I2C interface. However it introduces another step but it also offers more learning opportunities. Why take the easy road when the hard road looks more fun.
I wired my design together on a breadboard but I didn't have a capacitor needed to use USB bus power to power the device. So I decided to use a 3.3V LDO to power it instead. It does remove the need for the levelshifter but I will use it anyway.
At first the circuit didn't work because stupid me put the 3.3V LDO backwards which was easily fixed and it works like a charm.
Here it is my creation.
USB-C module splits out BUS voltage, GND and the signals D+ and D-.
The 3.3V LDO(NJW418U3) powered from the bus powers the MCP2221A and the first LED from the left tells that the device is powered.
Second LED from the left tells if the USB connection is configuring, it turns off when the configuration is complete.
The LED furthest to the right tells if there is communcation on the I2C bus, it's on when the bus is idle, it turns off when communcation is happening on the bus.
The I2C connection goes through a FXMA2102 for level shifting but not really neccessary in my case, it was going to be used to level shift the I2C to 3.3V if the MCP2221A was bus powered.
I made a cable for it by using cables ripped off from a rainbow ribbon cable and with a tiny screwdriver I removed the QI pins from the housing and put them into a 4pin housing instead. This makes it easy to plug into the SLG46826V module.
While working with the MCP2221A and SLG4682V alot of feature creeps showed up, they talked all about why not make an awesome commandline tool for the MCP2221A and while your at it make your own cool GUI program to make SLG46826V greenpak designs. Then some of the creeps talked about making a framework computer I2C/UART expansion card using the MCP2221A, a FXMA2102 levelshifter and an ADuM121N. I was like "I don't even own a framework computer yet, why even suggest such a thing". I had to turn them all down as my time is very limited. One of the creeps then yelled at me "You can have a QWIIC connector on it for god sakes!" Disappointed they all walked back to the dark corner they came from and hopefully leave me alone for now.
With the feature creeps gone I got communication working with the MCP2221A using the HID protocol and a rust program I wrote using rusb. I've learned many new things. Playing around with the SLG46826V will be fun.
I need to make a greenpak design, add components and then test my code that set the registers. Then test the code that writes to the NVRAM and emulated EEPROM.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.