Programming the Programmable Hotwire Regulated Driver drop-in for D-M@g

Candle Power Flashlight Forum

Help Support CPF:

As a suggestion install Microsoft Virtual PC on your XP computer and install another copy of XP inside of it. This may allow you to use your computer as you wish.
 
MAJOR Progress Report

Congratulations to Starlight for reprogramming his regulators! I believe he is the first non beta tester to have done so.


NEW GUI Configuration Program Development


I have developed a new interactive Graphical user interface that builds the regulator software, compiles it and loads it into the chip. This is much simpler than the older technique and avoids editing files or loading AVR Studio at all.

BSBG and Starlight are beta testing this software and helping to develop the user documentation for it.

Thanks!!!!!

Now I will return to working on hardware (unless we find a bug).
 
MAJOR Progress Report

Congratulations to Starlight for reprogramming his regulators! I believe he is the first non beta tester to have done so.


NEW GUI Configuration Program Development


I have developed a new interactive Graphical user interface that builds the regulator software, compiles it and loads it into the chip. This is much simpler than the older technique and avoids editing files or loading AVR Studio at all.

BSBG and Starlight are beta testing this software and helping to develop the user documentation for it.

Thanks!!!!!

Now I will return to working on hardware (unless we find a bug).


Alan, the GUI interface sounds great, and should be a big help to folks not as comfortable with programming in a traditional IDE. What did you write it in?
 
Alan, the GUI interface sounds great, and should be a big help to folks not as comfortable with programming in a traditional IDE. What did you write it in?

Thanks for the feedback!

Python's default GUI using the Tkinter library to "tk". Not the most fabulous GUI, but it is already installed in Python and pretty quick to build a decent program in. I rarely have time for elegant GUI programming, folks want me to do other things...
 
Beta testing has progressed, at least one tester has successfully programmed his regulator and calibrated it with the GUI system.

A new version has just been sent to beta with a few new features.

Here is the Change Log:

0.10 20090816 version sent to beta test

0.11 20090816 added code version support to handle multiple code version files
in the same dir, also added this ChangeLog. Code Version is NNN, started
with 099 since previous version was 0.98<something>
Moved bulb data out to a "bulbdata.csv" file.
Added Programmer Selection and Port. Select port "usb" for usb programmers.
Added support for USBtinyISP from www.adafruit.com/usbtinyisp.
Select "avrisp2" for Atmel's AVRISPmkII, and select "usbtiny" for the
www.adafruit.com programmer. Select port "usb" for both.
Restored the interface level from the configuration file.

0.12 20090816 fixed Low Bat error when inputting RMS and Battery DC Reading is
zero or blank. The Battery DC Reading must be either higher than the calibration
voltage, or it must be zero. It should be accurate or it should be left
blank.
 
I created config files, :party:.

It was quite simple - we'll see how the rest of the process goes once Ihave the hardware.

This is one amazing project - who would have thought we would be programming modded Mag lights with a PC...
 
I created config files, :party:.

It was quite simple - we'll see how the rest of the process goes once Ihave the hardware.

This is one amazing project - who would have thought we would be programming modded Mag lights with a PC...

I'll take a look at the config files tonite.

Folks, this is going to work out nicely. When we release this software (very soon) the customer can run it and select the parameters for their regulator, and then send the config file back to me via email. I can use that config file to build the code for the regulator. This way the selections will be accurately communicated.

In this case all the customer needs is Python, and the config program should run on the Mac and Linux far enough to generate the config files. The compile and load code into the regulator parts will not easily work on the Mac or Linux, but these are not required to make the configuration file.
 
There was a new release of the beta configuration code this morning.

The new layout is improved and there were a few small bugfixes.
 
AVR ISP ordered from Digi-Key. Now all I need are some regulators 😗.
 
Number BSBG01 is done, SN112. Need to set the socket height, but it is mounted in the sled and programmed.

The new graphical programming software worked really sweet. Lightning quick. It takes more time to hook up the plugs and wires than to program, calibrate and reprogram the regulator. Really impressive.
 
OK, first attempt at programming is not going well.

Config file compiles OK.

AVR ISP has 2 green lights.

Programming fails - "did not find any device usb" :thinking:
 
OK, first attempt at programming is not going well.

Config file compiles OK.

AVR ISP has 2 green lights.

Programming fails - "did not find any device usb" :thinking:

Sounds like the standard AVRISP USB driver problem.

Unfortunately AVR Studio loads a driver that it uses but AVRDude cannot use. It produces exactly that error. Is that possibly what happened here?

In the READme.txt file there are instructions to change from the AVR Studio driver to the AVRDude driver, and how to tell which one is loaded.

OR you can use AVR Studio to program the chip. Not as easy or convenient, but do-able.

Sorry for the complexity.
 
"programming succeeded"

Thanks Alan- it was the drier. Now running an 1164 on 12 2/3A in a 2D host :thumbsup:.
 
"programming succeeded"

Thanks Alan- it was the driver. Now running an 1164 on 12 2/3A in a 2D host :thumbsup:.

Great! Looks like a very well regulated combo!! 40 to 60% PWM values. Very nice. I like the 2D form factor. Is that 2D bored out to take 4 aside? What is the runtime?

How do you like the pushbutton reprogramming? Now if it was only wireless...

That's another thing I should eventually do. Get the amp-hour and bulb current and do runtime estimates in the config software.
 
I just posted about the vastly improved manual auto-generation feature in the config software, and posted the new software as well as the config files and auto generated manuals from Wave 3 on the web here:

http://akbeng.com/flash/hwreg/config/

As always, feedback welcome.

To run the phdConfig.py file what do we need to have installed first? I assumed python - so I downloaded the latest version (3.1.1) but it is not working right for me. Do I need an older version of Python?
 
To run the phdConfig.py file what do we need to have installed first? I assumed python - so I downloaded the latest version (3.1.1) but it is not working right for me. Do I need an older version of Python?

Instructions are in the READme.txt file. It requires Python 2.6. Sorry for the confusion. Python 3 is a major departure and lots of things don't work there yet...

NOTE that the READme.txt file has you install WinAVR and the USB programmer. Neither is required for making config files. I will redo the instructions.

All you need is Python 2.6 and the files in the zip. Double click on phdConfig.py and you are running...
 
Last edited:
Back
Top