Adventures in TinyAVR 1-Series

Interesting indeed. I’ve only used TCA and TCB myself, that might change now. Thanks for posting!

Agreed. I never saw the need for it before. But if you want high frequency and reduced consumption, it looks like a good option. I’m going to try and airwire a couple of my ’412 based drivers to get a real driver running with it.

I’ve never tried running the system on the ULP clock, it does look interesting for OTSM. Your test #1 and #13 suggest that I could use pretty low rated caps for OTSM, and with TCD I see no reason to use any other clock for the system. One of these days I have to test how much reliable off time I can get from a 10uF cap at both 3.33MHz and 32kHz ULP.

Well… it only took me a year to get the time to work on this. :person_facepalming: To my defense, I brought home my 5th child (yes, 5) just a couple weeks after getting the PCBs in the mail.

In the past few days, I have managed to (1) flash the dev board using Linux (previously I had only used Atmel Studio for these newer chips) and (2) completely ported over Anduril to run on the AVR 1-Series! I’ve got it running seemingly flawlessly on the dev board. Code can be found here. I’ve tested: ramping/stepped modes, batt check, temp check, flashy modes (candle, lightning, bike, etc), button aux LEDs, etc.

Next up: get this on a proper driver and in a flashlight. This will aid in verifying full thermal regulation, battery warnings, sleep mode current draw, etc.

: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.