Programming ATmega328P microcontroller using Proteus | applied electronics engineering

Latest

Programming ATmega328P microcontroller using Proteus

By Applied Electronics - Saturday, April 15, 2017 No Comments
You may have programmed Arduino UNO using Proteus software. But have you tried programming the ATMega328P microcontroller using Proteus? As you should know ATMega328P is the microcontroller that is used in Arduino UNO. The benefit of learning ATmega328P microcontroller programming instead of Arduino UNO board is helpful in your professional career or if you want to design some embedded system application.

Here is how you can program ATmega328P using Proteus. It is very simple. For illustrative purpose we will create a hello world microcontroller program, that is LED blinking program and circuit. See the following circuit diagram.


The microcontroller is easily found if you type in the ATmega328 into the search field in the proteus library. Then place it onto the schematic sheet. Complete the circuit for simple LED blinking at port PB5 which corresponds to pin 13 in the usual Arduino board.

To program the microcontroller, double click it to open its properties. There click on the edit firmware. Select either Arduino AVR or Arduino AVR(proteus), doesn't matter both should work.


Now write the following program into the code editor window that you will see.

void setup() {
  pinMode(13, OUTPUT);
}

void loop() {
  digitalWrite(13, HIGH); 
  delay(100);                     
  digitalWrite(13, LOW);  
  delay(100);                    
}

Finally right click on the main.ino file on the left pane and select Build Project. This should compile and upload the program file into the ATmega238P microcontroller.

Now return to the schematic and run the simulation. The LED should be blinking at rate 100ms as programmed.

Next see our other Arduino tutorials Send message to Arduino using Bluetooth Module HC-05, How to read sinusoidal signal using Arduino Due

No Comment to " Programming ATmega328P microcontroller using Proteus "