Very first steps with AVR

More and more new hobbyists start with Arduino when learning microcontrollers. But the problem is that most important things are hidden inside processes, libraries. All you get is writing some prepared code and clicking the program button to get on the microcontroller. If you start your journey to microcontrollers, you should learn how those things work and how to program “barebone.” Like all new things, you probably should start blinking LEDs with AVR using tools like AVRStudio with GCC compiler, programmer adapter, and breadboard. Cl97 wrote a very simple guide on how to get it done. If you are an Arduino fan, do the same with the Arduino digitalwrite() function and then compare binary size and blinking speed. Continue reading

Tiny microcontrollers can drive even more LEDs

Sometimes for simple applications you need to drive several LEDs. You would love to stick with tiny microcontroller that actually has few I/Os available. One solution could be using port expander that adds some complexity to overall project. Better solution is to use charlieplexing, when using special technique out can drive more LEDs than there are I/Os available. Charlieplexing method allows driving N*(N-1) LEDs with N pins, so with 5 I/O pins of tiny microcontroller it is possible to control 20 LEDs. And you even need as many current limiting resistors as there are pins used. If you drive 20 LEDs with 5 pins then you need 5 resistors instead 20 when driving them directly. Probably main disadvantage of this method is a bit more complex program as it requires some encoding. So next time you need more LEDs in your project simply avoid grabbing bigger MCU and use this compromise. Continue reading