TinyDriver – ATtiny84 Platform Without Arduino

You don’t need an Arduino for everything! Or do you? This is an argument that plays out here quite often. Whatever the outcome, most folks agree that once you’ve dipped your feet in the shallow end of the pool, the real fun is when you dive into the deep end.

[Mahesh Venkitachalam] designed tinyDriver, an experimental Open Source breakout board for the Atmel ATtiny84 chip. His idea was to create a convenient platform which can be used to understand microcontrollers in-depth, by letting users dive under the hood and make use of the various features of the chip such as timers, PWM, interrupts, ADC, and digital I/O. The ATtiny84 is cheap and simple enough for starters. Add a low-cost AVR programmer, install the free and cross-platform avr-gcc and avrdude tool chain, read up the data sheet, learn some C programming and start experimenting. Rinse and repeat and you’ll be a pro at it soon. He’s got a few starter projects documented on his website to get you going.

The hardware is open source, and the Git repository contains the hardware source and example code. If you’re a hardware noob, he’s thoughtfully added a PTC resettable fuse and reverse polarity protection on the board to make sure you don’t release the magic blue smoke prematurely. All of the I/O’s are broken out on a header, and the motor driver and RGB LED can be disabled when not needed. The board isn’t hand-assembly friendly, but he plans to crowd fund it shortly. If you want to move beyond the Arduino platform, projects like the tinyDriver are the way to go.

The HackadayPrize2016 is Sponsored by:

28 thoughts on “TinyDriver – ATtiny84 Platform Without Arduino

        1. Learning can be good, depends on intent and appreciation of efficiency ie Time is all we have (left), so “Why re-invent the wheel when we can now choose lots of different tyres to support the vehicle we want drive ?”
          ;-)

    1. It’s one of the lowest threshold workflows for using an mcu. All you need to do is follow a quick instructable to get started. The Arduino way of a schematic makes it accessible for people with the most basic electronics skills who can’t read a normal diagram but are fascinated by the huge range of options and possibilities using shields, libraries and easy to follow tutorials.
      When I started out with the pic16f84 around 2002 all I had available was Elektor, some archaic homebrew programmer software working only in Windows 98 and an unreliable serial port programmer, which was limited to a couple of devices. It took me days to get it all sort of working.
      If Arduino was available back then I would’ve used that, so much easier to get started.

      Ofcourse if you want more control you can start using the mcu peripherals directly, avoid the slow arduino pin writes etc. But you’ve got a solid working programmer and sofware working on all current platforms.

      1. “The Arduino way of a schematic makes it accessible for people with the most basic electronics skills who can’t read a normal diagram but are fascinated by the huge range of options and possibilities using shields, libraries and easy to follow tutorials.” — That’s exactly how I’ve been learning. I started learning electronics just a few months back from basically zero knowledge before-hand and I’ve been tinkering and toying with the ESP8266 and STM32F1 using Arduino – libraries, and it has helped me tremendously. Arduino provides a really great platform for novices like me to get going, and I can always leave the Arduino – libraries and – environment behind if I outgrow it — there’s nothing tying me to it permanently.

    2. Because I can program an entire project in less than the time it takes for you to get your first 400 lines of assembler written to talk to any of the hardware.

      Arduino is not perfect, but it’s the fastest platform for prototype development out there. Plus teaching someone you will get them interested by using arduino. you will get them to hate it if you try and teach them “the proper way”

      “This is the stack, we push things on the stack, also you have to completely think in binary, and no you cant do most kinds of math easily…. hey where are you going? in about 40 more hours if instruction we can make an LED blink!”

      1. Well you either find things like binary math and stack manipulation interesting or you don’t. If you do, you won’t be scared away by the 20 or so lines of assembler it takes to visibly blink an LED. If you don’t, you will always be reliant on crutches like the Arduino which you don’t understand and which will periodically fail you because you don’t understand their underpinnings.

        1. I find binary math and stack manipulation interesting, but I don’t see why that would rule out having fun with an Arduino. Nothing stops you from using Assembler instead of the C subset, but I like using am-forth myself. If you were to share what you like to use instead, I might check it out.

          1. I’m very partial to the Parallax Propeller and have done a lot of work in Chip Gracey’s Spin language, which is very elegant. But Parallax has been consumed by the “we have to do C” bug and now a lot of the Propeller people are working in C, which is actually not a very good language for that CPU. But more people know it.

            I have also been using Lua via NodeMCU to program the ESP8266, which is almost Arduino-like but with different cruft under the hood.

            I have always loved the idea of Forth but never found an opportunity to do real work in it because there was always some better established path. I’ve even coded four or five Forth inner interpreters, and there are at least three Forths available for the Propeller. Just never found the right opportunity to dive in though.

  1. The mass market created a demand for cheaper clones.
    With this came small ready to use boards with any suitable controller for the small wallet :)
    Before Arduino it was harder to get something small running. Today I just grab in a box full of suitable boards and just pick one! Thanks Arduino for opening Mikrocontrollers to the broader public!!!!! REALLY!
    Imagine all the sensors you get today, in the BA (Before Arduino) stuff was rare and expensive. AA (After Arduino) the market is full of hobbyists demanding for fun stuff!

    1. Absolutely! I leanred microcontroller programming long before there was an Arduino, don’t use it, and don’t have any strong feelings pro or con.

      But the awesomest thing is that the Arduino “revoloution” has made soooo much good hardware mass-produceable and thus dirt cheap. I buy Arduino Pro Mini boards and then re-flash them with my own code straight away because I can’t buy chips and pin headers as cheaply as pre-built modules. How awesome is that?

      Don’t even get me started on the peripherals / sensors / other modules. Even for a person who never Arduinoes, I have to say thanks — and moreover thanks to y’all (the community) for getting interested in what used to be a wacky niche hobby. We live in good times.

      1. Same here, I only got an arduino for the prusa i3 3D printer and experimented with a 3D scanner based on arduino, webcam and lasers. Many more open source hardware projects are available to jumpstart experimention and build on work done by others and sharing the results. You can quickly throw something together and see if you want to expand on the subject before investing the hours to even get to the point of experimentation.

      2. I don’t use Arduino code either. I make everything out of 555’s and cats whisker diodes.

        But seriously, I often use the Arduino IDE and a Arduino board like the mini-pro or mega to work out protocols with chips or other devices that I haven’t worked with before. Especially if the next step is VHDL (Verilog for non-mericans).

        It’s fast to prototype and move on! I’m not at all embarrassed about that and I often bare metal code. The Arduino platform can be leveraged so that is a time saving quick step along the way.

        1. Arduino is great for trying out an idea fast or one off items. If I was going into production I don’t think I would use arduino. That being said I think Arduino is great at getting people interested in electronics fast.

          1. That’s the thing. I’ve been heavily interested in electronics since the 1980’s but always on the sidelines. The Arduino platform makes it possible for a complete noob like me to do fun stuff without (a) breaking the bank and (b) years of study.

    2. PIC’s from microchip for example. the chips were expensive, the legal IDE and compiler was expensive as hell and the legitimate programmers were also expensive. Many of us pirated it and faked the programmer with the parallel port of a PC. Microchip was completely stupid for not having the IDE and compile environment 100% free.

      It took nearly a decade for someone to hit these companies with a clue-by-four. Sadly TI is still stupid aand makes you buy an overpriced compiler for their MSP platform, or you have a complex linux setup with GCC. it makes that whole platform a very distant 4th place that is rarely used.

  2. I like this.

    It reminds me of my s/w career. to me using an Arduino is analogous to learning HTML 20 years ago. With a little knowledge it works, its magic, its forgiving – and its a hook, a first rung on a ladder, you can fall of or keep climbing.

    From where I sit this idea sounds brilliant, a missing rung, maybe a bit like learning scripting after HTML. I’d buy this, or at least try to build it.

  3. If this is a “beginners’ board”, it should have a socketed DIP `84 for that inevitable time when you let the magic smoke out. The new crop of arduinos/motor drivers and the like are all nearly irreparable unless you want to join the SMD cognoscenti, and everyone cooks a few chips along the way. I realize that clones are cheaper than the parts sometimes, but there’s still value in figuring out which part of your H-bridge went south and what to do about it.

  4. You can delete bootloader from Arduino and use it via ICSP programmer, you can also ditch IDE and use avr-gcc. So I really don’t think that world needs another AVR microcontroller devboard. What world needs (IMHO) are better tutorials, for example DHT22 tutorial that doesn’t start with “download Adafruit lib and install it” but “download DHT22 datasheet, and let’s see how to talk with that chip without using DigitalWrite”. That way people will learn much more about electronics, how it works, how to find and solve problems, etc.
    This is an example of well-made Arduino tutorial : https://www.youtube.com/watch?v=VAa4duqMrgs , it involves datasheet reading and writing code for running ws2812 LEDs without using any library. And when you watch it and understand it then it’s irrelevant if you’re using AVR or PIC, you will be able to drive that LEDs on any microcontroller.

    1. Bang on; I think those who want to move beyond arduino would go for meatier controller instead of go down tiny path. Just another dev board would not cut it. Plus from cost perspective too, there could be better ways to achieve the objective.

      For the board in image, design doesn’t seem to be thoughtful. Some components are too small 0402 and some are unnecessarily big like regulator, switch and led. Seems more like ‘look what I made’ project without clear user base.

  5. If you already have one, the Arduino can also function as an ISP for AVR processors. If you don’t already have a programmer, I suggest buying an Arduino (the Teensy 2 would be my choice) to do the job. Then you end up with both Arduino and bare metal available.

    When PCs still had parallel ports, it was easy to build an ISP which used that. But those days are gone.

  6. I enjoy playing with ATtiny micros. They are cheap enough that you can buy a dozen of them for the price of an Arduino Uno and leave them in projects and you can slap a DIP package on a breadboard and use it without any external components. Having a breakout board with an ISP socket is really handy as wiring up a squid cable gets old after a while. Arduino is a great place to start, but using an 8 bit microcontroller with an ISP programmer is good next step. I found it’s well worth migrating from Arduino IDE to Atmel Studio. Atmel Studio can import Arduino sketches – so you bootstrap with Arduino libraries using the ATtiny Arduino core. Being able to debug in the simulator or on chip and having a powerful editor without Arduino’s idiosyncrasies is well worth it. And once you take the time to read the datasheet you realize how constraining the Arduino environment can be.

  7. My experience was quite different. When I first felt the need to use a microcontroller I only looked briefly at the Arduino platform. It was confusing, with all the different board models, special IDE and libraries, programmers, all those hip terms and fancy names. Confusing as hell, i couldn’t even start to decide what I would need to buy. And it seemed very expensive, too (when looking at the “original” Arduino boards, at least). It just smelled like specialisation and vendor-lock-in. Maybe I’m just someone who is suspicious of hype, but i instantly felt that there must be an easier way to get things going.

    Then I found an old, old little webpage describing a parallel port programmer and how to hook up an atmega to it and program that using avr-gcc and avrdude, and it was all so much simpler. Took me an hour to build the “programmer” (just some parport lines with an integrated bus driver), a few minutes to set up the atmel on a breadboard, write a blinking led good old c-program and getting the avr-gcc toolchain up on linux, and voila, the led was blinking and I could go from there. It even felt like cheating using c instead of assembler. Note that though I’m comfortable with c and linux/gcc, I was a total electronics noob at the time.

    Now if I look at arduino it all smells like making something “easy” by first pretending that it’s hard to do it yourself while creating lots of hype around it. It’s just some breakout boards after all, but with loads of decisions already made for me in a way that is often not acceptable for the task at hand.

    I mean, come on, is it really that hard to get an atmel going on a breadboard? An ISP header, a crystal and two caps, and there you go. Straight from the datasheet.

    I admit that it’s probably a tiny bit easier to just use an arduino board, but the difference is really marginal in my opinion. Even for a complete noob.

  8. I think the arduinos have improved a great deal over the years. Some cheap chinese makes have boards without bootloaders or a fake ftdi chip but if a beginner sticks with a genuine arduino it’s pretty much plug and play, install the ide, load a tutorial project and hit upload.

    You’re not locked in at all. You always have a choice if you want to switch to a cheap chinese board, or a different kind of board, or even chip brand.

    It would be hard to beat doing it on a breadboard, as a beginner with knowledge just enough to wire a light and a switch. It takes hours to sift through the huge datasheets to find and understand the few relevant bits and more to find the schematic to wire the chip on a breadboard, if the user can make any sense at all of it. Not to mention learning to write c code, the particular flavor for avr prgramming with macros and functions, finding the proper fuses and setup code and registers to disable or enable peripherals etc. It’s a lot to take in.

    It’s much easier to build on something that just works. And more fun, you’ll dive into the deep soon enough once you hit some limitations, though many users would be hard pressed to find them, considering an arduino is capable of running a 3D printer, if you just take a look at the marlin or repetier code, you’d be amazed what they manage to squeeze in.

    Once the beginner has outgrown the arduino platform(or not), no one stops him/her to try something else, but it would be much easier now that the user has some expetience undet the belt.

    Sure, with the knowlegde you and I have now it’s a piece of cake but you didn’t consider all levels that beginners start at.

    Ymmv :)

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.