Successful control via USB

A project log for DPS201: Lab PSU

Ultra small lab power supply with digital control.

FridrikFridrik 08/13/2014 at 21:290 Comments

After finishing soldering the rest of the board, the next task was to modify the already quite complete firmware to work with the new board. This was rather simple, the main issue was getting the USART communication working properly, since the new micro (AtTiny167) uses LIN/USART protocol while the micro we have been using until now (Atmega328P) just uses a simple USART. 

Here you can see the board being flashed for the first time!

Last few nights I have been messing with the firmware to get everything working properly, and I believe we are very close now. Last night I was able to get first communication over USB and finally tonight I was able to use the software to send proper commands to the PSU. That is I am able to program the voltage and read the measured voltage back. In principle I can also program the current limiting but I had to temporarily disable the current reading. Unfortunately. I fell in the trap of connecting the current reading net to an IO pin of the AtTiny that also serves as the SPI slave-select pin. This is bad because when the SS pin is pulled low while the AtTiny acts as a SPI master, it quickly drops out of master mode and acts as a SPI slave. This is unwanted because we need the micro to act as a SPI master always to control the DAC which is an SPI device. For now I simply disabled the current measurement feature. I will bodge a connection to a different pin on the micro in coming days.

Here is the success moment caught on camera, where in the background you can see that the PC software is set to 10V, and it reads back 10.1V from the DPS201. On the multimeter in front you can see the measurement essentially being confirmed (at least up to calibration errors.)

The next task is to connect loads to the supply and characterise it properly.