Flashlight Firmware Repository

Oh, I have one of those. I ran Ferrero_Rocher/Ramping_UI_table on it.

It was okay, but the ramp resolution at the bottom was very coarse, and it had no extra features except battcheck. Giving it an attiny85 would give it more features, but would not improve the ramp resolution. Also, you’ll probably have to compile a custom version of the code to make it work, because I don’t think there are existing recipes for any single-channel drivers.

It may also be desirable to remove the voltage divider resistors, to reduce standby current, after getting everything else working. The tiny85 code can get that info from a different pin, so the divider isn’t needed any more.

Maybe the Ferrero_Rocher/Ramping_UI_table would do for me. I rarely use the special modes and the ramping sounds good. So I can just reprogram the soldered Attiny13 and do not need to change it. Also it would be too much for my limited coding experience to compile custom codes. Many thanks for all your useful advice and flashlight firmware!

Is there a driver schematic repository? I’m sure all the old hands know what pins go to where and the values of the passives from memory. I don’t.

I’m working out the Convoy 3/5 mode driver. It looks similar to a Nanjg 105C. Schematic for the Nangj is

Vcc cap and PB2 voltage divider appear to be the same but with different values. PB1 (pin 6) is connected to the 7135s.

Pins 1,2 and 3 are n/c ?

I got out the magnifying glass. Same as Nanjg without the stars.

Looks like this:

Battery + goes to cathode of D1. Battery - connects to the tail switch.

Hi TK and all BLF friends.
I would like to use crescendo in my TA drivers, but I’m having some trouble.
If I include the thermal regulation in the compile, the resulting hex file became too large for the attiny 25, even setting optimize to size in the toolchain menu.
If I deactivate all the special modes like bike, strobe, beacon etc, or reduce the ramp size, than I can use thermal regulation, because the hex file size became smaller, but that is not a real solution.
Is it possible to use crescendo with the special modes and thermal regulation for the attiny 25?

I get 2008 bytes for the FET+1 build, and 2016 bytes for the 3-channel build, without changing anything else. It can be up to 2048 bytes before running out of room. I’d suggest trying the compiler settings in bin/build-25.sh to get it to compile to the expected size.

TK thanks for the reply.
Later tonight I’ll try the build-25.sh and post here the results.

TK, could you please explain how to use the build-25.sh on a AVRStudio project?
I already downloaded the build-25.sh from your repository.

Nope, I can’t really do that. I’ve never used AVR Studio. About all I can say is that you’ll have to find the places in the GUI where all those compiler options are hidden… but I don’t know where to look.

Sorry, there is no driver schematic repository. I don’t even know how the concept of open-source would apply to something like that.

TK, what software do you use to compile instead AVR Studio?

Instead of AVR Studio, I use the tools and commands listed in the bin/build*.sh scripts.

AVR Studio uses the same tools to compile things, but it adds a bunch of extra layers around that to wrap it in a GUI. I don’t have any computers which are compatible with AVR Studio though, and don’t much care for GUI development environments, so I take a more direct route.

It’s all pretty easy to do under Linux, or in a Debian-like OS. This includes Windows 10, using its ability to run Ubuntu in a sandbox. Just a few commands to install the relevant packages, and then things mostly just work.

Most of the time, I just hit Up, then Enter. Or Up, Up, Enter. And things get compiled, or flashed, or whatever else it was I was doing.

TK, that’s way out my capabilities.
If I manage to make AVR Studio to compile crescendo with the thermal management included I’ll post here.
Thanks again.

Have you seen Guide: how to flash ATtiny13a based drivers (NANJG, QLITE, etc.) with custom firmware?

Hi g_damian.
Thanks for the link.
I have been using AVRStudio with success for some time.
My difficulty is specifically compiling crescendo with the thermal control activated and with the especial modes at the same time.
For some unknown reason the resulting .hex file is too large for the attiny 25.
I will try to investigate the cause of this problem.
Any help is appreciated.

I'm currently not at a PC with Atmel Studio installed, but check your settings for the project.

One big one is the -Os setting.

Otherwise, take a look at the command line flags reported in AVR/GNU C Compiler and compare that with the flags used in build_25.sh: https://bazaar.launchpad.net/~toykeeper/flashlight-firmware/fsm/view/head:/bin/build-25.sh

If there are some missing, I think you can add them under "Other optimization flags"

But from what I see, the most critical thing is Optimization level. You want -Os

Would the Gnu General Public Licence work? You have far more experience with GPL than I do.

For Eagle the source code would be the .sch and .brd files. The author would put a copyright and GPL notice in a text box in the schematic and layout.
Gerber files and images would be “object code”

The free version of Eagle will work for drivers. That should satisfy the “Corresponding Source” clause in section 1.

The PCB layout and source files can be copyrighted, but that might not cover the information in a schematic. If I understand correctly, the schematic might go under patent law, not copyright law. So the GPL and other similar licenses might not even be relevant.

Basically, I don’t have the background to answer this question… and a quick web search suggests that the answer is probably not simple.

A circuit can not be copyrighted but sometimes can be patented. Like any patentable invention, a patentable circuit needs to be new and non-obvious.

A copyright would apply to the drawing and the .sch file. Someone could redraw the circuit without violating the copyright. That goes against the sprit of GPL.

A patent for using pulse width modulation to regulate an LED flashlight was granted in August 2000.

Well, Arduino is such a thing. :slight_smile: