Skip to main content

About

Hello Reader, thanks for coming to my blog. I started this blog for posting mostly about Arduino and Atmel Studio. Over the time I have realized that it is really difficult for me to just to stick to a fix category of content, so as of now I have decided to do the post about things that interest all of us. So there will be not just posts about electronics or Arduino, but rather all sorts of activities. Thank You.  If you have a suggestion for my content or something you will like me to try, please email it at focuselectronicsyt@gmail.com with email subject as 'Blog Suggestion'.
Thank You!

Comments

Popular Post

Generating Delay Using Timer/Counter of Atmega328

     Delay is required in most of our micro-controller applications, for example to blink a LED for certain duration or just to pause the micro-controller for short time. The avr-gcc compiler in Atmel Studio comes with delay.h library to make things easy for us, but do we know how it work. No, not until we do some digging inside of the library. In this post we will learn to generate short delay without using library, this will give some basic idea for how the  _delay_ms() or _delay_us() works.      In this tutorial a Logic Analyzer is used to observe the output of Atmega328 on pin PB5. Circuit configuration for Atmega328 is shown in diagram below. Circuit Configuration      Atmega328 has three individual timer/counters identified as TC0, TC1, TC2. TC0 is an 8 bit general purpose timer/counter which can also be used for generating PWM waves, TC1 on other hand is 16 bit timer and can be used for generating PWM. Timer/Counter 2 (TC2) is 8 bit timer with support for PWM generat