Flashlight Firmware Repository

2223 posts / 0 new
Last post
Dutcheee
Offline
Last seen: 16 min 38 sec ago
Joined: 12/19/2015 - 21:40
Posts: 474
Location: Netherlands

I used Hoop’s how-to and got a positive test in AVRdude on the BLF attiny13A
How to flash

However I downloaded the latest software, and can’t find the attiny13A in the latest atmel studio. Think I’ll have to downgrade.
But the drivers for the USBasp and AVRdude work fine on my windows 10 system.

Hope this helps..

Tom E
Tom E's picture
Offline
Last seen: 2 hours 26 min ago
Joined: 08/19/2012 - 08:23
Posts: 12691
Location: LI NY

will34,

This is the ultimate, best source of AVR support/drivers/etc. I know of. I used this for full 8.1 support, think also for Win 10: http://www.protostack.com/accessories/usbasp-avr-programmer. Download and use the latest there. Mine works for the 5v position, not the 3.3v.

I bought my first USBasp from Protostack, then bought my 2nd from FastTech - both worked perfect. One died on my recently, so just ordered another from FT, as I always like having a backup on-hand.

Very Important: Pin #4 on the USBASP V2.0 is not ground - it's TXD. I wire grnd to pin #10 now and it solved several problems I had - originally I followed the pinout description in flashlightwiki.com and it sort of/semi worked, and it's wrong for the newer V2.0 dongles.

I updated this page: http://flashlightwiki.com/AVR_Drivers, to show the proper wiring for USBASP V2.0

 

Edit: Hoop thread's OP showing the wiring is wrong - I've proved this, did all the testing to prove it. Pin #4 on the dongle is not ground. It may work, it may appear to work - it's wrong. Using pin #10 for grnd is much more stable and reliable I've found.

 

 

will34
will34's picture
Offline
Last seen: 1 day 17 hours ago
Joined: 12/18/2012 - 00:12
Posts: 3695

I wired mine like this, following WarHawk-AVG’s guide:

Tom E
Tom E's picture
Offline
Last seen: 2 hours 26 min ago
Joined: 08/19/2012 - 08:23
Posts: 12691
Location: LI NY

Labeling is wrong, but the wiring appears correct smile.

will34
will34's picture
Offline
Last seen: 1 day 17 hours ago
Joined: 12/18/2012 - 00:12
Posts: 3695
Tom E wrote:
This is the ultimate, best source of AVR support/drivers/etc. I know of. I used this for full 8.1 support, think also for Win 10:“http://www.protostack.com/accessories/usbasp-avr-programmer”>http://ww.... Download and use the latest there. Mine works for the 5v position, not the 3.3v.

Thanks Tom!!! It worked! Party

Finally did my first FW flash after all these years. However it did not work with extreme burner AVR, it shows “mismatch at location 0×0000”. So I used AVRdude command instead, success in the first try.

Now I have my Courui D01 flashed with TK’s ramping FW, very nice!

Time to start desoldering leads… Smile

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 9 hours 22 min ago
Joined: 01/12/2013 - 14:40
Posts: 10241
Location: (469219) 2016 HO3

Tom E wrote:

Very Important: Pin #4 on the USBASP V2.0 is not ground – it’s TXD. I wire grnd to pin #10 now and it solved several problems I had – originally I followed the pinout description in flashlightwiki.com and it sort of/semi worked, and it’s wrong for the newer V2.0 dongles.


I updated this page: http://flashlightwiki.com/AVR_Drivers, to show the proper wiring for USBASP V2.0


Holy cats!

You just un-bricked like a dozen of my drivers. I had a bunch which refused to flash, but I moved one wire, tried a dead driver, and it lives again! I’ve seriously had a wire in the wrong place all this time??? Wow.

Would have been nice to know this last summer. Smile

Halo...
Halo...'s picture
Offline
Last seen: 3 years 7 months ago
Joined: 12/15/2011 - 02:39
Posts: 3304
Location: Halo island
Shocked ToyKeeper too.

When I first got a usbasp I searched google images for the pinout. I found tons of bad pinouts so I didn’t trust any of them. It’s a little conspiracy.

The problem with the bad pinouts, as you’ve seen, is that leaving the gnd unconnected actually works on some chips.

Tom E
Tom E's picture
Offline
Last seen: 2 hours 26 min ago
Joined: 08/19/2012 - 08:23
Posts: 12691
Location: LI NY

Oh boy, good news/bad news (smilecry). Really sorry, but I thought I made a big stink bout it at the time. Even got update access to the flashlight wiki to correct the errors, just didn't want to remove the original stuff because I really was unsure if the old dongles were still around.

Think Halo confirmed this at the time as well, also WarHawk had it right way back.

I encountered these problems early on with the 25/45/85's, researched it, then found the fix, but some others already knew about it. It's probably all in the early part of the 25/45/85 thread, I think.

Ok - looked it up, here we go:

Problem - Post #233 here: http://budgetlightforum.com/comment/822738#comment-822738

Problem - Post #241 here: http://budgetlightforum.com/comment/822832#comment-822832

Solution post #263 here: http://budgetlightforum.com/comment/824288#comment-824288

Post #265 mentioned same as just posted earlier: http://budgetlightforum.com/comment/824315#comment-824315

 

 

LightRider
LightRider's picture
Offline
Last seen: 1 year 11 months ago
Joined: 08/05/2015 - 09:52
Posts: 2007
Location: U.P. MI, USA

Well I’ve now set up to build my own drivers. Did some practice by flashing luxdrv to a couple 105c drivers. So, I am finally ready to attempt one of these drivers. Could someone some up for me what firmware is out there that will work well with these triple down boards? I love the ability for the user to choose between two mode groups. I’ve been looking at the firmware repository, but I’m a little lost trying to sort through it all.

pilotdog68
pilotdog68's picture
Offline
Last seen: 4 months 2 weeks ago
Joined: 05/30/2013 - 23:31
Posts: 6420
Location: Held against my will in IOWA, USA

PPDB22 wrote:
Well I’ve now set up to build my own drivers. Did some practice by flashing luxdrv to a couple 105c drivers. So, I am finally ready to attempt one of these drivers. Could someone some up for me what firmware is out there that will work well with these triple down boards? I love the ability for the user to choose between two mode groups. I’ve been looking at the firmware repository, but I’m a little lost trying to sort through it all.

So far just one firmware (that I know of) that works with the TripleDown. It’s a variation of the BLF-A6 firmware, so it does have 2 mode groups. It is linked in the OP of the TripleDown thread. As downloaded it is set up to test driver function, so you will need to edit some values to give proper function,

My Favorite Modded Lights: X6R, S8 , X2R , M6, SP03

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

LightRider
LightRider's picture
Offline
Last seen: 1 year 11 months ago
Joined: 08/05/2015 - 09:52
Posts: 2007
Location: U.P. MI, USA

Is alt pwm the third channel?

pilotdog68
pilotdog68's picture
Offline
Last seen: 4 months 2 weeks ago
Joined: 05/30/2013 - 23:31
Posts: 6420
Location: Held against my will in IOWA, USA

PPDB22 wrote:
Is alt pwm the third channel?

ModesNx are the larger bank of 7135s. Modes1x is the single 7135. Put the word TURBO to toggle the FET

My Favorite Modded Lights: X6R, S8 , X2R , M6, SP03

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

LightRider
LightRider's picture
Offline
Last seen: 1 year 11 months ago
Joined: 08/05/2015 - 09:52
Posts: 2007
Location: U.P. MI, USA

Ok. I don’t real know what I am doing, but I might as well jump in and learn to swim:)

Can the FET only be toggled? I got the attiny85 for the added pwm, so will the 85 go to waste with this firmware, or is there still benefit? Sorry if my questions sound like I don’t know what I’m talking about. please humor my ignorance:)

pilotdog68
pilotdog68's picture
Offline
Last seen: 4 months 2 weeks ago
Joined: 05/30/2013 - 23:31
Posts: 6420
Location: Held against my will in IOWA, USA

I don’t know how it works with anything other than a 13, or even if it will work at all. I personally have not left the 13

My Favorite Modded Lights: X6R, S8 , X2R , M6, SP03

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

Tom E
Tom E's picture
Offline
Last seen: 2 hours 26 min ago
Joined: 08/19/2012 - 08:23
Posts: 12691
Location: LI NY

PPDB22 wrote:
Ok. I don't real know what I am doing, but I might as well jump in and learn to swim:) Can the FET only be toggled? I got the attiny85 for the added pwm, so will the 85 go to waste with this firmware, or is there still benefit? Sorry if my questions sound like I don't know what I'm talking about. please humor my ignorance:)

Don't think there's any added PWM (??).  25/45/85 all have the same PWM limits, as I understand it.

LightRider
LightRider's picture
Offline
Last seen: 1 year 11 months ago
Joined: 08/05/2015 - 09:52
Posts: 2007
Location: U.P. MI, USA
Tom E wrote:

PPDB22 wrote:
Ok. I don’t real know what I am doing, but I might as well jump in and learn to swim:) Can the FET only be toggled? I got the attiny85 for the added pwm, so will the 85 go to waste with this firmware, or is there still benefit? Sorry if my questions sound like I don’t know what I’m talking about. please humor my ignorance:)

Don’t think there’s any added PWM (??).  25/45/85 all have the same PWM limits, as I understand it.

I was talking about the number of outputs, but clearly I don’t know enough to be asking questions yet. I will keep reading. Facepalm

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 9 hours 22 min ago
Joined: 01/12/2013 - 14:40
Posts: 10241
Location: (469219) 2016 HO3

Oh, um, the attiny13a has one PWM counter and two PWM channels. A 3-channel driver will need to use a general I/O pin for one of the channels, which is useful if you want a super-bright turbo and don’t care about the levels between turbo and 100% 7135. So, like, you could use 7135s to go smoothly from moon to about 1000 lumens, then go directly to a 3000-lumen turbo, and you wouldn’t be able to access anything between 1000 and 3000 lumens.

The tiny25/45/85 have two PWM counters and four PWM channels. So, it should be able to go smoothly all the way from moon to turbo even on a 3-channel driver.

I got a tripledown attiny25 board yesterday and am hoping to get bistro working on it soon. So far all I’ve done is update the ramp calculator to support 3 channels, and haven’t gotten into the actual driver code yet. Bistro works on it in 2-channel mode (1×7135 and 6×7135), but the third channel (FET) is currently unused.

LightRider
LightRider's picture
Offline
Last seen: 1 year 11 months ago
Joined: 08/05/2015 - 09:52
Posts: 2007
Location: U.P. MI, USA

ToyKeeper wrote:
Oh, um, the attiny13a has one PWM counter and two PWM channels. A 3-channel driver will need to use a general I/O pin for one of the channels, which is useful if you want a super-bright turbo and don’t care about the levels between turbo and 100% 7135. So, like, you could use 7135s to go smoothly from moon to about 1000 lumens, then go directly to a 3000-lumen turbo, and you wouldn’t be able to access anything between 1000 and 3000 lumens.

The tiny25/45/85 have two PWM counters and four PWM channels. So, it should be able to go smoothly all the way from moon to turbo even on a 3-channel driver.

I got a tripledown attiny25 board yesterday and am hoping to get bistro working on it soon. So far all I’ve done is update the ramp calculator to support 3 channels, and haven’t gotten into the actual driver code yet. Bistro works on it in 2-channel mode (1×7135 and 6×7135), but the third channel (FET) is currently unused.

Ok. Thanks. I was just reading your posts in the tripledown thread. I mistakenly posted a question about the tripledown firmware here. Oh well.

I think you are working on exactly what I am looking for so I will continue to follow the tripledown thread anxiously awaiting your developments. For now I’m going to continue to practice flashing firmware with small customizations so hopefully I will advance my knowledge a bit.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 9 hours 22 min ago
Joined: 01/12/2013 - 14:40
Posts: 10241
Location: (469219) 2016 HO3

After someone else confirms it works, and maybe the defaults are tweaked back to a more user-focused config, I should be able to merge the tripledown-bistro code into trunk. For now, it’s working but is only in the tiny25 development branch.

For tiny13-based tripledown drivers, that’s a different matter. It can’t do PWM on the FET pin, and it has only half as much space, so it’s significantly trickier to get working.

Microa
Offline
Last seen: 18 hours 15 min ago
Joined: 06/29/2011 - 21:20
Posts: 236

Dear ToyKeeper,

I have flashed your Baton FW for my light and it is great. I noticed that the green and the red indicators were turned on and off during the transition period when the voltage was dropping to the on/off threshold. Can you help me to make it turned on/off sharply.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 9 hours 22 min ago
Joined: 01/12/2013 - 14:40
Posts: 10241
Location: (469219) 2016 HO3

Hi, um, what exactly is it doing, and what do you want it to do?

In my testing, the indicator tends to stay green above 3.9V or so, then starts to flicker orange occasionally, and the flicker gets longer and more frequent as it gets near the next voltage threshold. Eventually it goes fully orange and stays that way. Then as the cell voltage drops more, it eventually turns red. But I haven’t seen the same soft flickering transition effect between orange and red.

I think this is because the voltage measurement is made out of phase with the PWM signal. So, sometimes it measures with the main emitter off, sometimes with it on. And this results in pretty different readings depending on when exactly the measurement was taken. It was unintentional but I kind of like the result since it gives a finer resolution, more than just green/orange/red.

At lower voltages it doesn’t seem to matter as much. The emitter isn’t using as much power so it probably doesn’t vary as much.

If you want it to not flicker orange as it nears the orange threshold, it’ll need to sync the measurements to happen at a consistent part of the PWM cycle. I’m not sure how to do this though.

Microa
Offline
Last seen: 18 hours 15 min ago
Joined: 06/29/2011 - 21:20
Posts: 236

Thanks for your prompt reply.

What I want to do is that you have explained. I have modified the code that
FULL BATT indicator off
LOW BATT indicator on
ALMOST EMPTY indicator blink

As you have said, the led flickered before it was stably on. I try to get rid of the flickering. It seems that is not easy to be done by changing a few lines of the code.

LightRider
LightRider's picture
Offline
Last seen: 1 year 11 months ago
Joined: 08/05/2015 - 09:52
Posts: 2007
Location: U.P. MI, USA

ive been playing around with tk’s starry-offtime firmware(and others). Does anyone know where i can find the .h files that are referred to in the STAR firmware? Or do i not need them? Thanks for any help! These are the files i am talking about:

#include
#include
#include
#include
#include
#include
//#include

LightRider
LightRider's picture
Offline
Last seen: 1 year 11 months ago
Joined: 08/05/2015 - 09:52
Posts: 2007
Location: U.P. MI, USA

oops!

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

fixed it
Offline
Last seen: 3 months 2 days ago
Joined: 12/08/2015 - 14:27
Posts: 396
Location: Canada

PPDB22, they are installed with the “avr-libc” package on linux distributions. Not sure what the equivalent is on windows. If everything is installed correctly, they should be found automatically by the compiler.

LightRider
LightRider's picture
Offline
Last seen: 1 year 11 months ago
Joined: 08/05/2015 - 09:52
Posts: 2007
Location: U.P. MI, USA

hmm. ok so are they created when i build the hex? excuse my ignorance!

LightRider
LightRider's picture
Offline
Last seen: 1 year 11 months ago
Joined: 08/05/2015 - 09:52
Posts: 2007
Location: U.P. MI, USA

or are you saying they should be part of my avr software package? sounds like i should just build the file and give it a try then…

fixed it
Offline
Last seen: 3 months 2 days ago
Joined: 12/08/2015 - 14:27
Posts: 396
Location: Canada

PPDB22 wrote:
or are you saying they should be part of my avr software package? sounds like i should just build the file and give it a try then…
Yes, they should come installed with the compiler. You won’t be able to compile most firmware without them. They’re official atmel stuff: http://www.atmel.com/webdoc/AVRLibcReferenceManual/group__avr__eeprom.html

What are you using to compile? On which OS?

LightRider
LightRider's picture
Offline
Last seen: 1 year 11 months ago
Joined: 08/05/2015 - 09:52
Posts: 2007
Location: U.P. MI, USA

I’m on Windows 10. I’ve only flashed four drivers so far. I asked about these files because I compiled a different firmware with errors caused from missing files. I fumbled through fixing that so when I came to this firmware and saw it referenced some files I went looking for them. Thanks for you help. I’ll get to try it out tonight if my day goes well:)

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 9 hours 22 min ago
Joined: 01/12/2013 - 14:40
Posts: 10241
Location: (469219) 2016 HO3

In C, any include with <> symbols is assumed to be provided by the host system. Includes with quotes come from the specific project being built.

So, all those mentioned should be available by default if the AVR toolchain is installed correctly.

Pages