New to AVR/Atmel

So, I have a question: When I have the USB programmer connected to the MCU on an unpowered MCU via the SOIC8 clip, and, say, I run that avrdude command, and if I happen to have an emitter connected to the driver (which I do), the emitter lights up and while the command is running, the emitter flashes.

What is happening there that is causing the emitter to flash? When the avrdude command runs, does that actually cause the MCU to execute something and that just happens to cause the inputs to the 7135s to toggle?

I guess what I’m wondering is: When the programmer is connected to the MCU via the SOIC8 clip, does it power the MCU up and start the MCU running/executing the firmware?

It not the attiny that is flashing the led really, it’s the programmer. You’re using several pins to communicate, one of which happens to also be pwm.

Ahh. Ok. So the MCU is actually not executing instructions during this process, but the PWM pin just happens to be toggling, which is causing the emitter to flash since the 7135s’ Vdd pin is also connected to the MCU PWM pin?

Is that correct?

EDIT: So, I could use this to program an isolated (e.g., only clipped to the SOIC8 clip and not even soldered onto a PCB) MCU chip and then solder the chip onto a PCB afterwards, and that would work correctly?

Well, MCU is executing instructions but it’s been put into programing mode via it’s reset pin. The only thing it does is talk to the programmer. They talk back and forth, not just one way.

Yes, you can flash bare chips. The attiny is provided power from the programmer.

Btw, you don’t have a battery connected while programing, right? You shouldn’t.

No, luckily so far, I’ve just been working with the SOIC8 clip clipped on an MCU on a driver that is outside of a light, isolated. Thanks for that though, I was wondering about that.

I guess I qualify as “lazy”, but I was wondering if anyone knows if I take one of the .hex files from the .zip from this thread:

and just use avrdude and burn that to a NANJG, will that work? I’m thinking of the “Extended” .hex file.

Thanks,
Jim

EDIT: I was able to use avrdude to burn the BLF-VLD firmware. I think, but not sure if it’s working (the modes don’t seem right), but the burn worked ok.

However, I used the usbavar.bat from Warhawk’s dropbox and I did notice that there are some weird character’s in the .bat file. If you do “type usbavr.bat” you see them and you have to re-edit the file with Wordpad to get rid of them. After that the burn worked.

Does anyone know how many the modes are supposed to work with the “fixed” version of the BLF-VLD?

Thanks,
Jim

Yes, a hex file should work directly.

Did you flash the fuses recommended for the firmware? Not familiar with the fixed BLF-VLD.

You’ve seen Toykeeper’s firmware and her firmware repository, right? She has lots of different firmware and some hex files in there too.

Hi,

I didn’t see any recommended fuse settings for BLF-VLD.

Yes, I’ve been perusing TK’s repository. I just tried the nlite.hex from her repository, and it seems to work fine.

Jim

The BLF-VLD was recommended the low fuse : 0x79 and the high fuse : 0xFF.

Hi,

Thanks. The .bat I have (Warhawk’s) has the low as 0x75 and high as 0xff. I’ll try re-flashing BLF-VLD using 0x79 as you suggested.

Jim

Ohaya,

Got my clip and AVRusb in today… Some set up issues and the normal cable swap double checks…

I was following several of the threads for the how to flash stuff, and decided to put ToyKeepers s7.hex EDC firmware on my S2+ triple… Holy cow, it works… this is kind of fun, but there is a lot to learn before writing your own firmware. I read where you asked about just uploading .hex files already written… so I followed your lead.

I am proposing a T-shirt though…

Front:

I Flash my own Firmware

Back:

Budget Light Forum

Hat tip to ToyKeeper as well, good stuff you have out here and your repository has been a goldmine, Thanks!

Great! The more of us (and I can say “us” now?) the merrier :)!.

Actually, I think that I went kind of bonkers with the USB modules and clips. Besides the cheapo clip from Amazon, I just got one of the Pomona ones. Why? When I ordered the Pomona, I had read some post about it not fitting, so I got the one from Amazon, which looked smaller.

Then, also, I was looking for an enclosure for the USB module, and found that it was almost as cheap to buy a module in an enclosure, so I ended up with 4 now, 2 are on the way from China :(…

I just used clear 18650 heat shrink. It slides off if I ever need to change to voltage setting. Before shrinking I wrapped the circuit with card stock paper / index card to prevent it from shrinking down so much around the board that I would be unable to slide it off. Oh yea, and I bent the voltage jumper pins down 90° so the shrink could go over it.

~ edit ~


Shrunk tight enough that it doesn’t move when plugging or unpluging but still no problem to slide off to change the jumper.

This is straight out of ToyKeepers firmware repository… I only changed the PWM values for the levels, and added levels…

I am a zero acquaintance with code person, thus picking this to start with.

I have flashed several drivers with pre-compiled .HEX files ( TK’s S7.hex… nice) so I know that works… but now I want to experiment with levels in my FET driven S2+ triple and cannot even seem to compile the simplest code.

This is AVRstudio 5.1, I tried 6.2 as well, no dice…

Anyone here that can help? I was following comfychairs tutorial…

I don’t know why, but it looks like the compiler is not able to find the two .h files (the ones in the two “include”s) near the top (the util/delay.h and the avr/io.h).

Yeah, thats the way I read it too… but where do you get those files….? In comfychairs tutorial, he says if it compiled without errors, go get the hex file… Not for me obviously. .

Ok, I think I got it…

You have to go to C/C NOT Assembler

Then AVRGCC C Executable project (highlighted in gray above)

Then Pull down tinyAVR, 8-BIT and select ATtiny13A

Erase this stuff and Paste in the *.C file from TK’s Firmware Repository (or wherever)

Then Build pull down and click Build on your project name (fourth down)

After build is successful, then to back to the Build pull down and select Compile.

The .Hex file will be in the debugging folder in the project you named your driver… Easy Peasy… NOT without code experience… I have now spoken martian, but do not know what I have said…

I don’t compile or go hunting in folders. After you build it, your hex file will be on the right side of the window under “output… Something”. Then i just “save as” from there to whatever folder I flash from.

There are quite a few of us that have no prior coding experience, I just learn what need to now as I go.

Oops! Sorry, I forgot about having done that and should’ve remembered. Glad you got it working though :)!

Which other lights have people found that also use the Atmel Attiny13A or other MCU that we COULD write software/firmware for, other than then ones with NANJG 7135 drivers?

I guess the new BLF-A6 is one other one, with TK’s firmware, right?

Are there any others, like some production ones that we could mod with just a firmware change?

Also, similar question: Which firmware works with the so-called “NANJG-92”, i.e, a NANJG 7135 driver that has had the 7135s replaced with a FET like in:

Thanks,
Jim