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

MCU AND USER INTERFACE

As with every other project I’ve worked on in the last two years, I chose the Atmel AVR family for the MCU. In this case, I went with the AT90S8535 for a couple of reasons. I needed 23 I/O lines to handle the three SPI channels, LCD, rotary encoders, and RS-232. This ruled out the use of smaller AVR devices. I could’ve used the slightly less expensive AT90LS8515, but I wanted to allow for the possibility of adding a temperature-sensing meter/alarm option to the circuit. The ’8535 has a 10-bit ADC function that’s suitable for this purpose; the ’8515 does not.

The ’8535 MCU has 8 KB of ISP flash memory, which is just about right for the necessary firmware. It also contains 512 bytes of EEPROM. I used a small amount of the EEPROM to store default values for the three programmable power supplies. That is to say, the power supply will power up with the same settings that existed at the time its Save Configuration push button was last pressed.

To simplify construction, I decided to use a SIMM100 SimmStick module made by Lawicel. The SIMM100 is a 3.5" × 2.0" PCB containing the ’8535, power supply regulator, reset function, RS-232 interface, ADC, ISP programming headers, and a 30-pin SimmStick-style bus. I’ve used this module for prototypes several times in the past, but this is the first time I’ve actually incorporated one into a finished project. Photo 2 is the manufacturer’s picture of an assembled module. For this project, I populated a bare SIMM100 PCB with only the components that I actually needed.

(Click here to enlarge)

Photo 2—I used a Lawicel SIMM100 module for the microcontroller and associated circuitry.

The MCU port signals needed to operate the three SPI channels and interface the two rotary encoders come out through the 30-pin bus. As you now know, I designed the ground-referenced power supply PCB to include space to mount the SIMM100 module, as well as the IsoLoop isolators. The SIMM100 mounts at right angles to this PCB; it’s hard-wired in place using 90° header pins. The floating power supplies share a virtually identical PCB layout apart from being smaller because of the lack of traces and circuitry associated with the SIMM100 bus and IsoLoop isolators.

The SIMM100 module has headers for the ISP programming cable and RS-232 port. I used its ADC header to run the LCD by reassigning six of the ADC port pins to general I/O pins.

When I buy in bulk, it’s inevitable that by the time I use the last item in my stock, something better has taken its place. After contacting Lawicel to request a .jpg image of the SIMM100 for this article, I was introduced to the new line of AVR modules that the company is developing.

Rather than a SimmStick-based module, the new modules are 24- and 40-pin DIP modules that are meant to replace Basic Stamps. Instead of using PIC chips/serial EEPROM and a Basic Interpreter, they implement the most powerful members of Atmel’s AVR family—the Mega chips.

Mega chips execute compiled code from fast internal flash memory and contain much more RAM and EEPROM than Stamps. Even though flash programming AVR-family chips is easy through SPI, using inexpensive printer port programming cables, these modules go one step further by incorporating RS-232 flash memory programming. This makes field updates a snap. Take a look at the new stAVeR40 module in Photo 3. I might have used this module instead of the SIMM100 had it existed when I started the project.

(Click here to enlarge)

Photo 3—Lawicel’s new stAVeR40 module is a decent product. I might have used it in place of the SimmStick had it been available when I was designing my project.

The user interface I settled on consisted of a common 4 × 20 LCD panel along with two rotary encoders. One encoder is used to scroll through the various power supply parameters, and the other adjusts the selected parameter. The cost of LCDs and rotary encoders is reasonable these days. Being able to eliminate the substantial cost of six DPMs and six 10-turn potentiometers was the main reason for choosing an MCU-based design in the first place. Photo 4 shows the front panel of the unit.

(Click here to enlarge)

Photo 4—To the right of the output Johnson posts are the switches that set the polarity of the floating supplies—as well as the switch that disconnects all power supply outputs—while leaving the unit still powered up.

Inexpensive rotary encoders come in two basic flavors: quadrature encoded and 2-bit binary (Gray) coded. I’ve used the quadrature-encoded style in the past, but the ones I used for this project have a 2-bit output (with Gray coding). With only 2 bits, the encoder can represent only four different values, even though it has 32 detents per rotation. With this in mind, it’s necessary for the firmware to constantly poll both encoders and keep track of the carry or borrow conditions that occur as the encoder moves beyond a four-position range. The main control loop in the firmware is executed every few milliseconds, so keeping an accurate track of the rotary encoder’s position is accomplished readily.

The RS-232 port came as part of the SIMM100 module. Thinking about the future, I envision adding some firmware code to allow the bench supply to be remotely controlled by a host PC, and to allow for the data logging of the various voltages/currents over time.

I haven’t provided you with a complete block diagram, but I did incorporate a few features that don’t show up on the individual schematics. Previously, I mentioned adding an additional commercial 5-V, 3-A supply for logic circuits. I also added a 3PST switch, with one section in series with each supply’s positive output, to allow all power supplies to be disconnected from the load during power-up. A small DC computer-type fan was mounted on the top of the outer case for cooling purposes, because the pass-transistor heatsinks that I used were not too large.

Lastly, Figure 3 shows you how the ’8535 MCU would typically be connected to the rest of the circuit. It doesn’t show the exact wiring of the SIMM100 including the bus connections, because this detail isn’t needed when constructing the circuit from scratch (i.e., if you’re not using the SIMM100 module). The SIMM100 documentation will give you all of the necessary information regarding the header and bus connections on the module.

(Click here to enlarge)

Figure 3—Take a look at the MCU, IsoLoop isolators, and the user interface. Some of this circuitry is actually contained on the SIMM100 module.