EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / AVR ATMEGA8

AVR ATMEGA8

|

Microcontroller › AVR › AVR ATMEGA8

  • This topic has 1 reply, 2 voices, and was last updated 14 years, 2 months ago by dagakshay.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • April 29, 2011 at 7:36 pm #893
    ravi
    Participant

    The AVR is a modified Harvard architecture 8-bit RISC single chip microcontroller which was developed by Atmel in 1996. The AVR was one of the first microcontroller families to use on-chip flash memory for program storage, as opposed to One-Time Programmable ROM, EPROM, or EEPROM used by other microcontrollers at the time.

     

    As simple program Atmega8 using  led coding

     

    /* LED BLINKING ON AND OFF */

     

    #include<avr/io.h>

    #include<utily/delay.h>

    int main( )

    {

    DDRB = 0XFF;

    while (1)

    {

    PORTB = 0XFF; //portb all pins is high

    _delay_ms(5);

    PORTB = 0X00; //portb all pins is off

    _delay_ms(5);

    }

    }

     

    /* switch status which is connected to PB0 .If PB0 is high glow led else switch off  led

     

     

    #include<avr/io.h>
    #include<util/delay.h>
    void init_ports(void)
    {
    DDRB=0X00;
    DDRC=0XFF;
    }
    int main()
    {
    init_ports();
    while(1)
    {
    if(PINB&0X01)
    {
    PORTC=0XFF;
    _delay_ms(5);
    }
    else
    {
    PORTC=0X00;
    _delay_ms(5);
    }
    }
    return 0;
    }
     
    April 30, 2011 at 7:00 am #6064
    dagakshay
    Participant

    just have a look at these links

    http://www.engineersgarage.com/articles/avr-microcontroller

    http://www.engineersgarage.com/embedded/avr-microcontroller-projects/led-interface-circuit

    http://www.engineersgarage.com/embedded/avr-microcontroller-projects/setting-input-pin-circuit

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Adhesive Defibrillator Pad Cable June 25, 2025
  • Epson crystal oscillators June 25, 2025
  • Simple LED Analog Clock Idea June 24, 2025
  • Fun with AI and swordfish basic June 24, 2025
  • Microinverters and storeage batteries? June 23, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise