BLF 15 & 17dd_PIC : final version update 10/14

Current info 10/14: Final update for the 12F617 boards, I will be switching to 10F322 MCU (Which are WAY cheaper) which also has the code written in C for all us idiots (all thanks again to tterev3

I've learned the proper way to use poly's in eagle and have made a final revision to the board, I've moved the CAP's and polarity diode to the bottom (note I'm not using C2 on the 17's, C1 on the 15's). Other changes include making the SW+ via large enough for 26AWG wire and a Z1 silkscreen mark (you stack it over C1). About the SwLED via's, these can be used to wire a switch LED to (which will flash as the indicator if switched from the main LED in the code and enabled with the config option). You can also solder the legs of a 2/5mm encapsulated LED straight to them. [This next part is ONLY for the 17] and they're spaced correctly to use a 0805 directly on the board if it can be lined up properly for that. It's masked incase you done need / want to use a switch / indicator LED so just gently scrape it off to use. [again not so with the 15].

BLF 17dd_PIC v2.1

(mouseover)

BLF 15dd_PIC v2.1

(mouseover)

I have built several of both of these all working fine (tho one is giving me issues, but its isolated and it still works even when it happens so it wont leave you in the dark). Up next is a 7135 board I have ordered but haven't yet received. I'm posting it here incase anyone wants to order but I'm not gona say its G2G till I have them together and running, especially since its an all new MCU and code. Also note, there is a clicky switch UI thats available now too, its a very basic UI that can be built from.

10x7135_PIC v0.4

(mouseover)

Note I do not plan to develop the 12Fxxxx boards or code any further, I also have new 17dd boards on order for the 322.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

EVERYTHING BELOW THIS LINE IS SUPERSEDED BY ABOVE

See reply 32 for info on new 17mm 7135 driver with clicky FW!

I've been looking for a better momentary switch FW for a while and I've finally found it! I've started using "The Ultimate Flashlight Code" by tterev3, an open source (single channel) FW he wrote a few years back but as far as I know up till now he's the only one that used it (atleast around here). I've took and modified remade starting from scratch, the BLF 15 and 17dd drivers to use a Microchip PIC MCU, specifically the 12F617. The MCU can handles voltage monitoring internally so no voltage divider circuit is needed making all components for both drivers fit on the top!

OSHPark links:

BLF 15dd_PIC_v2.1 READY TO ORDER

BLF 17dd_PIC_v2.1 READY TO ORDER

10* 7135_PIC_v0.2 NOT READY TO ORDER, only shared in case you want to play with it

Universal parts:

U1 = 12F617 (10F322 on the 10*7135 board)

D1 = SOD-323 (standard 105c polarity diode)

C1 = 0805 10uf XR7 (standard 105c cap) required

C2 = 0805 10uF (this cap may not be needed at all, will take further testing to determine, this is the cap to do the same thing as the new location for the AVR drivers a la comfy style)

Driver specific parts:

17 FET = DPAK such as the 70N02 and AOD510

15 FET = SOT-23 such as the AO3400A and IRLM 2502

For a general tutorial to get setup for PIC you can read threw tterev3's thread, the picKIT3 can be purchased from between $25-40 (I paid $27 for mine on ebay and it came in about a week but I had to make an offer, it was regularly $33 and on sale for $31).

You will need 2 other files: One, the part-specific header file (P12F1822.h ) is included in the Microchip suite of software, the other is an instruction file (instructions.inc) you can get from my drop box. You can see when and where you need these two files in tterev3's tutorial.

All credit for the FW to tterev3, you are free you use and modify the code for private use but please do not rehost the code. tterev3 is happy to field any code related questions and I will try to answer hardware questions and some basis code stuff.

Ramping only code (video example)

Ramping / non ramping code (same code but with an additional configuration option to turn off the ramping and enable 4 arbitrary levels)

If you are using this code for a dual switch light and want the light to come on when power is applied (when the tail clicky is turned on) you can add a few lines of code to the initialization section at line 427, I'll post that change in the first post below.

So you can see it in action I've created these 3 short videos, I tried to keep them short but I'm notoriously long winded and its a lot to cover, each one turned out 3-4 minutes. I will be remaking these video's once my Y3 gets here and I have a dual switch light to put these in. If anyone is interested in one of these drivers before they can get setup with PIC I will be happy to program MCU's for you for no charge (just pay~$2 for the MCU and shipping) and tterev3 would probably be able to help you out as well but I didnt talk to him about that yet.

These 2 videos are a demo of the 12F617 version of the code, ag stated I do not plan to develope this hardware / FW anymore not that its available in C and in a smaller package!

Video 1: UI

video one covers how to use all modes / shortcut’s and how to set “primary level”

Video 2: configurations

covers all config’s again including primary level

I recommend making some code changes, if you don't need the dual switch feature you can comment these lines back out then it'll be there when you do need it.

Dual switch setup (turns on when power is applied) changes starting at line 427 to 437:

Initialize

clrf flags
clrf flags2
clrf mode
clrf mode_previous
movlw .10
movwf slower
call read_NVM
movfw primary
movwf bright
clrf mode ;These 4 lines make light with with dual switch (come on when power is applied)
movfw bright ;comment these lines out to disable feature
call set_output ;light is only able to come on at the primary level (possible to change it to come on it max by changing next line)
goto normal_mode ;power cycling will reset all temporary settings (i.e. strobes and/or other volotile memory)

to change the the minimum level at which below the ramp will start out moving up change the value at line 578

To change the timing of the locator beacon (the flash when off) change the hex value at line 395, to change from 5sec to 8sec change b00011001 to b000111011. To change the brightness of that blip change the value on line 207



One thing that can be a little confusing with MPLAB is knowing what toolsuite to use since in the PIC quick start guide the XC8 compiler is used for that code, this code is compiled in the MPASM Assembler, make sure you select that option in the project wizard.

Thanks for doing these videos!

I wanted to make one clarification: the tactical option locks the light in whatever mode is currently selected, not just maximum, and makes all use momentary-only. You could go to a strobe, for example, enter the menu, activate tactical, and you would then have the light in momentary-only strobe.

hahahahah video #2 strobe made your camera go BANANAS.

Thanks for videos/hard work!

Thanks for the great write-up CK. :bigsmile:

Exciting stuff going on here. Thank you for sharing all that great info.

I don’t understand any of this but, from you have been telling me, you get a huge thumbs up from me.

I don’t really understand it, but I like the end result.

will be trying to wrap my mind around this in the near future…

Thanks guys, gotta get caught up on customer orders but this week I will be doing an 8x 7135 driver as well as a 10mm dd version

Oooooooo! The 10mm version piques my interest for certain! The BLFTiny10 is working in my Texas Poker, but it’s a pita with components on the battery side of the board, it being a twisty. This would solve the issue and allow me to fine tune a brass post so the light contacted perfectly at the closed or tight position!

Will definitely be wanting to know about that one, might just want you to build me one as it’s the only light I have that would require that size and MCU combination.

Nice!!!

One more thing I noticed in the first video that I wanted to clarify:

The shortcut to max is a click-press from on, but it’s just a double-click from off. The reason for this is so that you can also use max from off in momentary mode: click-press and hold for as long as needed, then release and it will go back off and the previous level is still remembered. I think this is why you had some issues doing max from off in the first video. If you want to latch on, just double click, don’t try to hold down on the second press. Does that make sense? It’s tough to describe click commands in text

Ok guys I’m feeling pretty down not one person has ordered any of these yet…

I put a lot of time/work into designing, building and testing these things. As you can probably guess these are not the original versions, there were several previous attempts (these are actually my 3rd set of boards). Someone please start using them! The FW is much much more advanced that any modded version of STAR (but still extremely simple to operate), I mean totally different level of stuff here, everything people complained about with STAR / Werner’s UI has been fixed in the UFLC (its called “Ultimate flashlight code” for a reason!)
Things like direct access to off from any level, shortcut’s to max and the user set primary level (shortcut’s direct from off and from any other mode). HIDDEN strobe (and not just 1 but three strobes including one with a completely adjustable strobe speed and duty cycle allowing you to freeze objects in place. Truly momentary operation. Not to mention the multiple different config options that are done in-light (no coding required) so you can customize each light to how you need it to operate!

Now I understand not many of you are setup for PIC, thats why I’ve made multiple offers to flash the MCU’s for you for no charge, all the rest of the parts are the exact same parts as the AVR drivers, the same AOD510 FET’s and the cap’s are the input / smoothing cap from a 105c.

Is there something I can do to get someone to order some of these? What if I build them for you (for free of course, open source after all). I’ll give you another option, for the exact cost of the parts plus $.50 for my to ship it (not a single cent markup for my time) I will ship the first 5 people to take me up on this one of these drivers, I have all parts on hand and can ship out first of the week. The price would be $5.25 each ($4.75 in parts plus a postage stamp)

I should mention-I’m not pushing for anyone to buy anything from me, this is a dedicated open source project. In fact the MCU and the boards are the only new parts you need to buy (about $6 total for 3 MCU’s and a set of 3 boards) everything else is standard 105c parts and the same FET’s used on the old AVR 15 and 17DD’s), just please someone install one in something and make me feel like this wasnt a total waste of my time

Not that I wouldnt have done these for myself, of course I would, thats why I started them in the first place but I certainly wouldnt have done them to the level of refinement I did had it only been for myself nor would I have made a whole write up and set of videos about it just for myself… Just saying, know what keeps us oshpark board designing guys happy and keeps us wanting to design more stuff? Its definitely not people totally ignoring the projects we put out. Its one thing if I made a driver for one specific light that isnt very popular but these are very wide application…

I also have a redesign (using a 10F322) that is power cycle controlled but I’m not sure its worth my time if it seems like no one is going to use it anyway and just stick with the same old AVR / STAR stuff…

/rant

I will just start sending my lights to for the next month or until life settles down with the new baby, hehe

@Cereal_killer
I am in!
You have a PM.
I want a driver for my Roche F6.

Will this work with a twisty? I saw where you might try a 10mm version and my premier light is that size, but a twisty.

I’m thinking this would work very nicely in my new Fenix TK22 with dual switches. I had about decided to leave this one stock but had occasion to use it to guide a car in a parking lot Sunday night and it was rather anemic. So I’ll be looking at this driver as the light itself is actually a pretty dang nice light.

PM sent, hope I made sense! lol

Just watched all 3 vids and see that this probably wouldn’t work well with the small twisty.

The Fenix TK22 would be an ideal choice, with tail clicky and side e-switch. I also have a Convoy L4 that is a likely candidate. Would a TK61 work well with this? Using the driver as a master and running an HX1175b1 as the slave? Wondering if the 2 e-switches might be utilized to work as power on and mode selection as it was from the factory. Right now I’m using both switches in parallel to do the same thing.

Wondering too if the UI is written down, my memory is horrible and I’d need to work on the options a lot to be able to remember how to use it. :slight_smile:

What you just posted in actually something I’m working on now, I’m not sure when (if) it’s going to work out, it’s not exactly at the top of the list but it is something physically on my bench (that’s more than some of my other projects lol). I’m also not sure about the possibility if a second e-switch input, I can tell you that while it may be possible it would mean the MCU could no longer be flashed ICSP (if/when MCLR has a physical connection it doesn’t allow on board flashing since the pickit3 senses it as a short).

Also I’ve switched over to running a different PIC (a 12F617, a direct drop in replacement for the more expensive 1822). The UI is nearly identical (only the strobes are changed) but battery monitoring is added as well as the ability for the driver to reconfigure the locator beacon from the main emitter to a SMD emitter placed under the switch boot [requires code changes, not in the config menu].

I’ve also updated the board to allow a 22AWG sw+ wire to fit the via (stupid mistake originally).