Showing posts with label AVR Studio4. Show all posts
Showing posts with label AVR Studio4. Show all posts

Sunday, 11 June 2017

Generating a delay of 1s using timer in atmega8

Hello Friends,

In this tutorial, we will learn how to generate a delay of 1second using timer0 in atmega8.

We are writing the code in Avr studio 4.

Timer 0 is a 8-bit timer means we can feed any value from 0 (0x00) to 255 (0xff)

Timing Diagram
In this example, we are using prescaler of value8. Prescaler divides the base frequency (provided by crystal or internal rc oscillator).

Machine Cycle = 1/Fosc      (Fosc is 8 MHz)

M.C = 1/8 us or 0.125 us

Delay = (256-x) * 0.125 * Pre scaler  (Pre scaler = 8)

Tuesday, 21 June 2016

How to make a new project in AVR Studio 4

Steps for making a new project in AVR Studio 4:


Step 1: From file menu click on project. Under project select project wizard
project wizard in avr studio 4
Project Wizard

                   Step 2: Click on new project then click next



new project in avr studio
New project