Arduino – blinky with Timer1 COMPA

Next Arduino blinky project. This version of “blinky” example is using Timer1 Compare Match A interrupt to make an onboard LED blink for roughly one second. The code is on Github, click here. Parts Required arduino board (i.e. Arduino/Genuino UNO) basic LED (on-board LED) Software This code is written in C++ and can be compiled using an Arduino IDE. All … Read more

Arduino – blinky with Timer1 OVF

Yet another Arduino blinky project. This version of “blinky” example is using Timer1 Overflow interrupt to make an onboard LED blink for roughly one second. The code is on Github, click here. Parts Required Arduino board (i.e. Arduino/Genuino UNO) Software This code is written in C++ and can be compiled using an Arduino IDE. All information about how to compile this project is here. /** … Read more

ATtiny13 – hardware PWM

This article shows how to make an ATtiny13 to generate hardware PWM (Pulse Width Modulation) signal. The example code uses timer in Fast PWM mode (WGM02:0 = 3, see manual section 11.7.3). In this mode, by setting the COM0A1:0 bits to one, the compare unit allows generation of PWM waveforms on the AC0A pin (PB0) with duty resolution 0..255. The presented example … Read more

ATtiny13 – blinky with timer COMPA (assembler version)

In this example I’would like to show you how to write in assembler “blinky” project that uses timer COMPA (Timer/Counter Compare Match A) interrupt. The previous blinky project is very similar to what is presented here, but with one exception – the delay section has been replaced by timer interrupt.  In our circuit LED is connected to PB0 and is blinking … Read more

ATtiny13 – simple timer on TM1637

This project shows how to make a simple timer (start/stop/reset) using ATtiny13, LED Tube module based on TM1637 and one switch. Complete code is on GitHub. Parts ATtiny13 – i.e. MBAVR-1 development board LED Tube Display based on TM1637 Switch – i.e. simple tact-switch Circuit Diagram Software This code is written in C and can be compiled using the avr-gcc. … Read more

ATtiny13 – blinky with Watchdog Timer

Yet another ATtiny13  blinky project. In our circuit a LED is connected to PB0 and it is made to blink for roughly every second by using Watchdog Timer. The code is on Github, click here. Parts Required ATtiny13  – i.e. MBAVR-1 development board Resistor – 220Ω, see LED Resistor Calculator LED Circuit Diagram Firmware This … Read more

ATtiny13 – blinky with timer OVF (Overflow)

Yet another blinky project that is based on internal timer. In our circuit a LED is connected to PB0 and it is made to blink for roughly every second by using timer OVF (overflow). The code is on Github, click here. Parts Required ATtiny13  – i.e. MBAVR-1 development board Resistor – 220Ω, see LED Resistor … Read more

AVR MCU Architecture

The AVR architecture is a huge topic in itself. I will just provide a general picture of how the AVR microcontroller works. The AVR uses a Harvard architecture thus it has separate memories and buses for program and data. Instructions in the program memory are executed with a single level pipelining. While one instruction is … Read more