Flashlight Firmware Repository

I must be going insane. I’ve tried a wide range of values with no love.

I’m to the point where I would pay someone to just get this FW working for me as a whole.

I haven’t ordered a X6R yet or the driver / parts to upgrade it, but I might be able to get something working anyway.

You have no idea how appreciative I would be. I was hoping to have this light ready for my grandfather’s birthday… That was yesterday. Oops.

Wonder why it’s not working for you? Have you tried bypassing the resistor? I’m sure what ever TK comes up with will be much more elegant that what I have.

Its mystery time again gang.

I am using JCs dual switch firmware. I did use this once before without issue in a 12V setup and it was fine. However not so much today.

I flashed a FET driver with it today and changed only the modes and turbo time length. But the driver will randomly change modes. Always in the upward direction. It can be sitting still on the work bench on low for example, and in a few seconds will jump to the next mode or possibly even bounce a couple in a row.

Other than that it works perfectly. Stays in the same mode when power is disconnected, and switches like normal when the e switch pin is grounded ( I just touch the wire to ground for now there is not actual switch).

At first I thought bad connection so I redid them all. This did not effect it at all so I thought bad driver. Nope. New driver same exact result.


Anyone care to wager a guess?

I have tried to slim the firmware down, removing extra parts of the temp mon code and the low_to_high (as we can go either way with the switch) then got carried away adding features I’d like and Attiny25 support.
I will try and get a slimmed down version with just modes and for an Attiny13A

EDIT:
Lightweight version here
I will test later tonight confirm it works.

Been testing needs more work not 100% yet. Lightweight version doesn’t work.




At this point if someone even had a wild guess I'd entertain the thought :)

There is a feature in the voltage monitoring to increase mode is the volts bounce back up. Something might be wrong there.

Was the original version of the firmware working before you changed it? In other words, did you try flashing the original unmodified version of the firmware and test that before you modified it and re-flashed it? And if so when you tested the unmodified version did that work?

If so, try re-flashing with the unmodified version again and see if it works again.

If not, then maybe there’s something wrong or incompatible with the original version?

Any further progress?

I finally found work (yay) so I’ve been busy this week and haven’t had time to work on it anymore

Still not 100% I’ve got rid of extra bits and the turn off function works beautifully but when you unplug and try to turn it back on sometimes it will shut off after a second but if left for 6 ish seconds it works perfectly just need to get the turn back on function tweaked. I’ve just been really busy with work this week and trying to get some outstanding builds done. (Red S2+, MTG2 Mag and MTG2 MT40) I’ll keep playing with it after the weekend.

When you say “I finally found work (yay)”, did you mean you just got a new job? If so, congrats!!!

Jim

Is this a good program for flashing?

AVRDUDESS

It looks good to me, but most of this is still martian at my level of understanding…

I have been playing with it a bit, but not flashed anything yet…

I would appreciate more experienced “flashers” opinion.

Looks fine to me, a GUI wrapper for avrdude. I can’t really say much about GUIs or Windows or OSX though, since I don’t use them. Perhaps someone else has thoughts? Does AVR Studio have avrdude stuff built in?

My typical development session looks about like this:

tk @ home : ~/> cd src/torches/sandbox/ToyKeeper/foo
tk @ home : foo/> gvim foo.c
tk @ home : foo/> ../../bin/build.sh foo
tk @ home : foo/> ../../bin/flash.sh foo.hex
tk @ home : foo/> ../../bin/build.sh foo
tk @ home : foo/> ../../bin/flash.sh foo.hex
tk @ home : foo/> ../../bin/build.sh foo
tk @ home : foo/> ../../bin/flash.sh foo.hex
...

Except I don’t have to type most of that. The tab key auto-completes a lot of things, and the repeated commands at the end are simply “up, up, enter”. And I left out the revision control commands, but I recommend using bzr or git if you want to do much serious development.

Atmel Studio v7 released.

I was switching over to a new PC today, & went to d/load v6.2, but noticed that v7 had just been released.

I'm still d/loading as I type, so can't give any feedback yet.

Anyone else taken the plunge?

v7 Up & running, tested by building the A6 firmware.

Had to set the optimize for size (-Os), as per previous versions.

Cool. BTW, what size was the output? Does it let you see the actual gcc command line? I get 1002 bytes:

[-(Sun 2015-09-27 14:43:22)-(~/src/torches/trunk/ToyKeeper/blf-a6/)-]> ../../bin/build.sh blf-a6
avr-gcc -Wall -g -Os -mmcu=attiny13 -c -std=gnu99 -DATTINY=13 -o blf-a6.o -c blf-a6.c
avr-gcc -Wall -g -Os -mmcu=attiny13 -o blf-a6.elf blf-a6.o
avr-objcopy --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex blf-a6.elf blf-a6.hex
Program:    1002 bytes (97.9% Full)
Data:         13 bytes (20.3% Full)

Here's the entire output stream;

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

"D:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe" -o GccApplication2.elf main.o -Wl,-Map="GccApplication2.map" -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--gc-sections -mmcu=attiny13a -B "D:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny13a"
Finished building target: GccApplication2.elf
"D:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O ihex -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures "GccApplication2.elf" "GccApplication2.hex"
"D:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex "GccApplication2.elf" "GccApplication2.eep" || exit 0
"D:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objdump.exe" -h -S "GccApplication2.elf" > "GccApplication2.lss"
"D:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O srec -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures "GccApplication2.elf" "GccApplication2.srec"
"D:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-size.exe" "GccApplication2.elf"
text data bss dec hex filename
996 0 13 1009 3f1 GccApplication2.elf
Done executing task "RunCompilerTask".
Using "RunOutputFileVerifyTask" task from assembly "D:\Program Files (x86)\Atmel\Studio\7.0\Extensions\Application\AvrGCC.dll".
Task "RunOutputFileVerifyTask"
Program Memory Usage : 996 bytes 97.3 % Full
Data Memory Usage : 13 bytes 20.3 % Full
Done executing task "RunOutputFileVerifyTask".
Done building target "CoreBuild" in project "GccApplication2.cproj".
Target "PostBuildEvent" skipped, due to false condition; ('$(PostBuildEvent)' != '') was evaluated as ('' != '').
Target "Build" in file "D:\Program Files (x86)\Atmel\Studio\7.0\Vs\Avr.common.targets" from project "C:\Users\FmC\Documents\Atmel Studio\7.0\GccApplication2\GccApplication2\GccApplication2.cproj" (entry point):
Done building target "Build" in project "GccApplication2.cproj".
Done building project "GccApplication2.cproj".

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

Hi,

Does anyone know if there is firmware that works similar to the FT NANJGs, i.e., where you can switch between one of 2 mode groups via clicking in low mode and which would work with a single FET driver with PWM on pin 6 on an ATTINY13A:

Group 1: Low - Medium - High
Group 2: Low - Medium - High - Strobe - SOS

Also, where it’d be fairly easy to modify the modes in the mode groups in the source.

Basically, I want to have a UI in a ATTINY13A-based FET driver that mimics the FT NANJGs, but where I’d probably add a moonlight to both mode groups.

Thanks,
Jim