I spent most of these past two weekends ( thanks to robertlong13 for answering my questions around ADCs, how they work in microcontrollers, and many more tips for getting starting with PIC programming) modifying the UAMP source code to allow the thumbwheel potentiometer to set an ADC value to control volume levels. This is acheived by reducing the resolution of the ADC values to match those of the volume output. The ADC can read a 10-bit value between 0 and 1023 (VCC), but we only require the ADRESH register to hold 8-bits (5 for volume, 3 for hysteresis). We implemented the hysteresis function to make sure that volume doesn't randomly bounce between steps when you turn the wheel. I also added a short line to make sure that the volume can only be changed if the pot value is different from the previous value set in software (probably overkill here but I did it anyways by declaring prev_pot_value as 0 and writing this to the amp before the first write loop). I also made some changes to change the RGB LED to always on when the system is powered (light blue) and switch to red on low battery. An orange LED is connected to a GPIO pin that detects when the charger is plugged in to show charging status.
This is pretty much it for the CAD work now. I've integrated most of the stuff that I need (apart from Z-buttons), including conducting test prints to check for overall tolerances. The PCB will cost me around $45 from JLCPCB with a stencil which is pretty neat, as well as the BOM being about 65$, so about $110USD for that in total. Next step is to trim an OMEGA, relocate all the things, and try and get something to boot.
I know I am probably acting pretty early but the quicker I can verify a working trim the quicker I can focus on starting the build!
General overview of the front of the portable. All of the buttons will be resin printed in white, along with white switch analog sticks.
Thumbwheel potentiometer to control volume levels. Spin it clockwise to turn up volume, for volume down, anti-clockwise.
I am using these very low-profile tactile switches for the DPAD, ABXY and dual start buttons (thanks to GC+ 2.0 functionality). They are really low profile. Gman has used these in several of his projects with good success. You can find them here:
https://www.digikey.com/product-detail/en/e-switch/TL3315NF100Q/EG4620CT-ND/1870400
Here is the portables vertical stackup. The case will house a 4 layer PCB with everything on it as I mentioned in the above post. The switch stick FFC connectors wouldn't fit on the other side, so I made an indent in the case for them so that the buttons can remain flush with the case. (Ignore the positioning of the pot (and the connectors, woops lol) for now, I need to change that!))
The diffusers will be 3D printed in transparent filament. They probably won't be 100% clear unless I resin printed them, but they should act as a decent "light pipe" to diffuse the light well. The top LED is for charging, the bottom is for power indicator/low battery indicator.
Front View:
Back view:
More to come!