It’s been a long time since my last update as I have a large number of pressures on my time and I much prefer working on my projects to writing about them!
Some progress has been made, although slower than I would like. Since my last update I have completed the assembly of two prototype control boards. The second was required because during some rework on the first board I managed to lift some pads on the tiny MSOP-8 footprint for the ADC. These pads are really very small, and it is very easy to put just a fraction to much heat into them and lift them from the FR4.
As a result of assembling the two boards I have learnt a number of lessons and identified several improvements for the next revision. Some of key lessons learned have been:
- add test points for all important signals e.g. SPI lines
- orient all ICs in same direction
- add pin 1 indicator on silkscreen
- add component value on silkscreen
- Check, check and triple check the footprint matches the part you have ordered.
Point 5 above seems to be a common mistake, and all things considered I did pretty well for a first attempt. The footprint for my USBLC6-2SC6 was wrong, so USB will have to wait until the rev 2. board. One approach I have read of other people using to avoid these kinds of mistakes is printing the PCB one to one scale and laying the physical parts out on top to double check the footprints. I might try this before I send out my next board for manufacturing.
I’ve made good progress with the firmware development and have prototype code for the following functions:
- Setting an output voltage using the DAC
- Read back of the output voltage using the external ADC
- Monitoring of the input voltage using the MCU ADC
- Serial protocol for UART / USB interface
- Rotary encoder reading for user input
- ILI9341 320×240 TFT LCD display for user interface
Functions I have still to start are:
- PWM control of the FAN (Intel FAN control spec)
- Dithering of DAC output
- Temperature reading
The user interface has been an interesting challenge. To simplify the hardware in order to be able to focus just on the software I decided to use a temporary test platform using a “bluepill” development board which is a cheap STM32F103C8 based board available from Aliexpress for just a few dollars.
These little modules are really handy for mocking thing up on a breadboard and the STM32F103C8 is close enough to the STM32F070CBT6 part on my PSU controller that there is virtually no work required to port the code after prototyping. Here’s a picture of my prototype lashup with the ILI9341 TFT and rotary encoder attached.
The rotary encoder is the only UI input device at the moment. I may swap the TFT for a touch screen later depending how how this prototype goes, but navigating about using just the rotary encoder seems to work well enough for now.
The UI is based on a simple state machine. The user uses the rotary encoder to scroll through the various options VSET -> VCTRL -> CSET -> CCTRL, and uses the push button function on the encoder to select an option. They can then set the required voltage output in VSET state, or current output in CSET state. The encoder driver has “velocity control” built into it, so slow turns will increment the voltage in millivolt steps, slightly faster turns in 100mv steps and very fast turns in 1v steps, and similarly for the current control function.
Here is a short video of the UI in action:
As you can see I still have some issues to resolve with the fonts. Getting nice fonts to work was a challenge requiring reducing font files down to just the font sizes, and even characters I need to save space.
Final steps with the UI for now will be to integrate that code back into the main PSU firmware project, and figure out which SPI device – DAC or ADC – makes the most sense to share a SPI bus with the TFT screen.
2 thoughts on “PSU Project update 2”
this link is dead:
Thinks for your good work, keep up
Thanks for letting me know about that link – I’ve fixed that now. Thanks for reading! Unfortunately the day job is preventing me from getting much time on this at the moment but I hope to post another update on the power supply project soon.