circuitcellar.com
Magazine Support   Digital Library   Products & Services   Suppliers Directory 
 
 





 

Issue 149 December 2002
Quad Bench Power Supply


by Brian Millier

Start The Analog CoreThe Zetex ZXCT1009 An Ideal IsolatorMCU and User InterfaceFirmware Sources and PDF

FIRMWARE

If you’ve read any of my more recent articles, then I’m going to sound like a broken record in this section. I used an MCS Electronics BASCOM-AVR compiler for this project (once again). The code did not have to run extremely fast, but floating-point and string operations were needed. Because there was plenty of flash memory available in the ’8535, it made sense to program in Basic rather than using Assembly language.

Skipping over the unit’s initialization procedure for now, the control loop in the program works basically as follows. Both encoders are checked to see if the user has moved them. If the Menu encoder is changed, nothing is done, apart from moving an arrow cursor amongst the various parameters that can be changed. If the Adjust encoder is moved, the appropriate routine is called to adjust the necessary power supply’s voltage or current limit setting. This is accomplished by changing the value of the appropriate section of the digital potentiometer located on the proper supply PCB.

Because each supply’s ADC is digitally cascaded with that supply’s digital potentiometer, the routine that updates the digital potentiometers also reads the ADC all in one operation. For that reason, in the absence of any changes to the voltage or current-limit settings, each power supply is sent a control message at 0.5-s intervals to set its digital potentiometers and read the dual ADC. Constantly resetting the digital potentiometers at this interval is unnecessary, but periodically reading the ADCs is necessary to give you timely voltage/current readings.

The only remaining task in the control loop is to check the state of the Save Configuration push button. When it’s pressed, a routine is called to save the current values of voltage and current limit, for all three power supplies, to data EEPROM.

At power-up, the data EEPROM is checked for a valid configuration saved from a previous use of the supply. If so, these voltage/current settings are stored in RAM variables, and the three supplies are initialized to these settings. In the absence of valid configuration readings, each power supply is set to half scale, and the current limit settings are preset to maximum.

WRAP UP

I’m looking forward to the convenience of using this multi-output yet compact power supply in my future projects. As with all projects, there were some compromises I made along the way.

I chose Microchip’s dual 8-bit digital potentiometers for the voltage/ current settings. Basically, I felt the 50-mV voltage-setting resolution (100 mV for floating supplies) was sufficient for my purposes. The resulting current-limit resolution of 20 mA (8 mA for floating supplies) also seemed reasonable; however, dual 12-bit SPI DACs are available, which would improve this resolution substantially. Maxim makes some nice serial DACs, but they come in such small packages that I can’t handle or solder them to a PCB.

The existing version of the firmware uses 6800 of the total 8192 bytes of flash memory. This leaves sufficient room to add remote control via the RS-232 port in future. Because the firmware is written in BASIC, it’s reasonably easy to go into the code and add additional features at a later date.

Although it was a bit of an overkill to use the ultra-fast NVE IsoLoop devices for this project, it made that part of the design rather easy. I’d like to thank NVE for quickly sending me a few samples to incorporate in my design.