ATMEGA328 Standalone Project


Install Arduino Minicore 
Open Arduino IDE
Click File-Preferences
Additional Board Manager URL
enter the Link 
//mcudude.github.io/MiniCore/package_MCUdude_MiniCore_index.json
click OK.
Go to Tools-Boards- Board Manager
type Minicore-
Minicore MCU dude Version 2.1.3
click Install, After installation close and restart Arduino IDE.


Circuit Diagram for Burn Bootloader to Atmega328 microcontroller


Go to Tools and Follow these setting For Burn bootloader







Circuit Diagram for Upload a Sketch to Atmega328 microcontroller

Go to Tools and Follow the setting for Upload a sketch to Atmega 328











int del = 50; //defining delay value (0.1 second)
int del1 = 1000; //defining delay value (1 second)
void setup() {
  // put your setup code here, to run once:
  pinMode(0, OUTPUT);//defining pins (0-13) as Outputs
  pinMode(1, OUTPUT);
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(13, OUTPUT);
}

void loop() {
  for (int i = 0; i <= 13; i++) { // For loop will count from 0 to 13 to turn ON and OFF every single pin
    digitalWrite(i, HIGH);        // Turning ON 1st output (LED)
    delay(del);                   // LED is ON for 20ms before turning OFF
    digitalWrite(i, LOW);         // Turning OFF 1st output (LED)
    delay(del);                   // Waiting 50ms before running the 2nd cycle of FOR loop
  }
  for (int i = 13; i >= 0; i--) { // For loop will count from 13 to 0 to turn ON and OFF every single pin
    digitalWrite(i, HIGH);        // Turning ON 1st output (LED)
    delay(del);                   // LED is ON for 20ms before turning OFF
    digitalWrite(i, LOW);         // Turning OFF 1st output (LED)
    delay(del);                   // Waiting 50ms before running the 2nd cycle of FOR loop
  }
  delay(del1);
  digitalWrite(0, HIGH);
  digitalWrite(1, LOW);
  digitalWrite(2, HIGH);
  digitalWrite(3, LOW);
  digitalWrite(4, HIGH);
  digitalWrite(5, LOW);
  digitalWrite(6, HIGH);
  digitalWrite(7, LOW);
  digitalWrite(8, HIGH);
  digitalWrite(9, LOW);
  digitalWrite(10,HIGH);
  digitalWrite(11, LOW);
  digitalWrite(12,HIGH);
  digitalWrite(13,LOW);
  delay(del1);
  digitalWrite(0, LOW);
  digitalWrite(1, HIGH);
  digitalWrite(2, LOW);
  digitalWrite(3, HIGH);
  digitalWrite(4, LOW);
  digitalWrite(5, HIGH);
  digitalWrite(6, LOW);
  digitalWrite(7, HIGH);
  digitalWrite(8, LOW);
  digitalWrite(9, HIGH);
  digitalWrite(10,LOW);
  digitalWrite(11,HIGH);
  digitalWrite(12,LOW);
  digitalWrite(13,HIGH);
  delay(del1);
  digitalWrite(0, HIGH);
  digitalWrite(1, HIGH);
  digitalWrite(2, HIGH);
  digitalWrite(3, HIGH);
  digitalWrite(4, HIGH);
  digitalWrite(5, HIGH);
  digitalWrite(6, HIGH);
  digitalWrite(7, HIGH);
  digitalWrite(8, HIGH);
  digitalWrite(9, HIGH);
  digitalWrite(10,HIGH);
  digitalWrite(11,HIGH);
  digitalWrite(12,HIGH);
  digitalWrite(13,HIGH);
  delay(del1);
  digitalWrite(0, LOW);
  digitalWrite(1, LOW);
  digitalWrite(2, LOW);
  digitalWrite(3, LOW);
  digitalWrite(4, LOW);
  digitalWrite(5, LOW);
  digitalWrite(6, LOW);
  digitalWrite(7, LOW);
  digitalWrite(8, LOW);
  digitalWrite(9, LOW);
  digitalWrite(10,LOW);
  digitalWrite(11,LOW);
  digitalWrite(12,LOW);
  digitalWrite(13,LOW);
  delay(del1);
  digitalWrite(0, LOW);
  digitalWrite(1, LOW);
  digitalWrite(2, LOW);
  digitalWrite(3, LOW);
  digitalWrite(4, LOW);
  digitalWrite(5, LOW);
  digitalWrite(6, LOW);
  digitalWrite(7, HIGH);
  digitalWrite(8, HIGH);
  digitalWrite(9, HIGH);
  digitalWrite(10,HIGH);
  digitalWrite(11,HIGH);
  digitalWrite(12,HIGH);
  digitalWrite(13,HIGH);
  delay(del1);
  digitalWrite(0,HIGH);
  digitalWrite(1, HIGH);
  digitalWrite(2, HIGH);
  digitalWrite(3, HIGH);
  digitalWrite(4, HIGH);
  digitalWrite(5, HIGH);
  digitalWrite(6, HIGH);
  digitalWrite(7, LOW);
  digitalWrite(8, LOW);
  digitalWrite(9, LOW);
  digitalWrite(10,LOW);
  digitalWrite(11,LOW);
  digitalWrite(12,LOW);
  digitalWrite(13,LOW);
  delay(del1);
}


Comments

Popular posts from this blog

4 Stage Timer With DS3231RTC Module.

Interfacing KY038 sound sensor with Raspberry pi Pico

Interfacing MQ2 Gas & Smoke Sensor With Raspberry Pi Pico