Minimal TinyAVR 0 Programming

When [Alain] wanted to use some of the new TinyAVR 0 chips — specifically, the Attiny406 — it seemed overkill to use the Windows IDE. There are plenty of sources of information on programming other AVR chips using simple command line tools, but not for these newer 0-series parts which use a new programming protocol known as UPDI. That led to a deep diving into how to program a TinyAVR 0 with a text editor, makefile, and USB-to-serial cable.

The Attiny406 has 4K of flash, 256 bytes of RAM and can run at 20 MHz with no external clock. You might think programming would be similar to a regular AVR part, but these tiny devices use UPDI (Unified Programming and Debug Interface) which uses 3 pins for programming. Older devices used different protocols.

It is very easy to create a UPDI programmer. A USB to logic-level serial cable and a 4.7K resistor is all it takes. There’s Python code that knows how to drive the protocol, too. You can also use the logic-level serial port on the Raspberry Pi with some device tree modifications explained in the code’s documentation.

[Alain] made a nice breakout board for the device. It fits a breadboard, allows for 5V or 3.3V operation, and has an LED and switch. Nothing fancy, but handy. Once you know how to ship a hex file to the chip, the rest is pretty standard. While the AVR version of gcc doesn’t cross-compile for the ATTiny out of the box, there is a device pack from Microchip that enables that feature.

The trend is to go to bigger processors, not smaller, but when you need to cram something in a small space, save a few pennies per unit, or draw very little power, these tiny processors can be just the ticket. The processors may be small, but if you work you can do some pretty big things with them.

Rapid Charging Supercapacitors

Battery technology is the talk of the town right now, as it’s the main bottleneck holding up progress on many facets of renewable energy. There are other technologies available for energy storage, though, and while they might seem like drop-in replacements for batteries they can have some peculiar behaviors. Supercapacitors, for example, have a completely different set of requirements for charging compared to batteries, and behave in peculiar ways compared to batteries.

This project from [sciencedude1990] shows off some of the quirks of supercapacitors by showing one method of rapidly charging one. One of the most critical differences between batteries and supercapacitors is that supercapacitors’ charge state can be easily related to voltage, and they will discharge effectively all the way to zero volts without damage. This behavior has to be accounted for in the charging circuit. The charging circuit here uses an ATtiny13A and a MP18021 half-bridge gate driver to charge the capacitor, and also is programmed in a way that allows for three steps for charging the capacitor. This helps mitigate the its peculiar behavior compared to a battery, and also allows the 450 farad capacitor to charge from 0.7V to 2.8V in about three minutes.

If you haven’t used a supercapacitor like this in place of a lithium battery, it’s definitely worth trying out in some situations. Capacitors tolerate temperature extremes better than batteries, and provided you have good DC regulation can often provide power more reliably than batteries in some situations. You can also combine supercapacitors with batteries to get the benefits of both types of energy storage devices.

Putting The Firmware In Your Firmware

Performing over-the-air updates of devices in the field can be a tricky business. Reliability and recovery is of course key, but even getting the right bits to the right storage sectors can be a challenge. Recently I’ve been working on a project which called for the design of a new pathway to update some small microcontrollers which were decidedly inconvenient.

There are many pieces to a project like this; a bootloader to perform the actual updating, a robust communication protocol, recovery pathways, a file transfer mechanism, and more. What made these micros particularly inconvenient was that they weren’t network-connected themselves, but required a hop through another intermediate controller, which itself was also not connected to the network. Predictably, the otherwise simple “file transfer” step quickly ballooned out into a complex onion of tasks to complete before the rest of the project could continue. As they say, it’s micros all the way down.

The system de jour

Continue reading “Putting The Firmware In Your Firmware”

Solar Satellite Glows At Night

They say that imitation is the sincerest form of flattery. If we were going to imitate one of master circuit sculptor Mohite Bhoite’s creations, we’d probably pick the little blinky solar satellite as a jumping off point just like [richardsappia] did. It’s cute, it’s functional, and it involves solar power and supercapacitors. What more could you want?

SATtiny is a pummer, which is BEAM robotics speak for a bot that soaks up the sun all day and blinks (or ‘pumms’, we suppose) for as long as it can throughout the night on the juice it collected. This one uses four mini solar panels to charge up a 4 F supercapacitor.

At the controls is an ATtiny25V, which checks every eight seconds to see if the supercapacitor is charging or not as long as there is enough light. Once night has fallen, the two red LEDs will pumm like a pair of chums until the power runs out. Check out the brief demo after the break.

Would you rather have something more nightstand-friendly? Here’s a mini night light sculpture with a friendly glow. If you haven’t started your entry into our Circuit Sculpture Challenge, there’s still plenty of time — the contest runs until November 10th.

Continue reading “Solar Satellite Glows At Night”

AVR Multi-Tool Learns The Latest Tricks

Like many of us who fiddle with microcontrollers, [Mike] and [Brian] often found themselves using an ISP programmer and a USB-to-serial adapter. But when they started working on the latest generation of ATtiny chips, they found themselves in need of a Unified Program, and Debug Interface (UPDI) programmer as well. So they decided to wrap all three functions into one handy open hardware gadget.

They call their creation the AVR General Purpose Programmer, or AVRgpp for short. It runs on an ATmega328P with a Pro Mini bootloader, which means that the programmer itself is fully compatible with the Arduino IDE. USB-to-serial capability is provided by a CH330N, and a MC14053 digital switch IC is used to select between talking to the AVRgpp’s onboard MCU or the target device.

A 128 x 32 I2C OLED and two push buttons are used to select the device’s current mode, and there’s a physical switch to select between 5 V or 3.3 V power for the target. There’s also a ST662 12 V regulator, as UPDI targets occasionally need a high voltage pulse to switch into programming mode. Everything is packaged up in a pocket-sized laser cut enclosure that you can easily toss in your bag.

[Mike] and [Brian] say they are considering putting the AVRgpp into small scale production if there’s enough interest, so let them know if you’d like to get one without having to build it yourself.

Flexible PCB Earrings Put The Art In Art Deco

Earrings have been a hackers’ target for electronic attachment for quite a while, but combining the needed components into a package small enough to wear in that finicky location is quite a challenge. If [Sawaiz Syed]’s Art Deco Earrings are anything to go by, ear computers have a bright future ahead of them!

This is a project unusually well described by its name. It is in fact an earring, with art deco styling. But that sells it way too short. This sliver of a flex circuit board is double sided to host an ATtiny, accelerometer, LDO, and eight 2020 formfactor controller-integrated LEDs. Of course it’s motion sensitive, reacting to the wearer’s movement via LED pattern. [Sawaiz] makes reference to wearing it while dancing, and we can’t help but imagine an entire ballroom all aglow with tiny points of LED light.

The Art Deco Earrings are also set apart by the thoroughness of their documentation (have we mentioned how much we love detailed documentation?). [Sawaiz] not only drops the source in your lap, but the README in the Github repo linked at the top walks the reader through each component of the design in detail. Plus the PCBA render is so complete it includes a model of the wire loop to fit through the wearer’s ear; how cool is that? The single piece that’s still in progress is the battery. The earring itself hosts an LDO, so all that is required is stashing a battery somewhere discrete, perhaps in the user’s hair? We’re looking forward to seeing what [Sawaiz] works out.

For the full effect, check out the gif of an assembled unit in action after the break.

Continue reading “Flexible PCB Earrings Put The Art In Art Deco”

The ATtiny Series Is A Great Companion In Isolation

As a consequence of the social distancing and self isolation, many a maker has been searching for ways to cure boredom. So what happens when you put a maker in a closed space with electronics parts. The answer is a bunch of random microcontroller projects that help beat boredom. [Danac1886] posts a video with a bunch of experiments with the ATtiny series of microcontrollers which can be a source of time-killing inspiration for these tough days of solitude.

The video is based upon a variety of controllers ranging from the ATtiny85 to the ATtiny84 and even includes the ATtiny2313. There is also a project with the ATtiny10, an SMD SOT23-6 package that is quite amazing to behold. All the devices can be programmed using the Ardino as an ISP so all you need is another Arduino lying around in case you do not have an AVR ICSP.

As for the projects themselves, there is an assortment of things that start with the basic blinking LED, adding an I2C LCD and then moving on to a 7 segment display counting up with variable speed controlled with a pot. We really loved how much these tiny projects inspire and can help someone get started with basic electronics and programming.

If you are looking to get started, have a look at the Jumbo LED with the Attiny10 and we assure you, it will brighten your day.

Continue reading “The ATtiny Series Is A Great Companion In Isolation”