BLF17DD Info Thread - Reference

In the middle of piggy backing this board to the eswitch on the Y3. I don’t know exactly where to put the eswitch on the blf17dd though.

I noticed cerial had it on tiny13a here in this thread?

Also I’m not up on setting the modes using the connects on the bottom. If there’s a thread for that appreciate it! :slight_smile:

The 'stars' are on the topside, you connect the MCU pin to the little adjacent solder pad.

Switch goes to MCU pin 2.

edit: I don't think there are any options to set with the momentary version?

E-switch goes to MCU pin 3, directly to the pin not to the pad. Just like in CK’s pic you linked.

And yes, you have to use the “stars” on the MCU side. Which means you have to pull the driver if you want to change something. 4 is for High to Low mode order. 2 is to pin 5 for moon mode. 3 is for the e-switch, which of course must be on the pin itself. Not sure what the pad for star 3 is supposed to be for.

Switch goes to MCU pin 2 unless it's been changed in the firmware. Momentary version of STAR has no options to set via grounding pins & doesn't use the off-time capacitor so that's irrelevant. Only the clicky versions ground the pins to set options*.

* ToyKeeper's SRK version uses pin 3 to reverse the mode order, I don't recall seeing any other momentary versions that use them to set options.

And every e-switch light I’ve put a BLF17DD in works with it on pin 3. My TK-61 has both e-switches hooked to pin 3 with the BLF board master to an HX1175b1. My Couri’s, both of em, pin 3. My little magnetic base light, pin 3 as well as it’s 3 siblings. And every other light I have with e-switches. Was frustrating figuring that out, when the C file showed what you posted above.

If it works on pin 3, someone has changed it. All mine that are flashed with code as shown above work only with the switch on pin 2.

The Roche F6DD driver uses the same pin for the switch and works with the same firmware builds. That one has indicator LEDs attached to pins 3 & 5. Switch goes to pin 2 unless someone has deliberately changed it in the firmware.

Works like that with the original untouched 'SRK_no_ramp_1.0.c'

If it has the switch pin defined as PB3, the switch goes to pin 2. It's not possible for it to work attached to pin 3 unless that line has been changed to read PB4.

2 or 3… guess if it works on 3. I’ll do it in the morning to make sure.

Interesting on the stars too DBC… Thanks guys

I think maybe you're mixing two things here. If you're using the momentary switch firmware, the 'stars' are not used, there are no options for them to change (they are defined, but nothing is assigned to them). Only the clicky firmware in a light with a clicky switch has anything assigned for the pins to do. The momentary firmware won't work in a clicky light and the clicky firmware won't work in a momentary light. Forget about stars/grounding pins since you've got the momentary version there.

Ah- well wired up the eswitch to pin 3 and nothing changed with the modes on click. It works with the tail switch using on/off though. I was going to try pin 2 but thought check back here. I’ll mess with it some more. So you guys probably flash in your own firmware I take it for the eswitch to work or it should work with pin 2? I’ll give it a shot or maybe I’ll get some sleep.

Pardon my ignorance, but I don’t see a specification for this driver, just list of changes in the first post, but not the total spec, features, etc… is it out there somewhere?

The firmware is totally different between the two switch types, they are not interchangeable. To work with a momentary switch it must have been flashed by somebody with the momentary switch firmware.

It's a homebrew deal. Combination of the best parts of the Nanjg 105C (easy to reflash, lots of firmware versions available, parts very easy to get) and the best parts of the East-092 (direct drive with a super-low-resistance FET).

Thanks.

Suggestion for the thread Op: add specifications and features to the first post.

What are min and max currents for this driver/FET ?

The FET seems to be missing from the digikey shopping cart, what FET is it?

What s the zener diode mod used for ?

I'm with you vex! I'd love to make these drivers but I'm afraid to dive into the many pages of history to find out which resistor goes where and why and which resisors have become obsolete, so which pads are to be ignored in which board versions, etc. And I was even around following the whole story! TomE started this thread to solve this (thanks Tom), but still it has not become really straightforward for us 'electronically challenged' folks.

About your questions:

-it is a direct driver so the current in your flashlight has nothing to do with the driver, the current is a result of battery, led and various resistances in the flashlight. The only thing the driver does is switching on and off, to introduce pwm to get lower modes and when using an electronic switch to switch the flashlight on and off.

-I am curious about the current best FET as well, since the great Vishay FET has gone out of production.

-the zener diode is used in a 2xli-ion (8.4V) set-up to reduce the voltage for the MCU that can not handle more than 5.5V, e.g. a MT-G2 on a copper board performs great direct drive on two cells.

so which FET should be used then if the vishay is out production?

yep, there are fantastic projects on this forum, really fantastic open projects but they lack just 1% more effort, to keep all features and instructions on one place, i.e. in the first post, such as

features
specifications
known issues
bill of material
assembly instructions
known issues/bugs
changes list / release notes
credits
3rd party sw/hw used

I work in a corporation so we are drilled from day one to pay attention to keeping documentation in shape. I’m very motivated to do stuff but the info is scattered around, and it’s quite inefficient having to go through all the posts in a thread to gather all necessary info.

Yes, the problem is of course that this is all hobby, we're doing it for fun, and however useful it is, maintaining documentation is a pretty boring thing to do...

Absolutely, the info is free and it’s all for fun so there’s little incentive to maintain the first post with needed info, i’m just saying: for newbies on this forum it can be frustrating the amount of info/posts you need to chew through to get the info you need about a project. Of course when you’re a veteran you already know everything there is to know and you probably don’t even notice the missing info.

I use my own e-switch firmware, based on JohnnyC's and can choose what MCU pin I want the switch on - choices are pin #2, #3, or #5 I believe (see code below). Mine by default is on MCU pin #2 and I believe this is typical, most common. Since the BLF17DD has to be flashed with firmware, the pin definition is defined by that firmware, not the hardware. Looked through my pics and found this one with a BLF17DD built in a Convoy L4, and it clearly shows the e-switch wire on MCU pin #2. comfy is correct in post #74:

Here's part of the code header definitions in my e-switch driver. I added more comments than what was there originally. I'm a consulting software engineer with 35 years experience in software development, so know how important it is to have good doc and reference material. but also know there can be too much, redundancy can be a bad thing, and attempting to document things you really don't understand can be worse than no documenting. Sorry for the poor formatting in html:

//-------------------------------------------------------------------------------------
// Used for FET based Phase Corrected PWM:
//-------------------------------------------------------------------------------------
#define MODES 0,2,25,255 // 4 modes %: 1-10-100 (for Cheng - no strobe)

//#define MODES 0,12,64,128,255 // 4 modes %: 5-25-50-100 (for Kenny's Warsun, Y3 - no strobe)

//#define MODES 0,1,12,102,255 // 4 modes: %: ml-5-40-100 (for Michael G. w/strobe)

//#define MODES 0,1,4,16,100,255 // 5 modes

// RMM - used in a MT-G2 build (5 modes):
//#define MODES 0,1,4,25,120,255

// RMM - also used this set (6 modes):
//#define MODES 0,1,4,8,20,110,255

//-------------------------------------------------------------------------------------
// Used for 7135 based Phase Corrected PWM:
//-------------------------------------------------------------------------------------
//#define MODES 0,5,15,92,255 // 5=moonlight, 15=6%, 92=36%, 255=100%

// Original mode settings, used with Fast PWM:
//#define MODES 0,16,32,125,255 // Must be low to high, and must start with 0

//-------------------------------------------------------------------------------------

#define LONG_PRESS_DUR 21 // How long until a press is a long press (32 is ~0.5 sec), 21 = 0.336 secs

#define PWM_OPTION 0x21 // 0x21 for phase corrected (9.4 kHz) or 0x23 for fast-PWM (18 kHz)

// ----- One-Click Turn OFF option --------------------------------------------
#define IDLE_LOCK // Comment out to disable
#define IDLE_TIME 75 // make the time-out 1.2 seconds
// ----------------------------------------------------------------------------

// ----- Option Strobe Mode ---------------------------------------------------
//#define ENABLE_STROBE
//#define XLONG_PRESS_DUR 48 // 38=0.6 secs, 48=0.75 secs

// ----- Turbo Settings -------------------------------------------------------
//#define TURBO // Comment out to disable - full output, step downs after n number of secs
// If turbo is enabled, it will be where 255 is listed in the modes above
//#define TURBO_TIMEOUT 5625 // time before dropping down (16 msecs per, 5625=90 secs)
// ----------------------------------------------------------------------------

// ----- Voltage Monitoring Settings ------------------------------------------
#define VOLTAGE_MON // Comment out to disable - ramp down and eventual shutoff when battery is low

#define ADC_LOW 130 // When do we start ramping (3.1v), 5 per 0.1v
#define ADC_CRIT 115 // When do we shut the light off (2.80v)
#define ADC_DELAY 188 // Delay in ticks between low-bat rampdowns (188 ~= 3s)
// ----------------------------------------------------------------------------

/*
* =========================================================================
*/

#include <avr/pgmspace.h>
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include <avr/wdt.h>
#include <avr/eeprom.h>
#include <avr/sleep.h>
//#include <avr/power.h>

#define STAR2_PIN PB0 // Star 2, MCU pin #5
#define STAR3_PIN PB4 // Star 3, MCU pin #3
#define SWITCH_PIN PB3 // Star 4, MCU pin #2, pin the switch is connected to
#define PWM_PIN PB1 // PWM Output, MCU pin #6
#define VOLTAGE_PIN PB2 // Voltage monitoring input, MCU pin #7

#define ADC_CHANNEL 0x01 // MUX 01 corresponds with PB2
#define ADC_DIDR ADC1D // Digital input disable bit corresponding with PB2
#define ADC_PRSCL 0x06 // clk/64

#define PWM_LVL OCR0B // OCR0B is the output compare register for PB1

#define DB_REL_DUR 0b00001111 // time before we consider the switch released after
// each bit of 1 from the right equals 16ms, so 0x0f = 64ms

There's things bout the DigiKey shopping cart feature I don't understand - when I click on the link I have in the OP from July 12th, it clearly has a FET in it. It's very simple to follow the link, then click on the part and get all the specs DigiKey has on it - it's far more complete and detailed than I could ever document myself. It would be a waste to redundantly attempt to produce detailed specs on all parts here - DigiKey and the manufacturer's spec sheets are far more comprehensive - I totally disagree with any suggestion to list part specs here. Also I'm no EE so really can't cherry pick out the most important specs of each part. When I started to build these custom boards, my problem was first, the parts list, second - figuring out where to place the parts, so for these two major issues I think (thought) this OP addressed that. I'm totally open though to suggestions, but getting into general part specs and specifics on firmware seems beyond scope here, maybe it shouldn't be. I know somewhere there is a thread/google doc of a listing of all shared/public firmware drivers and mine is in that list - forgot where, but I should add that link to the OP -- if I can find it Smile. From there, there should be a ref doc/spec on each of those versions. I try to document my stuff in the header/beginning of the driver code - others do this as well, but I'm sure could be done better.

Unfortunately, changes have been moving along fast that I can't keep up with. New versions of these boards have been appearing, maybe being untested/tested, but certainly faster than I can buy/receive/build up/document here. The variations are endless as well.

Important: Just so you understand, the BLF17DD driver used in the above pics is no longer available - it's obsolete. The new one identified as V1.0 on the board, I do have but have not built one up yet and tested, so can't update the pictures yet.

Thinking of adding a section in the OP called "History/Background" where I attempt to doc how and why these boards came about. The "OSHPark Projects" thread doesn't attempt to address it. The thread that really started all of this was created by comfy - I know it's big and long and packed with lots of useful info, but not summarized well anywhere I know of.

Here it is: https://budgetlightforum.com/t/-/25164, but still think there's more somewhere...

Think I found the driver list/repository: Link for all known shared firmware versions: https://www.dropbox.com/sh/yjq5ahllbuqf1zh/0ZaizdmY-E (not sure how updated this is), but just looked at it and there's a wealth of reference material, not just firmware...