BLF17DD Info Thread - Reference

Are you on Windows, or not? Hard to figure out just from indirect stuff. If so, just double-click the .bat file and it opens avrdude and does everything for you, that's what it's for, so you don't have to figure out and type the commands each time you want to flash the same firmware. High & low fuses are already specified, lock bits are not because who cares with an open-source firmware?

If you're on something else, open the .bat file, copy the command string, and paste it into the avrdude window (assuming you've opened avrdude from the same folder where the .hex file is, otherwise navigate to the right folder first).

Ah nm… I see now :slight_smile: It’s 75 hex low and FF high, leave the memory lockbits alone. Yeah using Eclipse, just wanted to make it all automated without using the command line, build and burn you know. I’m a linux guy but running this in a vm on a stripped install of windows xp. I could move it over to linux I guess, but this is good enough.

I think posted the wrong link last night it’s AVR® Fuse Calculator – The Engbedded Blog

Yeah I’m still at the start ready to run. I haven’t really got around to modifying code yet, but it should be fun getting the modes I want. Was thinking of making the yezl ramp up and down between clicks and put in your crazy fast strobe on hold of the eswitch.

The F6DD beta is a tweaked version of ToyKeeper's SRK firmware. Mode order default changed to short press = higher, long press = lower, long press duration dramatically shortened (from I think 35, down to 17), press & hold and it steps down levels until you release, or it keeps going all the way down to 'off' if you keep it pressed. It still uses her hybrid thing of phase-correct on levels 1 & 2 (gives less light output with the same PWM number, so helps get a lower low/moonlight), and the non-whiny fast-PWM on all other levels.

If you go messing with the fuses without also changing all the relevant bits to match you'll totally throw off the switch timing. So don't do that. No need to change any of that.

You guys are so far ahead of the game and I’m just going to spend today messing around with code. Oh sheet it’s friday trash day! xd

Thanks comfy appreciated.

New version of the 17dd_v3.1 released. A quick overview of the changes-

  • A real GND plane (on both sides) this means no more pulling off the thin gnd rings, it also means you can scrape a little mask and have a GND point almost anywhere on the board.
  • GND plane has “thermal’s” on the lower power components (for easier soldering) but is solid for the FET’s source leg and the batt nagative input via to supply the necessary higher current (this was not easy to make)
  • A dedicated zener pad, no more stacking (simply leave unpopulated for 4.2v builds)
  • C1 is in the proper position to eliminate “boost circuit” issue so no more gate resistors
  • “Star’s” are easier to short with just solder
  • Dedicated batt- input via (used for piggybacking)
  • Has a set of 1.1mm LED lead via’s (sized for 20AWG wire, even 18 will fit), this makes multi-emitter builds less of a pain.
  • Dedicated SW+ input via on pin3 for MOM FW’s
  • Batt+ spring pad is 8mm but only 5mm exposed (the size of standard 105C springs and those brass buttons), scrape to expose the full 8mm

Note this is not a mod of the V2, this was a total redesign

Ahhh - CK, this does look like a real killer!! Think it has everything, and better? No more 2 or 3 versions? This is one master 17DD, all-inclusive? Hhhmmm. wow.

Big Q - tested yet? If not, how risky? Should we wait?

So this single Ver 3.0 will be able to be built as a standard driver, or a Zener driver, easy peasy? Very cool.

I need to get some more components…

It will work as a zener, with no possibility of voltage monitoring (which isn't important to most of us anyways). Maybe it's time to just switch to a layout where the voltage divider doesn't pass through the diode on any of these, since we're all using custom programs anyways. Same resistors could be used for single cell with a slight bump in the ADC values.

Ahhh, ok, that's a "good-to-know" loss ??? You are losing me here. Speak slower Smile. Why is it breaking voltage monitoring? Why is that not a major loss? - thought that can be worked out. I can't follow this....

I should clarify: with no voltage monitoring with 2S+ cells and the zener diode, since the voltage divider is downstream from the zener diode they will always read the zener diode voltage with 2S cells instead of actual cell voltage.

Ok, so this PCB has a potential design flaw - not sure purposely or not, at this stage, or is it even a loss if the firmware is not doing voltage monitoring for zener mod configs. Need an explanation from CK.

CK? Please? Smile

It's not a design flaw, since none of the zener mod drivers you've ever used probably even had voltage monitoring before. You either gain voltage monitoring for zener mod or you break the traditional 120/130 ADC value compatibility for 1S cells, since the voltage will be be about 0.25V higher at the voltage divider since it isn't being dropped by the diode like it does in the typical 105C circuit. It is just a compromise.

You don't need the voltage monitoring since you can see that the light is getting very dim anyways, it is more for newbys and accidentally leaving the light on.

I was just saying that if we went to bypass the diode it wouldn't be a big deal anyways since we build these by hand, flash them ourselves, and could just flash the file with the changed ADC values to compensate for the 0.25V higher divider input voltage.


If you're not sure what I'm talking about, look at the voltage divider circuit on the typical 105C / BLF17DD and compare it to the BLD17DD-Z.

Richard, when did you have the time to learn Greek and why are you speaking it here? :stuck_out_tongue:

Ouch - this hurts Cry. All I know is that the zener mod drivers I built all had my firmware with voltage monitoring and I had thought it worked, but found out later it's all off. So, I thought it was fixable by using different threshold values based on 2S or 3S cell inputs.

I'm afraid if I look at voltage divider circuitry, I won't understand a damn thing about it. Think I'm lacking some of the basics here... Sorry Richard, I have no idea where this leaves my understanding of this issue. No possibility or add a compensation? I'm 110% confused...

For starters, here is the voltage divider math you use to figure out which ADC value to tell the software:

ADC = ((V_bat - V_diode) * R2 * 255) / ((R1 + R2 ) * V_ref)

IF DIODE PRESENT

So for our typical 125 or so ramp down at about 3V at the battery, we get this:

126 (rounded) = ((3V-0.25V)*4700*255)/((19100+4700)*1.1)

OK, now take a look at a picture of your standard 105C driver or even the regular BLF17DD. You will see that the voltage divider circuit positive input runs through this sequence:

BATTERY-->SCHOTTKY DIODE-->VOLTAGE DIVIDER-->MCU

The Schottky diode drops the voltage by about 0.25V (it's forward voltage). So, we compensate and tell the software that we want to ramp at about 0.25V lower than what the divider seeing and converting into the lower voltage for the MCU to check against its 1.1v internal reference voltage.

If you take the diode out, you get this sequence:

BATTERY-->VOLTAGE DIVIDER-->MCU

There is no longer the 0.25V drop across the diode, so no compensation is needed.

With the zener mod on the normal circuit, here is what we get:

BATTERY-->RESISTOR-->ZENER DIODE (parallel)-->VOLTAGE DIVIDER-->MCU

Since the zener diode is going to be regulating at a constant 4.1V (the 2S input voltage will always be far above that) the voltage divider will only ever see 4.1V. If you bypass and just go BATTERY-->VOLTAGE DIVIDER-->MCU you don't have that problem.

Again, voltage cut off really isn't a big deal on anything except for buck drivers as long as you are monitoring the light, since you will see it getting very dim before the batteries get too low.

You can use a wide variety of divider resistors, as long as the ratio is correct for what you want. Higher value resistors are generally better. Let's do a quick example for 6V with a R1 of 30K and R2 of 4.7K:

188 = (6V*4700*255)/((30000+4700)*1.1)

The higher the value of resistor the less loss you get through the divider. You also want to end up at a higher ADC value such as 180 vs. a value like 50 for better resolution.

I agree with RMM, he is pointing out the same problems I’ve brought up in other threads. Running the voltage divider from behind the D1 placement is a bad thing. I only did it on the 22mm 7135 driver because I didn’t feel like having the conversation about either adjusting resistor values or ADC values or both. This will be a struggle for a while.

To be 100% clear: Tom E, you CANNOT get voltage monitoring to work with the traditional “zener mod” layout. Period. Modifying the voltage divider’s WIRING can get voltage monitoring to work. Modifying the values alone (of the resistors or of the ADC threshold) will not make anything work.

A voltage divider has 3 points: Vin, Vout, and GND. Proper wiring for a voltage divider is like this:

  • Vin is connected to the high voltage which we need to measure
  • Vout is connected to our MCU or other measurement tool
  • GND is connected to GND

Unfortunately the default layout of a Nanjg 105c hooks up Vin to the back of D1 rather than to Battery+. In the case of a stock Nanjg 105c this just results in a lower and possibly inconsistent reading. Once the traditional Zener mod has been performed however Vin is now connected to a semi-regulated voltage source: the voltage the Zener produces. This will tell our measurement tool nothing.

The proper place to hookup Vin is Battery+.

EDIT: grammar, oops.

Ok fixed (along with the 15, 15.17 and 20).

To answer Tom’s initial qestion, I am using all of the 3.0’s, I am running the 15, 17 and 20 (with the vdivider downstream of D1), the only change I made was that one thing, changing R1 to input VCC directly from BATT+. I have more of each ordered (tho I’m 100% sure its fine)

I was one of the people that just didnt feel like messing with it on the zener mod’s I did with the old drivers…

edit: sorry it took so long to answer (tho Wight and RMM definitely had it under control), I have been having an extremely busy week and today was the worst so far, I still have 3 threads on totally different subject’s I’ve promised people I’ll have posted by today.

I'm sorry - I studied the classic Nanjg layout, re-read posts #125 and #126 above several times. another biq Q: where is the VOLTAGE DIVIDER??? All we have is resistors, a diode, and a capacitor, and the MCU? It can't be done in a classic layout, then what's the magic layout it will work with? And if it exists, why doesn't it exist in our custom boards?

I think I need pictures or something...

The Voltage divider are the 2 resistors 1912 and 4701. Together they determine what the voltage drop is over the cell. Is that right?

Tom. I hate to say it, but it has been right under your nose the whole time...

Yeah, I am gonna link to Wikipedia.