What's new

Worklog PowerStripHavoc Worklog

Joined
Mar 22, 2021
Messages
107
Likes
50
Location
Germany
Hello everyone, I have been working on a regulator board similar to Yveltals Thundervolt and used loopj's powerstrip as a PCB outline guide for my board.

Essentially, what it is is an RVL-PMS, but on top of the Wii and with undervolted power rails that should be in the safe zone according to the undervolting docs.

I have received the PCBs and parts and have assembled them.
IMG_20241001_211714.jpg

Today, I tested whether or not it would work aaaand it didnt.
I can succesfully program it(well at least according to avrdude), but I cant really tell if my code is running properly. I have set the EN_Pin of the regulators to be permanently HIGH, but they only output 500mV, except for the 5v reg, which outputs 3.5v. The BQ chip works fine as far as I can tell and the attiny gets the voltage hes supposed to from the BQ chip.
I didnt have the time to investigate this further and I also need to get a second serial to usb adapter to program and communicate with the board at the same time.
If anybody has some clues as to why this is happening, please chime in!

You can find the project at my github repo: https://github.com/MertX2/PowerStripHavoc/blob/main/README.md
 
Joined
Mar 22, 2021
Messages
107
Likes
50
Location
Germany
Well, Ive modified the firmware to only turn on the regs, reflowed the enitre pcb, fixed my mistake of not connecting the ground of the left side of the board(it was supposed to use the gnd of the wii, this was the only way to make this a 2 layer board). I will try and assemble another board and see if this one was just unlucky.

Also, Im not sure whether I have placed my regs in the correct orientation.

EDIT: Holy fuck it totally was the regs being in the wrong orientation.
All regs except 5v are confirmed working now, will test the firmware tomorrow.
 
Last edited:
Joined
Mar 22, 2021
Messages
107
Likes
50
Location
Germany
Replaced the 5v reg and its inductor,so all regs are working now.

My firmware can succesfully program the bq chip, which I can check by simply reading any of the non standard values that Ive written to the registers of the bq chip. Alas, my firmware still has quite a few bugs, namely the values for my input current and vbus and vsys voltage are completely wrong, so I'll have to debug those functions.
Also, I was too lazy/cheap to order a usb to serial converter, so I constructed this abomination:
IMG_20241005_165222.jpg

The CH340 on the Wemos D1 Mini is the programming serial adapter, the RP2040 Zero(which I had left over from doing picofly installs) is the serial read adapter. Also featured is a harvested lidl 2000mah 18650 with my patented QuickConnect functionality.
 
Joined
Mar 22, 2021
Messages
107
Likes
50
Location
Germany
Figured out why my code wasnt working properly, turns out I had my bits in the wrong order in my code, because the datasheet of the bq confused me
1728491940198.png

This for example says that reg02 should be 10111100 in the default config, but I read it as 00111101, which means I'll have to rewrite my firmware according to that, which Im not looking forward to.
 
Joined
Mar 22, 2021
Messages
107
Likes
50
Location
Germany
Well it has been a while since I had time to work on this, my firmware still isnt working correctly, because every write returns an error and every read returns 255. I have a suspicion that the Wire implementation in megatinycore is slightly different to the official wire library, so I will rewrite my communication code after consulting the Wire source code and its readme file which I only skimmed over previously.

Also, does anyone know if the BQ chip expects the registers to be written in a specific order or can I just write them how I like?
 

YveltalGriffin

First Wii U Trimmer
.
Joined
Jun 7, 2016
Messages
385
Likes
1,651
Location
South Florida
Portables
5
You're using an ATtiny1616, right? Might as well reuse the Thundervolt codebase. @loopj wrote some super clean and easy-to-use I2C routines for the ATtiny, and there are example drivers for regs, temp sensors, and more already in there.

It uses Platformio, which integrates right into VS Code. All you have to do is install the Platformio extension, clone the repo, and open the folder containing the platformio.ini.

You don't need to write BQ regs in any specific order, but to keep your code sane, just write to the registers in numeric order. (Note: sometimes you do need to write registers in a specific order, like setting up parameters before enabling something else. That just doesn't apply to the BQ in this situation.)
 
Joined
Mar 22, 2021
Messages
107
Likes
50
Location
Germany
Yes I am using the Attiny1616, I could use your firmware but to be honest Im not that good in c and I dont really understand what registers have to be set on the attiny for certain things to work, so megatinycore is a whole lot easier to use for me as its very close to arduino like code.
For example I really struggled to setup an interrupt using the registers as I dont really understand bitwise operations quite yet, so I would like to stay in the arduino framework if possible.

Good to know that the BQ doesnt care about the register order, I was very confused because the datasheet also didnt mention anything like that and I thought that that might be it. I have made some adjustments to my i2c code now, so I will test that tomorrow after work.
 
Joined
Mar 22, 2021
Messages
107
Likes
50
Location
Germany
Had a pretty exhausting day at work today(mostly because I couldnt sleep), so I didnt really have the energy to work on this much, but I got it working in the end.
SerialReadWiiHavoc.png

I dont expect yall to go through the trouble of comparing the values, but the gist of it is that most of the registers read back exactly like they were written. Some dont, I dont know why but I will figure it out. Also managed to solder some ffc connectors for rev3 of my gc+ board.
 
Top