This article continues from How to Program an ATMEGA328P Standalone – Modes and Wiring. Get to know actual programming in Arduino IDE.
Introduction
Last time, you learned the modes and how to wire your ATMEGA328P for standalone programming. This time, you’ll learn how to program your ATMEGA328P in Arduino IDE. Arduino IDE is powerful software that can be programmed in different modes, such as serially or through an ISP programmer.
How to Program an ATMEGA328P through an ISP Programmer in Arduino IDE
Choose an ISP Programmer
There are several ISP programmers available in the market today that you can choose from. It may be a USBTinyISP, USBasp, AVRISP, ArduinoISP, and others. You can even use an Arduino as an ISP; just make sure you program the Arduino with AruinoISP code from the Examples code section. Go ahead an connect your ISP programmer.
Go to Tools -> Programmer -> then choose your ISP programmer.
Choose Arduino UNO as Board
Choose the Arduino UNO as a Board since the Arduino UNO has an ATMEGA328P chip inside it. Go to Tools -> Board -> Arduino AVR Boards, then choose Arduino UNO. Go ahead and make sure your ISP connections are correct on your board.
Burn the Bootloader
If you use an ISP programmer, you can burn the bootloader on the chip. Doing so, you’ll be able to program your chip next time using only a USB-to-Serial converter module. You’ll also be able to save the default values of the fuses when burning the bootloader. Simply go to Tools -> Burn Bootloader to complete the operation.
Program your Code through Upload using Programmer
Create or load your code. You can program your code on the ATMEGA328P using ISP easily by clicking Sketch -> Upload using Programmer.
Program an ATMEGA328P through a USB-to-Serial Module in Arduino IDE
If you’ve burned a bootloader on your ATMEGA328P using ISP, you can easily program the chip by only using a USB-to-Serial converter module. Wire your module properly and then follow the steps.
Choose the COM Port of your USB-to-UART Module
Choose Arduino UNO as your Board
Go to Tools -> Board -> Arduino AVR Boards -> Arduino UNO
Upload your Code using the Upload tool icon
Finally, upload your program using the Upload tool icon above.
SHOP THIS PROJECT
-
ATMega328P-AU QFP Surface Mount IC – Pack of 3
$34.95Original price was: $34.95.$32.95Current price is: $32.95. Add to cart