AVR Atmega 16 Blink LED - CodeVision

Sơ đồ

Code

Chip type               : ATmega16

Program type            : Application

AVR Core Clock frequency: 8,000000 MHz

Memory model            : Small

External RAM size       : 0

Data Stack size         : 256


#include <mega16.h>

#include <delay.h>

 

// Declare your global variables here

 

void main(void)

{

    DDRA = 0b11111111;

    PORTA = 0b00000000;

while (1)

      {

          PORTA.0=~PORTA.0;

          delay_ms(100);

      }

}


Demo: