Close

Bench Power Supply

Back to overview

Designing an open source, modular bench power supply to rule them all.

Discussions

Michael Vowles wrote 02/25/2016 at 08:41 point

So I finally programmed this thing using FLIP however I'm not seeing anything on the LCD. I dont have any of the channels hooked up yet however. Should I be getting something on the LCD?

  Are you sure? yes | no

The Big One wrote 02/25/2016 at 15:51 point

Yeah, you probably should be... I would suggest debugging to see how far the program gets.  Perhaps add a single pin output at the start of main, and toggle a pin after each startup instruction.  My guess is that there is a problem with twi_init() - in my experience that is the most likely culprit when something hangs at startup.  How many ADC chips have you installed?  Have you configured the addresses yet?

Once we have narrowed down exactly where it is hanging, we will have a better idea of how to fix it.

Cheers

  Are you sure? yes | no

Michael Vowles wrote 12/12/2015 at 02:33 point

Is it to program the controller using the LUFA bootloader?

  Are you sure? yes | no

The Big One wrote 12/12/2015 at 03:59 point

Yes, you can either use the default bootloader (and adjust clock speed in code) or you can program the LUFA bootloader and flash fuses.  When I made the board I didn't know much about the default bootloader, so I added the ISP headers.  If I were to do it all again today I would just use the default bootloader (that's what I am doing on my new projects).

  Are you sure? yes | no

Michael Vowles wrote 12/12/2015 at 06:15 point

As an update, I supply power to the controller and connect the USB but it doesn't enumerate on my computer. So I am currently troubleshooting. :/ 

  Are you sure? yes | no

The Big One wrote 12/13/2015 at 04:36 point

Some things to try... 

-Verify there are no bridges on any of the microcontroller's VCC, GND, or USB data pins (obvious, but critical, and I for one often miss a bridge somewhere)

-Verify that the 1uF capacitor is connected from UCAP to GND (my latest project was recognised as a USB device, but would not properly enumerate, and the issue turned out to be a bad connection from UCAP to the capacitor)

-Verify continuity between the USB data pins and the 22 ohm resistors, and then again from the resistors to the micro B connector pins.  (Since my design relies on jumper wires to bring the USB headers out to the front panel, there are more potential trouble spots that you need to ensure are connected well.)

-If you have a scope, you can check out the two USB data lines and see if there is a signal

Good luck!

  Are you sure? yes | no

Michael Vowles wrote 12/14/2015 at 06:08 point

Thanks for the tips! I'll have a look tonight hopefully but I have actually used 20ohm resistors on the data pins, do you think this would be an immediate showstopper?

  Are you sure? yes | no

Michael Vowles wrote 12/16/2015 at 08:22 point

Found the problem! the tvs diodes that I used for some reason dont play nice. I did up one of your ubbb boards and left the tvs diode off and voila! so i just took it off on the power supply controller and boom, enumerated straight away! 
Just so I got it straight, I can just build your avr code with winavr and burn the hex via FLIP?

  Are you sure? yes | no

The Big One wrote 12/16/2015 at 16:05 point

Excellent to hear.  I am reconsidering my (recent) use of TVS diodes... I seem to have about a 50% success rate.  Not sure why, I must be picking the wrong ones or something.  (I had read some literature on ESD almost a year ago and figured it would be good to start designing against it... but it seems to be more complicated than just throwing a TVS on the design.)

Anyway, yes, you should now be able to just build and upload via flip... to my knowledge you are the first person other than me to get this far, so there may be some issues.  Let me know how it goes and I can try to support you!

Cheers

  Are you sure? yes | no

Michael Vowles wrote 12/17/2015 at 07:23 point

Well here is the first one! I set up all the symbolic links for the build and lib files but running just make gave an error where rm is used under clean (rm -f *.o), it throws up a dialog saying rm.exe was unable to start correctly. 

So i then used make --debug=b-k which gave,

Reading makefiles...
Updating goal targets....
 File `all' does not exist.
   File `clean' does not exist.
  Must remake target `clean'.
rm -f *.o
  Failed to remake target file `clean'.
     File `powersupply.hex' does not exist.
       File `powersupply.elf' does not exist.
      Must remake target `powersupply.elf'.
avr-g++ -DADC_PRESCALER_MASK=0x07 -DCHANNEL_COUNT=4 -DUSB_VENDOR_ID=0x4200 -DUSB_PRODUCT_ID=0xFF01 -DUSB_RAWHID_RX_SIZE=10 -DUSB_RAWHID_TX_SIZE=10 -Wl,-u,vfprintf -lprintf_flt -lc -DF_CPU=16000000 -mmcu=atmega32u4 -pedantic -Os -Wall -std=gnu++11 -I./ -o powersupply.elf PowerSupply.cpp Channel.cpp Display.cpp Encoders.cpp State.cpp timer0.c timer1.c usb.c lib/analog/analog_asynchronous.c lib/bootloader/bootloader.c lib/Button/Buttons.cpp lib/Hd44780/CharDisplay.cpp lib/Hd44780/Hd44780.cpp lib/Hd44780/Hd44780_Direct.cpp lib/usb/rawhid.c lib/twi/twi.c  

make: *** [clean] Error -1073741502
cc1plus.exe: error: unrecognized command line option "-std=gnu++11"
cc1plus.exe: error: unrecognized command line option "-std=gnu++11"
cc1plus.exe: error: unrecognized command line option "-std=gnu++11"
cc1plus.exe: error: unrecognized command line option "-std=gnu++11"
cc1plus.exe: error: unrecognized command line option "-std=gnu++11"
cc1plus.exe: error: unrecognized command line option "-std=gnu++11"
cc1plus.exe: error: unrecognized command line option "-std=gnu++11"
cc1plus.exe: error: unrecognized command line option "-std=gnu++11"
cc1plus.exe: error: unrecognized command line option "-std=gnu++11"
cc1plus.exe: error: unrecognized command line option "-std=gnu++11"
cc1plus.exe: error: unrecognized command line option "-std=gnu++11"
cc1plus.exe: error: unrecognized command line option "-std=gnu++11"
cc1plus.exe: error: unrecognized command line option "-std=gnu++11"
cc1plus.exe: error: unrecognized command line option "-std=gnu++11"
cc1plus.exe: error: unrecognized command line option "-std=gnu++11"
cc1plus.exe: error: unrecognized command line option "-std=gnu++11"
make: *** [powersupply.elf] Error 1
make: Target `all' not remade because of errors.
make: write error

      Failed to remake target file `powersupply.elf'.

Did you originally build everything on linux or windows?

  Are you sure? yes | no

The Big One wrote 12/17/2015 at 14:27 point

I built on Linux using avr-gcc and also verified on OSX using cross pack (a Mac package of avr-gcc). I do know that other people have had some difficulty using Windows on other projects of mine; look at my Stubby project for some hints on compiling with Windows. Specifically make sure you are on a recent version. Of course if you have a Linux box / VM available it may be easiest to just use it.

  Are you sure? yes | no

Michael Vowles wrote 12/17/2015 at 22:30 point

As you said fired it up on a ubuntu vm, worked straight away. I'm at work at the moment but uploading the .hex via FLIP shouldn't be a problem (hopefully)! I am still waiting on a the 0.1% resistors for my channels but once they arrive I should be in a position to cobble everything together and do an initial test. Thanks again for your help. BTW drum master is looking good!

  Are you sure? yes | no

The Big One wrote 12/17/2015 at 22:54 point

Great to hear it, and thank you!

  Are you sure? yes | no