Adventures in TinyAVR 1-Series

:partying_face: Thank you gchart! It’s a really important step for our drivers!

This is great news! Nice Job!!

[quote=gchart]

Congratulations mate. My wife would be totally envious. :beer:

Thanks, Moose! He appears to be a ReyLight fan, so I think I did ok :wink:

Your going tyo have to teach him not to look at the light when he turns the torch on. :slight_smile:
Have you planned any more? My oldest turns 27 today.

My youngest is 30, so the pic is more like a grand kid to me (got 2), which is all good

This is great news. I immediately thought of your pic12 adapter board but am not sure how easy it would be to replace a pic with an 816. Programming the 816 shouldn’t be too bad, either using an explained board or maybe an arduino. Probably switch out the battery voltage divider resistors to match anduril and remove the ntc if the light has one for temperature sensing.

Is moving the switch input and the outputs around on the 816 fairly straight forward?

For programming adapters, I just used the AVR JTAG ICE for the first time. It’s similar in appearance and price to a AVRISP. It worked well.

In Anduril, it’s incredibly easy to switch pins thanks to the “hwdef” (hardware definition) files that contain pinout info for a specific driver.

Now that Anduril is working, I plan on trying one of those PIC adapter boards soon. SC31B? FC11? TS70? Not sure which should be my first candidate. Hmm… After finally getting it ported over, my modding interested has finally piqued again.

Those JTAG ICE programmers are pretty expensive. There is a little five dollar clone on aliexpress that seems ok but shipping to Canada is pretty horrible right now.

Where you able to use the hwdef files without modification? That would make things easier for someone with programming skills as bad as mine. Solving invisible problems gets frustrating and I usually end up with the same two questions. Why can’t they do anything normal and how can I make a four pound hammer a solution to the problem.

PIC hunting seems fun though. Can’t wait to replace high, low, flashy with anduril.

Yeah, sorry… I was referring to the ~$5 clones, like what is referred to in this guide

But if you’re going to use Atmel Studio (or compile avrdude on your own), then an Atmel dev board like the ~$8 416 Xnano is perfect.

Hwdef files do need modification, but that should be expected. It’s a different MCU, so a different layout.

Part of what I’m curious about /hopeful for… These 1 Series chips come with up to 32KB of memory. If TK can fit Anduril in 8KB, what can she do with 4x as much space? :smiley:

Hey…nice find with that jtag ice :slight_smile:
The best combination of simple and cheap that I’ve seen so far. :slight_smile:
Does it allow debugging 1 series chips or programming only?

Not that I’m aware of, though I haven’t researched that.

I have used the 416 Xnano to debug in Atmel Studio. That worked very nicely! You just disconnect the onboard MCU and then you can use it as a programmer/debugger for any of the newer chips (using the onboard mEDBG).

1+ for the 416-Xnano. Pros are that you can power the target with 5V from the Vref pin on the programmer side, has a CDC TX so you can talk with a terminal, user button and led, plus all the pins are labeled on the device side silkscreen, very nice and easy way to get going.

I also have the 817 Xmini, which is very nice but overkill if all you want is a programmer / debugger. Real nice dev board though. And still inexpensive.

Same here, if one is into it, not much trouble to get an Multifunctional Expansion Board Shield kit for the UNO to sit on top of that 817-Xmini.

It doesn’t sound like moving I/O between port a and port b is very hard so that’s good.

I once asked TK if she’d prefer to abandon the 85 altogether and just use a new one series with an adapter board but she prefers to keep the 85 for backwards compatibility. The amount of work she does to squeeze everything onto the 85 seems like a lot, especially for a volunteer. I’d like to she what she could come up with if she had IOT connectivity to work with.

How do you debug flashlight firmware in a board that does not resemble a flashlight driver at all?

You don’t need the LED driver circuit to develop the firmware. For most parts of the development an oscilloscope or logic analyzer is enough. Or hook up a small LED with a current limiting resistor to a free pin.

For initial firmware development and debugging, SammysHP hit it on the head. But also…

These Xnano and Xmini dev boards give you the ability to disconnect their onboard MCU. You can then wire the programming/debugging chip on the Xnano/Xmini to any of the 0-Series or 1-Series chips thru the 1 wire (plus power and ground) UPDI (unified program and debug interface). So you can actually debug code running on an actual flashlight driver.

Boy, I'd love to get into this development setup, if only I had the time. 32 KB is a whole lot, and would really like to see what can be done with 2 switches and multi-channel, multi-LED. If only I had more time.

I got in a Amutorch E3 - 21700 triple LED, standard MCPCB, std triple optics. It's light weight and compact, but they made the cavity above the driver extremely small - 2.4 mm clearance over the driver, so I can't piggyback a small board in. Only option is driver replacement and it's got 2 screw holes for mounting - great idea really but no std OSHPark driver will fit, plus with a board mounted switch. Love to build up a OSHPark board for the E3 with this MCU.