Realized it’s a bit hard to work on the charger mechanisms because I’m rather unfamiliar with how the charging docks, power delivery and things like that work, so I looked into that first. Found a nice article explaining some key considerations for selecting a good charging dock, and the main points such as having a power rail, cooling, status indicators, and certain physical retention designs are good inspiration. I think I much better understand what I have to do to charge, but the STM32C0 doesn’t have USB-PD negotiation support, so I’m switching to a STM32G0. Unfortunately it’s close to double the cost but it’s worth it for the power delivery and added I/O pins. OK rip the initial STM32G0 I found actually is too cheap it doesn’t have the UCPD peripheral that’s required so I need another MCU (again).
Also, I realized that the user shouldn’t need to replace the battery since it will recharge, so I can just directly use a 18650. I swapped back the battery holder in my schematic too.
I came up with a method of charging things – the STM32G0 will request the total required voltage based on the number of devices it senses, and then the total voltage will be split into the separate voltages required for each part. I ran that by AI, and it turns out I need to use buck converters to step down the voltage which makes sense since parallel circuits will still have the same amount of voltage drop.
I researched a bit and it turns out that USB 2.0 and 3.0 are pretty much equally slow for USB A ports, so I decided to go with a 2.0 one for the price. That’s because the STM32G0 only has enough for 2 sets of CC pins so having my second USB port be a USB A instead of a USB C will allow a second device to charge at 5V without needing to negotiate anything.
Ok I pretty much figured out what I have to do, and the next session, I’ll get to wiring everything I learnt today! Plus searching for valid buck converters that can provide variable amounts as controlled by the MCU