USBC charging for a PS3 Controller

Everyone knows how annoying it is to charge PS3 controllers, you have to have them plugged into a PC or the PS3 itself powered on, well I attempted to work around that.

The solution

A while ago, I came across this Github project thats aimed to solve this issue by using an ATmega chip and USBC. The PS3 controllers use USB handshakes before they will start to charge, which is why only a PC or PS3 will charge them. This github project, uses the ATmega chip to initiate the USB handshake and the start charging up to 4 controllers via a USBC input.

Safe to say, the project was more annoying that I expected it to be. It uses 0402 SMD parts and an annoying way to program the chip using pogo pins ( of which you needed to make a custom adapter for, AND the you still had to solder on wires anyway. I think in future the PCB should be redesigned to use normal pins for programming as there is actually enough space.

Programming

This was buy far the worst part of the project, the github had very little detail on how to actually program these chips and to get the 12mhz internal clock signal calibrated correctly. I did ask some questions on the github but ended up writing my own instructions.

STEP 1: Connect the Programmer
Make sure your programmer is wired to the ATmega328PB correctly:
MISO → MISO (pin 18)
MOSI → MOSI (pin 17)
SCK → SCK (pin 19)
RESET → RESET (pin 1)
VCC → VCC (pin 7 or 20)
GND → GND (pin 8 or 22)

STEP 2: Check Current Fuse Settings
Open your terminal and run:

avrdude.exe -C”avrdude.conf” -v -patmega328pb -cusbasp -U lfuse:r:-:i -U hfuse:r:-:i -U efuse:r:-:i:i

You’ll get something like:
lfuse: 0x62
hfuse: 0xD9

STEP 3: Calculate New LFUSE with CKOUT Enabled
https://eleccelerator.com/fusecalc/fusecalc.php?chip=atmega328p

That becomes: 0x22

STEP 4: Program the New LFUSE
Run:

avrdude.exe -C”avrdude.conf” -v -patmega328pb -cusbasp -U lfuse:w:0x22:m
Now CKOUT is enabled. The system clock will appear on PB0 (pin 14).

STEP 5: Measure the Clock Output
Connect a frequency counter or oscilloscope probe to PB0 and GND.

You should see a signal close to 12 MHz.
If not exactly 12 MHz, that’s expected — the internal oscillator needs calibration.

STEP 6: Calibrate the Internal Oscillator (OSCCAL)
In your firmware:
Use a loop that outputs a square wave (e.g., toggle a pin).
Adjust the OSCCAL register value (0x00 to 0xFF) until the frequency on PB0 is as close to 12 MHz as possible.

STEP 7: Compile with Atmel Studio 7
Import ps3-charger.c into Atmel Studio and compile to a hex file.
You should enter the clock signal into the source code from earlier

STEP 8: Flash to ATmega328PB
Connect programmer (e.g., USBasp), and flash the new file, for example:

avrdude.exe -C”avrdude.conf” -v -patmega328pb -cusbasp -U flash:w:ps3charger.hex

avrdude -c usbasp -p m328pb -U flash:w:PS3-Charger-C7-250.hex

STEP 9: (Optional) Restore LFUSE to Disable CKOUT
Once calibrated, you can turn off CKOUT to regain use of PB0.
If your original lfuse was 0x62, restore it:

avrdude -c usbasp -p m328pb -U lfuse:w:0x62:m

Files can be found here

Testing them out

After programming them finally, I found that it didnt work very well with just 1 controller plugged in, the timing or capacitance on the USB lines must not be right, 2 controllers always started charging immediately. There is some notes in the schematic to fix that for a new revision they never got around to I guess.

Dualsense Controller Hall-effect Upgrade

Somehow I ended up with a bunch of faulty Dualsense controllers and then a few mates wanted theirs fixed as well, so I ordered up a bunch of them to do them all at once.

Removing and reinstalling

Tearing down the controllers was pretty easy, although I did realise that there is 2 different versions of dual sense controllers already. It is always easier to remove the old sticks with new solder, then a desoldering gun, then hot air out the last of it and they just drop out. If you have good hot air, you could probably do it all in once step.

I got the replacement hall effect sticks from AliExpress, https://www.aliexpress.com/item/1005007688806322.html?spm=a2g0o.order_list.order_list_main.186.785e1802SoJOqZ

The only thing you have to do after you replace them is recalibrate the sticks afterwards. I used https://dualshock-tools.github.io/

Ikea Besta Cooling Fans

This is just a quick little project to put some exhaust cooling fans in my Ikea TV cabinet so the PS5 doesn’t overheat and die. 

Gallery

Just a few photos of the finished product. Its a mashup of 2 STL files, a 2x120mm fan mount and 120mm exhaust funnels. I am using USB to 12V fan adapters.

https://www.thingiverse.com/thing:1745860
https://www.printables.com/model/525851-adjustable-bracket-for-a-120mm-fan
https://www.aliexpress.com/item/1005007600112166.html?spm=a2g0o.order_list.order_list_main.251.785e1802SoJOqZ

Replacing Goteks and Floppy Drives for OpenFlops

So I finally got sick of 3.5″ Floppy drives and modifying the aliexpress gotek clones so i built some of OpenFlops clones that have the OLED screen and rotary encoder in the them and swapped all my machines over.

Putting them together

The project is located here on GitHub: https://github.com/SukkoPera/OpenFlops. The soldering was pretty straight forward, I think the only issue I had was finding parts and finding the STL for them. I ended up using these prints on thingiverse: https://www.thingiverse.com/thing:4760666

Programming

Getting them programmed was also pretty straight forward. I jus followed the guide here https://github.com/keirf/FlashFloppy/wiki/Firmware-Programming#stm32-microcontrollers

Putting LineageOS on a Galaxy Tab 2

A while back I was given an old Android tablet, a Sasmsung Tab 2 10.1 specifically and I had no use for it as the OS was far too old. That was until I had to get a PCIe Diagnostics Card working with an android device and didn’t want to buy one. So in comes custom android.

Installing a custom Rom on the Tab 2

I gave a few options like ExpressoWifi3G and Odin3 working but it never worked, I really wanted Android 8 as people got it working but I had to settle for LineageOS 13 / Android 6. It seemed pretty straight forward once I found the right package. I mostly followed this guide: https://xdaforums.com/t/complete-guide-to-root-and-update-samsung-galaxy-tab-10-1-gt-p5110.4229479/

I think I had to install GApps to get the playstore working on it, to then get the PCIe post card software working. The worst part was the Samsung tablet using a proprietary power cable which took a while to find on AliExpress.

Post Card for reference

https://www.aliexpress.com/i/4000337924298.html