USB On The ATtiny10

Atmel’s ATtiny10 is their smallest microcontroller in terms of physical size – it’s an SOT-23-6 package, or about the same size as surface mount transistors. The hardware inside this extremely bare-bones; three I/O lines, 1kB of Flash, 32 bytes of RAM, and a reduced AVR core with 16 registers instead of 32. With such a minimal feature set, you would think the only thing this micro would be good for is blinking a LED. You’d be right, but [cpldcpu] can blink a LED with the ‘tiny10 over USB.

The V-USB interface usually requires about 1.5kB of Flash in its most minimal implementation, and uses 50 bytes of RAM. This just wouldn’t do for the ‘tiny10, and although [cpldcpu] is working on a smaller, interrupt-free V-USB, there were still some hurdles to overcome.

The biggest issue with putting code on the ‘tiny10 is its reduced AVR core – on the ‘big’ 32-register core, direct memory access is two words. On the ’10, it’s only one word. AVR-GCC doesn’t know this, and no one at Atmel seems to care. [cpldcpu] worked around this problem using defines, and further reduced the code size by completely gutting V-USB and putting it in the main loop.

It’s not much, but now [cpldcpu] can blink an LED with a ‘tiny10 over USB. If you’re wondering, 96.4% of the Flash and 93.8% of the SRAM was used for this project.

The Two Component Random Number Generator

attiny10

[Karl] was in need of a hardware random number generator, but is needs had a few caveats: it needed to be cheap, and sufficiently random. Random number generation can get quite crazy with Geiger tubes, lava lamps, and radioactive decay, but a much smaller solution was found in an 8 pin AVR microcontroller.

The solution uses AVRentropy, a library that uses the watchdog timer’s jitter in AVR microcontrollers to provide cryptographically secure random numbers. Setting up the circuit was easy – an ATtiny45 microcontroller was connected to a cheap chinese USB to serial converter. Three wires, and the circuit is complete. The code was simple as well; it’s just a call to initialize the entropy and write the bits to the serial port.

There are a few drawbacks to this build. Because the entropy library must wait until enough entropy is gathered, it can only produce about two 32-bit numbers per second. That’s all [Karl] needed for his application, though, and with an enclosure made from a wine cork and marble, he has the prettiest and smallest random number generator around.

Low-Power SMD Fireflies

lowpowerledfireflies

[Tyson’s] family went with creating rather than buying Christmas presents last month, which gave him the opportunity to build some electronic fireflies for gifts. He drew inspiration from a similar firefly project we featured last year, but expanded on the original model by designing dedicated PCBs and housings for each of his firefly pieces.

Although he’d settled on using ATTiny85’s for this project, [Tyson] was fresh out of through-hole versions. He decided to skip the prototyping phase and go right for fabrication, cranking up the laser-jet printer for some toner-transfer, which successfully produced 4 functioning boards (and 3 failures). The fireflies were [Tyson’s] first attempt at SMD soldering, and we’d have to say it’s a job well done; he reflowed each board with a cheap-o heatgun from Harbor Freight.

After some hiccups with fuse programming, [Tyson] got the code uploaded and the fireflies illuminated.  Swing by his site for the nuts and bolts on construction, then snag the project files here. (Direct .zip download)

Shrinket, The Homebrew Trinket

shrink

We’ve seen a lot of Trinket builds over the past few months, but so far few people have capitalized on the Trinket’s minimalism. It’s a fairly simple circuit, as far as dev boards go, and with careful planning can be built entirely on perfboard. That’s what [villeki] did, with a project he calls Shrinket.

After looking at the schematic for the Trinket, [villeki] figured he could best the very small footprint of this ATtiny85 board. To do this, he mounted the uC on the bottom side of the board, bending the pins so they could be easily soldered to the pins. The only real challenge in building this tiny board was the USB connector. To fit this connector on board, the copper pads were carefully scraped off the protoboard and wires run to the zeniers.

The Shrinket is impressively small – only 0.6″x 0.9″ – and a very impressive example of soldering skills. If you’re looking for a project to hone your free-form soldering skills, this is a great way to spend an hour or two. Bonus, you probably already have the parts required (or a reasonable substitute) sitting around.

AVR Barn Door Tracker For Astrophotography

zzjBarnDoorTracker

[ZigZagJoe’s] first foray into astrophotography is this impressive AVR barn door tracker, which steps up his night sky photo game without emptying his bank account. If you’ve never heard of astrophotography, you should skim over its Wikipedia page and/or the subreddit. The idea is to capture images otherwise undetectable by the human eye through longer exposures. Unfortunately, the big ball of rock we all inhabit has a tendency to rotate, which means you need to move the camera to keep the night sky framed up.

Most trackers require precision parts and fabrication, which was out of [ZigZagJoe’s] grasp. Instead, he found a solution with the Cloudbait Observatory model, which as best as we can tell looks vaguely similar to the tracker we featured last year. Unlike last year’s build—which uses an ATmega32u4 breakout board— [ZigZagJoe’s] tracker uses an ATTiny85 for the brains, running a pre-configured table that determines step rate against time.

Continue reading “AVR Barn Door Tracker For Astrophotography”

Chachka: A Trinket Clone

Why would you clone something as cheap as the adafruit Trinket? Well, because you can, of course. And that’s exactly why [Ray] started to build a clone two days after his Trinket came in the mail. He encourages you to support adafruit by buying at least one Trinket before attempting a clone, and we agree. Besides, you’ll be able to use the support forum with a clear conscience.

[Ray]’s design uses an 1800Ω pull-up resistor rather than the 1500Ω in the Trinket. He made this change based on his experience with V-USB and the ATtiny85. He has a lot more information on his build on the Arduino forum. Check out a short video of Chachka responding to a Sony-esque remote control after the break.

Need an application for your Trinket clone? Check out this incredibly well-built USB volume knob.

Continue reading “Chachka: A Trinket Clone”

The Tiniest SD Card Locker

sdlocker-tiny

In case you weren’t aware, that little ‘write protect’ switch on your SD cards probably doesn’t do anything. It’s only a switch, really, and if an SD card reader doesn’t bother to send that signal to your computer, it’s completely ineffective. Then there’s the question of your OS actually doing something with that write protect signal.

The better way to go about write protecting an SD card is using the TMP_WRITE_PROTECT bit on the SD card’s controller. [Nephiel] came up with an amazingly small device to set that bit, with the entire circuit fitting inside an old Playstation memory card.

[Nephiel] based his project on [Karl Lunt]’s SD Card Locker we saw late last year. [Karl]’s SD Locker uses an ATMega328 microcontroller, a pair of AA batteries, and an SD card socket to perform the bit toggling. This is still a very small device that fits inside an Altoids tin, but [Nephiel] thought he could make it smaller.

The new and improved version uses an ATTiny85 for SPI access to the SD card. A single button and LED serves as the user interface: with the LED off, the SD card is writable. Press the button, the card is locked, and the LED lights up.