luxdrv - custom modes driver firmware with ramping

Change the TEMPMON variable at the start of the code. No idea what to though :)

There is no temperature monitoring code in any of the LUXDRV versions that I have (up to ver 030)

Pilot made a few changes and posted it as 0.3c up the page a bit. I have fixed a few typos on it and can post a link to it (otherwise the forum interprets a few sequences as emoticons) if need be?

I can’t add much to the discussion (still reading and trying to understand), but from a practical point of view I dislike low PWM frequency as I can hear it. My eyes are complete junk but I have excellent hearing and can hear high frequencies better than most, which unfortunately also ties in with my OCD as disliking high frequency whine :slight_smile: So the lupodrv equipped light running at 18 or 19kHz PWM is blissfully silent, whereas the JonnyC programmed one (standard Nanjg PWM freq I believe) is unpleasant to use on medium or low unless I’m in a noisy environment, such as riding off road.

Hello.
It is possible, make a backup of the original firmware 105c driver? …. Or firmware is protected?
thanks
Alexander

The original NANJG firmware is protected and can't be backed up.

You could use NLITE as an alternative.

My QLITE rev A drivers don’t seem to be protected. I have not tried to read/reload the firmware, but the protection fuses are not set.

Yes, that's why I knew what exactly they did wrong (PWM in high).

EEEEWWW…. really?

It’s not much, due to an error in their programing of the PWM generator, there is a very short (1 timer tick out of 256) glitch in the output when the light is on full. And due to the response time of the AMC7135 chips, not all of that glitch makes it to the output. Still, it’s rather bad form to let something like that by…

Also, regular NANJG 105 drivers also do it…

So, here I am, finally started to mess around with this, for start I just made new project in AVR Studio 4, project tipe: AVR GCC, copyed code from luxdrv-030.c to project window -> Build, and I get this msg:

always missing this *.elf file!!!

Also, how to get all those necessary files from nlite.hex or I can transfer hex directly to MCU with just:

remowed this: -Ueeprom:w:BLF-VLD.eep:a

For flashing Nlite I just have a .bat file with this inside:

avrdude -p t13 -c usbasp -u -Uflash:w:nlite.hex:a -Ulfuse:w:0x79:m -Uhfuse:w:0xed:m

Has to be in the same folder with nlite.hex, of course.

I have compiled the code of luxdrv-03c by AVR Studio 4 without any problem.

Well, that doesnt help much :frowning:
no matter what I do I always get same No such file message and the build fails, for some reason *.elf file is necessary to build hex.

What options you selected when opening new project?
I see you have set attiny25 as mcu but Nanjg drivers us attiny13A !

s.

strange thing happened: first I loaded Tido’s BLF-VLD Fixed Modes driver, and that worked fine (a bit confusing interface, thou) then I used upper command to load nlite.hex, avrdude said it’s all fine, job done, but driver still has a Fixed Modes UI as if loading nlite was only simulation and nothing was actually change, weird !

I'm far from knowing what I'm doing with this stuff, but I try to keep each one in its own folder and either use the .bat file in that folder, or open a command prompt from that folder. Sounds like something didn't get changed in the avrdude command and it loaded the VLD files again. Try copy/paste that string of text into a .txt file, save as nlite.bat, and put nlite.hex & nlite.bat in a folder all by themselves.

I opened a GCC new project and then selected the debug platform AVR Simulator 2. I selected attiny25 was because attiny13a does not have temperature sencer built in. Then, copied and pasted to replace the .c file in the folder with the source code. I have tried to compile the code with attiny13a did not have any problem at all.

I finally managed to communicate with the ATiny13A chip… was using FastTech programmer and eBay $12 clip… so frustrated tossed the clip away, took 6 single strand #26 wires and SOLDERED each to programmer AND ATiny13A… sure enough, it’s communicating now… yay…

However… now I have same issues as Sirius9… after I try to Build it in AVR Studio 4, I get following message:

Build started 20.8.2013 at 18:26:45
mmcu=attiny13a -Wall -gdwarf-2 -Os -std=gnu99 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT EGAIN.o -MF dep/EGAIN.o.d -c …/EGAIN.c
“C:/Program Files/WinAVR/utils/bin/sh.exe”: -Wall: command not found
make: [EGAIN.o] Error 127 (ignored)
mmcu=attiny13a -Wl,-Map=EGAIN.map EGAIN.o -o EGAIN.elf
“C:/Program Files/WinAVR/utils/bin/sh.exe”: -Wl,-Map=EGAIN.map: command not found
make: [EGAIN.elf] Error 127 (ignored)
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature EGAIN.elf EGAIN.hex
avr-objcopy: ‘EGAIN.elf’: No such file
make: * [EGAIN.hex] Error 1
Build failed with 1 errors and 0 warnings…

I used same picks for project as Microa in post 191… and it doesn’t work… :frowning:

I would really like to be able to setup 3 modes with no memory (4%/20%/100% or 100%/20%/4) or 4 modes with no memory (Firefly/7%/25%/100 or 100%/25%/7%/Firefly)…

But I definitely want to try this memory mode that DrJones implemented in his luxdrv driver…

I did a bit googling about this elf file that is missing and causes failure in building *.hex file…
Long story short: I installed newer version of AVR Studio 5.1.208 and that did the thing, now I can build hex files without problems :slight_smile:

I also noticed that I have to do erase procedure every time before uploading new firmware, if I don’t, avrdude would say that uploading went well but the driver would retain old firmware…

Well, considering that AVR Wiki called for AVR Studio 5, I downloaded it as well (5.0.1163) and tried to build again… and… of course… a NEW error… :slight_smile:

Error 1 undefined reference to `getmode’

sigh… it’s just too late here, my brain is half sleep… I guess I have to continue tomorrow… I hope someone might help me to figure out why “getmode” is not being recognized… :frowning:

Sirius9,

When you setup a new project, which options you pick at the start of wizard ? AVR GCC - C Executable Project or what?

you’ve probably just didn’t copy everything from luxdrv-030.c properly, or you accidentally changed something in code, added something or deleted, even one comma sign can cause syntax errors…

File -> New -> Project -> C/C -> AVRGCC C Executable Project -> Device Selection: ATtiny13A -> OK
then delete all that AVR studio automatically put in your new .c and paste all from luxdrv-030.c (use Ctrl+A to select everything).