Quantcast
Channel: attiny10 – Hackaday
Viewing all 16 articles
Browse latest View live

ATtiny Hacks: ATtiny10 game – doing more with less

$
0
0

ATtiny Hacks Theme Banner

Okay, you’ve got a six-pin microcontroller with 1k of program memory, 32 bytes of SRAM, and it can’t be programmed using an In-System-Programmer. Do you think you can use it to develop a game? [Wrtlprnft] managed to build a Simon Says game based on the diminutive device that has four buttons and four LEDs. Judging from the video after the break, we’d say he nailed it!

There are so many design challenges here. First off, with only six pins total getting eight devices connected and working means doubling up on each I/O pin and using the reset pin as a doubled-up I/O. We’ve seen momentary push buttons on the same pins as LEDs before, so that’s not too hard to get working.

But if you’re using the reset pin how do you flash the thing? It doesn’t use the same ISP programming protocol that it’s bigger cousins do, so [Wrtlprnft] used an ATmega1284P to program it, hooking up to the three I/O pins and using a transistor to push 12V on the reset pin. But there’s still the matter of writing the code. It has half of the 32 registers you’d expect to find. He ended up ditching C and went straight to writing Assembly because of the diminished instruction set. It’s the first thing he’s written in Assembly, and a great way to learn the ropes.

It may not be as polished, but we do like it just as much as the Karate Chop Simon Says game which has a lot of other bells and whistles.


Filed under: Microcontrollers

The many iterations of [Joe's] PCB business card

$
0
0

[Joe Colosimo] is putting on a show with his PCB business card project. The idea isn’t new, but his goal is to keep it simple and undercut the cost of all other PCB cards he’s seen. This is the third generation of the board design, and he’s just waiting on some solder mask solution before he tries running it through the reflow oven.

The first two prototypes used some through-hole parts. Notably, the battery was to be positioned in a circular cut-out and held in place by a metal strap and some bare wires. But he couldn’t quite get it to work right so this design will transition to a surface-mount strap for one side, and the large circular pad for the other. At each corner of the board there is a footprint for an LED. He tried milling holes in the board to edge-light the substrate. Now he just mounts the LED upside down to give the board a blue glow. The LEDs are driven by an ATtiny10 microcontroller which takes input from the touch sensor array at the bottom right.

He etched a QR code on the board which seems to work better than the milled QR experiments we saw back in April. The link at the top point’s to [Joe's] main page on the card. Don’t forget to follow the links at the bottom which cover each part of the development more in-depth.

[Thanks Skitchin]


Filed under: Microcontrollers

Programming the ATtiny10 with an Arduino

$
0
0

The ATtiny10 – along with its younger siblings that go by the names ATtiny 4, 5, and 9 – are the smallest microcontrollers Atmel makes. With only 32 bytes of RAM and 1 kB of Flash, there’s still whole lot you can do with this tiny six-pin chip. [feynman17] figured out a way to program this chip using an Arduino, allowing him to throw just about anything at this absurdly small microcontroller.

The ATtiny10 doesn’t use the familiar ISP programming header found on other Atmel-based boards. Instead, it uses the exceedingly odd Tiny Programming Interface to write bits to the Flash on the chip. [feynman17] realized he could use the Arduino SPI library to communicate with this chip and built a small programming shield with just a few resistors and a 8-pin DIP socket to mount an ATtiny10 breakout board.

After writing a sketch to upload a .hex file from the Arduino serial console, [feynman] had a programmed ATtiny10, ready to be dropped into whatever astonishingly small project he had in mind.

As for what you can do with this small microcontroller, chiptunes are always an option, as is making a very, very small Simon clone. It may not be a powerhouse, but there’s still a lot you can do with this very inexpensive microcontroller.


Filed under: ATtiny Hacks

Rickrolling remote control prank

$
0
0

This device is a prank or gag that [Eric Heisler] came up with. It will intercept IR remote control codes and play them back after a bit of a delay. The example he shows in the video (embedded after the break) catches the television power signal from a remote, then sends it again after about thirty seconds. This shuts off the TV and would be extremely annoying if you were unable to find the device. Fortunately (for the victim), [Eric] included a piezo buzzer that Rickrolls after sending each code. Just follow that tune to find the offending hardware.

He chose to use an ATtiny10 microcontroller. It looks like it’s realizing its full potential as the six-pin package use all available I/O to control the IR receiver module, an IR led, and the buzzer. It runs from a coin cell without regulation and the circuit was free-formed on a tiny surface mount breakout board which hosts the microprocessor.


Filed under: Microcontrollers

USB On The ATtiny10

$
0
0

tiny10

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.


Filed under: ATtiny Hacks, Microcontrollers

Breaking Out The ATtiny10

$
0
0

Atmel’s ATtiny10 is the one microcontroller in their portfolio that earns its name. It doesn’t have a lot of Flash – only 1 kilobyte. It doesn’t have a lot of RAM – only thirty two bytes. It is, however, very, very small. Atmel stuffed this tiny microcontroller into an SOT-23 package, more commonly used for surface mount transistors. It’s small, and unless your ideal application is losing this chip in your carpet, you’re going to need a breakout board. [Dan] has just the solution. He could have made this breakout board smaller, but OSHpark has a minimum size limit. Yes, this chip is very, very small.

Because this chip is so small, it doesn’t use the normal in-system programming port of its larger brethren. The ATtiny10 uses the Tiny Programming Interface, or TPI, which only requires power, ground, data, clock, and a reset pin. Connecting these pins to the proper programming header is easy enough, and with a careful layout, [Dan] fit everything into a breakout board that’s a hair smaller than a normal 8-pin DIP.

The board works perfectly, but simply soldering the ATtiny10 to a breakout board and using it as is probably isn’t the best idea. The reason you use such a small microcontroller is to put a microcontroller into something really, really small like ridiculous LED cufflinks. A breakout board is much too large for a project like this, but SOT23 test adapters exist, and they’re only $25 or so.

Either way, [Dan] now has a very, very small microcontroller board that can fit just about anywhere. There’s a lot you can do with one kilobyte of Flash, and with an easy way to program these chips, we can’t wait to see what [Dan] comes up with.


Filed under: Microcontrollers

Hackaday Prize Entry: A Minimal ATtiny Voltage And Frequency Counter

$
0
0

Sometimes when you build something it is because you have set out with a clear idea or specification in mind, but it’s not always that way. Take [kodera2t]’s project, he set out to master the ATtiny series of microcontrollers and started with simple LED flashers, but arrived eventually at something rather useful. An ATtiny10 DVM and DFM all-in-one with an i2c LCD display and a minimum of other components.

The DFM uses the ATtiny’s internal 16 bit timer, which has the convenient property of being able to be driven by an external clock. The frequency to be measured drives the timer, and the time it returns is compared to the system clock. It’s not the finest of frequency counters, depending as it does on the ATtiny’s clock rather than a calibrated crystal reference, but it does the job.

The results are shown in the video below, and all the code has been posted in his GitHub repository. We can see that there is the basis of a handy little instrument in this circuit, though with the price of cheap multimeters being so low even a circuit this minimal would struggle to compete on cost.

This isn’t the first home-made frequency counter we’ve featured. We’ve seen more than one Arduino-based counter, one based on 74 logic, and a PIC based counter with a serial output.

The HackadayPrize2016 is Sponsored by:

Filed under: Microcontrollers, The Hackaday Prize

New Part Day: ATtiny102 and 104

$
0
0

Atmel put out some new, small microcontroller chips early this year, and we’re just now starting to think about how we’d use them. The ATtiny102 and ATtiny104 (datasheet) sell for about a buck (US) and come in manageable SOIC packages with eight and fourteen pins respectively. It’s a strange chip though, with capabilities that fit somewhere between the grain-of-rice-sized ATtiny10 and the hacker-staple ATtiny25-45-85 series.

The ATtiny104 has a bunch of pins for not much money. It’s got a real hardware USART, which none of the other low-end AVRs do, and it’s capable of SPI in master mode. It has only one counter, but it’s a 16-bit counter, and it’s got the full AVR 10-bit ADC instead of the ATtiny10’s limited 8-bit ADC. The biggest limitation, that it shares with the ATtiny10, is that it has only 1 KB of program flash memory and 32 bytes (!) of RAM. You’re probably going to want to program this beast in assembler.

Read on for more reviews, and check out [kodera2t]’s video review at the end.

Reviews

attiny_comparisonThe first review comes courtesy of [Dan Watson] on his blog. He bought one of the Atmel Xplained 104 Nano evaluation boards back in March and put it through its paces. We don’t know how he got one for under $5 back then, but the kit seems available for under $10 from the usual suspects.

The Xplained kit is funny. It’s got a relatively powerful ATmega32u4 serving as an in-system programmer and USB-serial connector for the Tiny part. That’s funny because the programmer costs twice as much as the device under test.

[Dan] also presents a nice comparison chart of the small AVR parts. (Click to embiggen.)

[kodera2t] has been pushing the ATtiny series of chips to the max for a few months now, so we were stoked to see his review of the ATtiny102. Given the chip designation (T102-ES), he managed to get himself some engineering samples, which is extra cool-points, but shouldn’t discourage you because the parts are in stores now.

attiny102_104_pinoutsInstead of working with an evaluation board, [kodera2t] did everything from scratch. Maybe that’s why he emphasizes the new pinouts of the ATtiny102 parts. In particular, the GND pin is where the VCC pin is located on other ATtiny chips(!). It pays to read the datasheets. Although we’re grumpy and hate change, the new pinout is much more rational, with the VCC and GND pins together at the top of the chip, right where you want to add a decoupling capacitor anyway.

There’s one other minor gotcha if you’re used to working with the ATtiny parts. Because the ATtiny104 has fourteen pins, the GPIOs are split into two eight-bit banks: PORTA and PORTB. The ATtiny102 seems to be a chopped-down version of the 104, which means that even though it only has six GPIO pins, they’re still spread out across the two banks — three pins in each. If you’re accustomed to writing whole bytes at a time to GPIO output, this’ll force you to change your coding habits.

Uses

brief-review-of-attiny102-2j4y0pxxnq0mkv-shot0005_thumbnailWe find ourselves scratching our heads and asking what this chip is good for. The USART in a small and cheap package is a great feature. Something like the ATtiny14, with eleven or twelve free GPIO pins, fits a nice niche for very small projects. But we can’t quite get our heads around the 32 bytes of RAM. Whatever applications there are for the USART will have to reckon with a short receive buffer, for instance, and do its processing on the fly. C startup code alone costs a few hundred bytes, and with such limited RAM, we are guessing that coding assembler is the only reasonable option.

Of course, the hacker market was probably not even on Atmel’s radar when designing and marketing this chip. It must be good for some industrial use that we can’t quite figure out. What needs USART but doesn’t need much program or RAM? What uses can you think up for such a niche device?


Filed under: ATtiny Hacks, Hackaday Columns, Microcontrollers

7 LED’s, 2 Pins – beat that, Charlieplexing

$
0
0

[Tim]’s Dice10 is an exercise in minimalism. Building an electronic dice using an ATtiny10 with code that fits within 1kB is not too difficult. Charlieplexing the LED’s would have used three of the four available GPIO pins. [Tim] upped the game by using just two GPIO pins to drive the seven LED’s for the dice. A third GPIO is used as a touch button input. Besides the ATtiny and the LED’s, the only other component used is a capacitor across the supply inputs.

2 GPIO for 7 LED's
2 GPIO for 7 LED’s

The LED’s are grouped in three pairs of two LED’s and a single centre LED. Usually, Charlieplexed LED’s are connected across pairs of GPIO pins. But his scheme includes connections to the 5V and GND terminals, besides the two GPIO pins. Building a truth table makes it easy to figure out what’s going on.

STATE PB2 PB0 LED's
1     Z   Z   --
2     L   Z   LED 1/2
3     H   Z   LED 3/4
4     Z   L   LED 5/6
5     Z   H   --
6     H   L   LED9
7     L   H   --
8     H   H   --
9     L   L   --

Only the logic states used are listed in the table. It’s possible to add two more LED’s between PB0 and GND and one more anti-parallel with LED9, making a total of 10 LED’s driven by two pins. That’s quite a hack. The important thing here is to have two LED’s in series in the arms that connect to either 5V or GND.

[Tim] has posted  the code and hardware source files on his Github repo, and his blog post has some additional details on how he solved the problem.

If you’re looking for more inspirations on minimal dice designs, check this “PIC powered pair of electronic dice” which uses a PIC 12F629 with five outputs driving a pair of 7 pips to make a dual dice.

1kb-thumb

If you have a cool project in mind, there is still plenty of time to enter the 1 kB Challenge! Deadline is January 5, so check it out and fire up your assemblers!


Filed under: ATtiny Hacks, led hacks

USB Arduino into AVR TPI Programmer

$
0
0

Turning an Arduino of virtually any sort into a simple AVR 6-pin ISP programmer is old hat. But when Atmel came out with a series of really tiny AVR chips, the ATtiny10 and friends with only six pins total, they needed a new programming standard. Enter TPI (tiny programming interface), and exit all of your previously useful DIY AVR programmers.

[Kimio Kosaka] wrote a dual-purpose TPI and ISP firmware for the ATmegaxxUn chips that are used as a USB-serial bridge on the Unos, and constitute the only chip on board a Leonardo or Micro. The catch? You’re going to have to do a little bit of fine-pitch soldering. Specifically, [Kosaka-san] wants you to get access to an otherwise obscured signal by drilling out a via. We’d do it just for that alone.

The rest of the procedure is to flash a DFU USB bootloader into the Arduino, then load up the flash-programmer code. Your former Arduino is now capable of flashing both old-school ISP AVR chips, as well as the tiny little ones that require TPI.

If you’re having deja vu, yes we have covered a DIY TPI programmer before, but it required a bespoke uploader software on your host computer. [Kosaka]’s version appears to the host as an Atmel programmer, and you can use any of the standard tools. And you get to try your hand at some fun fine-pitch solder work. That’s win-win!


Filed under: ATtiny Hacks

Ben Heck Can Program The Smallest Microcontroller

$
0
0

Microcontrollers are small, no one is arguing that. On a silicon wafer the size of a grain of rice, you can connect a GPS tracker to the Internet. Put that in a package, and you can put the Internet of Things into something the size of a postage stamp. There’s one microcontroller that’s smaller than all the others. It’s the ATtiny10, and its brethren the ATtiny4, 5, and 9. It comes in an SOT-23-6 package, a size that’s more often seen in packages for single transistors. It’s not very capable, but it is very small. It’s also very weird, with a programming scheme that’s not found in other chips from the Atmel/Microchip motherbrain. Now, finally, we have a great tutorial on using the ATtiny10, and it comes from none other than [Ben Heck].

The key difference between the ATtiny10 and other AVRs is that the tiny10 doesn’t use the standard AVR ISP protocol for programming. Instead of six pins for power, ground, MISO, MOSI, SCK, and RST, this is a high-voltage programming scheme that needs 12 Volts. The normal AVR programmer can do it, but you need to build an adapter. That’s exactly what [Ben] did, using a single-sided perf board, a lot of solder, and some headers. It looks like a lot, but there’s really not much to this programmer board. There’s a transistor and an optocoupler. The only thing that could make this programmer better is an SOT-23 ZIF socket. This would allow bare tiny10s to be programmed without first soldering them to a breakout board, but ZIF sockets are expensive to begin with, and the prices on SOT-23 sockets are absurd.

Programming the device was a matter of loading Atmel Studio and going through the usual AVR rigamarole, but Ben was eventually able to connect a light sensor to the tiny10 and have it output a value over serial. This was all done on a device with only 32 Bytes of RAM. That’s impressive, and one of the cool things about the smallest microcontroller you can buy.

A Tiny IDE For Your ATtiny

$
0
0

When writing code for the ATtiny family of microcontrollers such as a the ATtiny85 or ATtiny10, people usually use one of two methods: they either add support for the chip in the Arduino IDE, or they crack open their text editor of choice and do everything manually. Plus of course there are the stragglers out there using Eclipse. But [Wayne Holder] thinks there’s a better way.

The project started out as a simple way for [Wayne] to program the ATtiny10 in C under Mac OS, but has since evolved into an open source, cross-platform integrated development environment (IDE) for programming a wide range of ATtiny chips in C, C++, or Assembly. Not only does it integrate the source code editor and programmer, but it even bundles in documentation for common variants of the chips including block diagrams and pinouts; making it a true one-stop-shop for ATtiny hacking.

His IDE runs under Java, including OpenJDK, and [Wayne] provides a stable pre-built executable for those who don’t want to clone the whole GitHub repository. He’s included the GNU/AVR toolchains, though notes that testing so far has been limited to Mac OS, and he’s interested in feedback from Windows and Linux users. Assembly is done either with GNU AVR-AS, or an assembler of his own design, though the latter is currently limited to the ATTiny10.

To actually get the code onto the chip, the IDE supports using the Arduino as a programmer as well as dedicated hardware like the BusPirate or the USBasp. If you go the Arduino route, [Wayne] has even come up with a little adapter board which he’s made available through OSH Park to help wrangle the diminutive chips.

The ATtiny10 might have something of a learning curve, but in exchange this family of tiny microcontrollers offers an incredible amount of capability. When you’re working with what’s essentially a programmable grain of rice, the only limit is your own creativity.

Jumbo LEDs Make for a Handy ATtiny Beacon

$
0
0

Inspiration can come from anywhere. Sometimes it’s just a matter of seeing an interesting part that you want to fiddle around with badly enough that you end up developing a whole idea, and potentially product, around it. That’s how [Bobricius] found himself creating this very slick little warning beacon, and looking at the end result, we think he made the right decision.

The Kingbright DLC-6SRD “jumbo” LED is actually six individual emitters built into a plastic diffuser. Interfacing with the device is simple enough; each LED has its normal anode and cathode leg, all you need to do is power them up. What [Bobricius] has created is a simple PCB design that the DLC-6SRD can plug right into, complete with a 2032 coin cell holder on the opposite side.

Of course, just lighting up all six elements at the same time wouldn’t be very interesting. [Bobricius] is controlling them individually right off of the digital pins of an ATtiny10 with the help of some Charlieplexing. This makes all kinds of interesting patterns possible, and as demonstrated in the video after the break, the current iteration of the project uses some very simple code to “rotate” the LED as if it was the flasher on an emergency vehicle.

The addition of a few blinking LEDs can make a world of difference in terms of nighttime visibility, so a cheap stick-on module that adds such a distinctive light pattern could be a very important safety device. It could also be useful for UAVs, following the FAA’s new rules which would mandate anti-collision lights for night flying.

HVTPI Primer And Toolkit Equips You For BOM Substitutions

$
0
0
A HVTPI adapter plugged into a USBASP, with a an IDC10 cable plugged into it in turn

Novel programming interfaces for MCUs might catch us by surprise, but then we inevitably get up to speed with the changes required. Today’s bastion is HVTPI – a “12V reset” addition to the TPI we’ve just started getting used to, and [Sam Ettinger] has shared a simple circuit to teach us all about it, along with PCB files and detailed explanations of how it all works.

HVTPI is an add-on on top of TPI, for which, as Sam explains, you need to hold RST at 12V when TPI would have it be low logic level, and leave it at Vtarget otherwise. For that, he has designed a variety of interposer boards of various complexity and requirements; explaining the choices behind each one and clearing up any misunderstandings that might occur on your way. All of the board files (and the TPI write-up copy) are caringly shared with us in a git repository, too! As a result, if you have an USB-ASP or an Arduino available, now you also have everything to do HVTPI, thanks to Sam’s work and explanations.

We’ve been covering Sam’s exploits before, and can’t help but be grateful for the stop-and-explain detour along the way. HVTPI being used on very small ATTiny parts, we wonder if something new in the vein of his recent FPC board able to fit and function entirely within a Type-C cable end!

With chip shortages, investigating programming interfaces for small and obscure yet in-stock microcontrollers has been, quite literally, paying off, and if you got some projects that need a MCU but won’t consume a whole lot of resources, it could be time to give an ATTiny10 a go. What’s the worst that can happen – you make the smallest chiptunes ever?

Hackaday Prize 2022: RunTinyRun is a Fully Solar-Powered, Portable Dinosaur Game

$
0
0
A small PCB with an OLED screen showing a Dinosaur Game

Fully solar-powered handheld gadgets have so far mostly been limited to ultra-low power devices like clocks, thermometers and calculators. Anything more complicated than that will generally have a battery and some means to charge it. An entirely solar-powered video game console is surely out of reach. Or is it? As [ridoluc] shows, such a device is actually possible: the RunTinyRun gets all its power directly from the Sun.

To be fair, it’s not really a full-fledged game console. In fact it doesn’t even come close to the original Game Boy. But RunTinyRun is a portable video game with an OLED display that’s completely powered by a solar panel strapped to its back. It will run indefinitely if you’re playing outside on a sunny day, and if not, letting it charge for a minute or two should enable thirty seconds of play time.

The game it runs is a clone of Google’s Dinosaur Game, where you time your button presses to make a T-Rex jump over cacti. As you might expect, the game runs on an extremely minimalist hardware platform: the main CPU is an ATtiny10 six-pin micro with just 1 kB of flash. The game is entirely written in hand-crafted assembly, and takes up a mere 780 bytes. A 0.1 farad supercap powers the whole system, and is charged by a 25 x 30 mm2 solar cell through a boost converter.

RunTinyRun is a beautiful example of systems design within strict constraints on power, code size and board area. If you’re looking for a more capable, though slightly less elegant portable gaming console, have a look at this solar-powered Game Boy.
A Dinosaur Game implementation running on a breadboard setup


2024 Tiny Games Contest: An Epic Minimalist Entertainment System, Indeed

$
0
0
An incredibly small gaming console with cartridges, each bearing an ATtiny10.

One way to keep things tiny is to make a system with cartridges where the brain lives on each cartridge instead of the platform itself. [Michael]’s Epic Minimalist Entertainment System (EMES) is one of those, and boy, is it tiny. EMES makes use of the ATtiny10, and they don’t get much AT-tinier than that.

A Plessey GPD340 display showing the word 'Hi'.This nearly microscopic console uses an equally Lilliputian display — a Plessey GPD340 vintage LED display, in fact. (Check out [Michael]’s reverse engineering project if you want to play around with these.) There are four ultra-small buttons for control and a buzzer for sound.

Now, the ATtiny10 is an 8Mhz microcontroller with 1KB of flash and 32 bytes of RAM. It has an 8-bit ADC and a somewhat surprisingly high four GPIO pins. But of course, that’s not enough. Not with the display, the four buttons, and the buzzer, so [Michael] had to come up with a way to multiplex everything to four GPIOs.

PB0 is shared between the buttons and the display’s serial data input. PB1 cleverly outputs the same PWM for both the brightness control and the buzzer. When the buzzer is needed, [Michael]’s code switches to a lower frequency and adjusts the duty cycle of the display to keep it readable. PB2 and 3 are serial clock inputs for the two display halves. Be sure to check it out the heated PONG action in the video after the break!

There’s still a little bit of time to enter the 2024 Tiny Games Contest! You have until Tuesday, September 10th, so head on over to Hackaday.IO and get started!

Viewing all 16 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>