Digital DC Power Supply

A Digital DC Power Supply

hardware version 3.0

I build the 22V 2.5A version

Notes: connectors on the pcbs have pin 1 marked (square solder pad, marked on silkscreen)

Links

tuxgraphics.org - A Digital DC Power Supply (programmable bench power supply unit), hardware version 3.0,

back to electronics page.

History / worklog

2021-10-26: I re-created this page on my self-hosted web server.

2012-02-28: The PSU (SKU 10732) and mains cable (SKU 73212) arrived from DX. Unfortunately, the PSU has a normal two-pin socket for the mains cable, so the mains cable I ordered (SKU 73212) can NOT be used, since it has a three-pin "mickey mouse" plug. SKU 73211 would have worked. Luckily, I have a few of the two-pin mains cables spare. Testing: I connected the PSU to the mains. At the 24 V DC setting, it has about 24.5V DC out. The mains indicator is a blue LED.

2012-02-16: case / box: the case arrived.

2012-02-07: case / box: I ordered an aluminum case from eBay to house the DDCP in, for USD 14.99 + USD 16.- in shipping.

2012-01-24: power brick: I ordered SKU 10732, 73212 from DX. This PSU is rated at 24V, 3A and should be enough to power the DDCP.

2012-01-23: loading final software: first, set the microcontroller to 8 MHz frequency (by using 'make fuse'):

tingo@kg-u35jc:~/doc/Tuxgraphics/digitaldcpower/v3/digitaldcpower-0.6.4$ make fuse
avrdude -P /dev/ttyUSB0 -p  m8 -c stk500v2 -u -v -U lfuse:w:0xa4:m

avrdude: Version 5.10, compiled on Jun 29 2010 at 21:09:48
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/etc/avrdude.conf"
         User configuration file is "/home/tingo/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyUSB0
         Using Programmer              : stk500v2
         AVR Part                      : ATMEGA8
         Chip Erase delay              : 10000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom         4    20   128    0 no        512    4      0  9000  9000 0xff 0xff
           flash         33    10    64    0 yes      8192   64    128  4500  4500 0xff 0x00
           lfuse          0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           calibration    0     0     0    0 no          4    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel STK500 Version 2.x firmware
         Programmer Model: AVRISP
         Hardware Version: 2
         Firmware Version Master : 2.02
         Vtarget         : 5.0 V
         SCK period      : 130.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0x1e9307
avrdude: reading input file "0xa4"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.03s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xa4:
avrdude: load data lfuse data from input file 0xa4:
avrdude: input file 0xa4 contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.01s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified

avrdude done.  Thank you.

avrdude -P /dev/ttyUSB0 -p  m8 -c stk500v2 -u -v -U hfuse:w:0xd9:m

avrdude: Version 5.10, compiled on Jun 29 2010 at 21:09:48
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/etc/avrdude.conf"
         User configuration file is "/home/tingo/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyUSB0
         Using Programmer              : stk500v2
         AVR Part                      : ATMEGA8
         Chip Erase delay              : 10000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom         4    20   128    0 no        512    4      0  9000  9000 0xff 0xff
           flash         33    10    64    0 yes      8192   64    128  4500  4500 0xff 0x00
           lfuse          0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           calibration    0     0     0    0 no          4    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel STK500 Version 2.x firmware
         Programmer Model: AVRISP
         Hardware Version: 2
         Firmware Version Master : 2.02
         Vtarget         : 5.0 V
         SCK period      : 158.5 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0x1e9307
avrdude: reading input file "0xd9"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.01s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xd9:
avrdude: load data hfuse data from input file 0xd9:
avrdude: input file 0xd9 contains 1 bytes
avrdude: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.01s

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified

avrdude done.  Thank you.

tingo@kg-u35jc:~/doc/Tuxgraphics/digitaldcpower/v3/digitaldcpower-0.6.4$

Next, make the software: (hardware_settings.h was already set up for 22V 2.5A)

tingo@kg-u35jc:~/doc/Tuxgraphics/digitaldcpower/v3/digitaldcpower-0.6.4$ make
avr-gcc -g -mmcu=atmega8 -Wall -W -Os -mcall-prologues -Os -c main.c
avr-gcc -g -mmcu=atmega8 -Wall -W -Os -mcall-prologues -Os -c dac.c
avr-gcc -g -mmcu=atmega8 -Wall -W -Os -mcall-prologues -Os -c analog.c
avr-gcc -g -mmcu=atmega8 -Wall -W -Os -mcall-prologues -Os -c uart.c
avr-gcc -g -mmcu=atmega8 -Wall -W -Os -mcall-prologues -o main.elf -Wl,-Map,main.map main.o dac.o lcd.o analog.o kbd.o uart.o
avr-objcopy -R .eeprom -O ihex main.elf main.hex
avr-size main.elf
   text       data        bss        dec        hex    filename
   6978        298         66       7342       1cae    main.elf

Expl.: data=initialized data, bss=uninitialized data, text=code

avr-gcc -g -mmcu=atmega8 -Wall -W -Os -mcall-prologues -Os -c test_dac.c
avr-gcc -g -mmcu=atmega8 -Wall -W -Os -mcall-prologues -o test_dac.elf -Wl,-Map,test_dac.map test_dac.o lcd.o kbd.o dac.o
avr-objcopy -R .eeprom -O ihex test_dac.elf test_dac.hex
tingo@kg-u35jc:~/doc/Tuxgraphics/digitaldcpower/v3/digitaldcpower-0.6.4$

Finally, load the software:

tingo@kg-u35jc:~/doc/Tuxgraphics/digitaldcpower/v3/digitaldcpower-0.6.4$ make load
avrdude -P /dev/ttyUSB0 -p m8 -c stk500v2 -e -U flash:w:main.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x1e9307
avrdude: erasing chip
avrdude: reading input file "main.hex"
avrdude: input file main.hex auto detected as Intel Hex
avrdude: writing flash (7276 bytes):

Writing | ################################################## | 100% 4.21s

avrdude: 7276 bytes of flash written
avrdude: verifying flash memory against main.hex:
avrdude: load data flash data from input file main.hex:
avrdude: input file main.hex auto detected as Intel Hex
avrdude: input file main.hex contains 7276 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 2.05s

avrdude: verifying ...
avrdude: 7276 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

tingo@kg-u35jc:~/doc/Tuxgraphics/digitaldcpower/v3/digitaldcpower-0.6.4$

After this, the display shows:

 5.0V [ 5.0]<-
0.00A [0.15]

In other words; it works.

2012-01-22: display test: I did

make test_lcd.hex
make load_test_lcd

and the LCD display shows "LCD works", followed by "press a button". Well, I haven't connected the buttons yet.

2012-01-22: programming setup: I used my avrusb500 programmer, just connected it to the xubuntu laptop, and verified that it connected to /dev/ttyUSB0. All ok.

2012-01-22: software setup. I used my Xubuntu laptop. First I installed avrdude, avrdude-doc, binutils-avr, avr-libc, and gcc-avr using synaptic.

2012-01-22: LCD display: I soldered the display to the main pcb using a length of flat cable (ten wires). Straight on the main pcb, twisted to fit at the display pcb.

2012-01-22: initial testing. I connected 11V DC on the input (pin 1 and 2 of CONN5) and measured the + 5V from the 7805 regulator, it was spot on. Next I measured the output (CONN3) and it was 0.01 mV. Ok, time to solder in the mcrocontroller (ATmega 8A). Done.

2012-01-22: Next part is the DDCP itself. I start with the main pcb. I solder CONN1, the programmer connector (5 pin).

Resistors: 4K9 - R9 - R14, 10K - R1, R15 - R20, R24, R25, 1K - R7, R4, 470R - R21, 4K7 - R6, 5K6 - R23, 68K - R5, 10K - R3, R22, 1R5 3W - R2, R8.

Diodes: 1N4004 - D2, 1N5400 - D1

Capacitors: 10nF (marking 103) - C6, 100nF (marking 104) - C2, C3, C5, electrolytic 10 mikroF - C4, C8, negative (short leg) to the right, 470 mikroF - C1 negative (short leg) to the top.

Transistors: BC547 - Q3 (flat to the left), BC557 - Q4 (flat to the left), BD137 - Q2 (text to the right), FJA4313 (markings F J4313) - Q1 (metal to the left)

Voltage regulator: LM7805C - U1 (metal to the left)

As instructed, I did not mount C9, C10 and U3 (I don't have any components for them either).

The keypad pcb: I solder the four resistors (1K) to the board. I don't have a case yet -perhaps I should wait with the buttons.

2012-01-22: starting building the kit First I start with the DDCP to USB interface. I seem to be missing one component: D1 - 1N5400 according to the component list. Perhaps I'll find it. I will worry about that later.

First I solder all resistors: R5, R6 - 1M, R1, R4 - 470R, R3, R2 - 1K.

Next up, the capacitors: C1, C2 - 100 nF ceramic (marking "104"), C3 - 1 mikroF electrolytic - negative (the short leg) to the right edge of the card (when the usb connector is on the right hand side).

I solder the usb connector up next.

Finally, the optocouplers: U2, U3 - 4N32. The notch is down (when the usb connecor is on the right hand side).

There isn't any place for D1 on the printed circuit board, and it isn't in the schematic, probably just an error in the component list.

2011-11-07: the kit arrived - a package in the mail.

2011-10-20: I ordered the following from tuxgraphics:

1 x kit: digital DC power supply
1 x kit: DDCP to usb interface
1 x LCD 2x16, blue, backlight
1 x ATmega8a, PDIP

for a total of 58.78 Euro. Shipping was 6.39 Euro.