USBASP Bootloading a ATMega328p With a 8mhZ Internal Clock

69,564

36

12

Introduction: USBASP Bootloading a ATMega328p With a 8mhZ Internal Clock

About: Why would i buy something ready made when i can make it myself with half the features for twice the money? DIY!

What are we going to do is program an ATMega328P without an external crystal by using USBASP programmer and the Arduino IDE.
Why would we want this? It uses less components and gets up closer to knowing how to program with something like WINAVR and because programming is fun an addicting. Not everything runs on Arduino, but it is a great place to start. 


I use an USBASP clone programmer from my local electronics store. I have read this same procedure can be done on and Arduino board, but i have not been unsuccessful at making that work.  

Step 1: Connections


If you follow the ISP Header 6-pin and connect the
MISO to the MISO on the chip
SCK to SCK on the chip.
You get the idea.
You could do all this on a breadboard or you could use the avr target board fournd here.
Additionally you can get some good help here

The 6-Pin header is on the USBASP.

Step 2: Board Files

If your board selection does not look like mine where is says " ATMEGA 328 on a breadboard (8MHz internal clock) "  then you need to install the board files i have provided.
Even if you do have the " ATMEGA 328 on a breadboard (8MHz internal clock) " showing but it is not working then you need to install my files.

The only difference is the last line.     atmega328bb.build.variant=arduino:standard

Step 3: How Do I Install This File?

This where my files are. Hopefully yours will be simulare. 
So to get to where we need to be,
Open up the:
Sketch book file 
next  Hardware
next Arduino
next  boards
and you are there. 
Open the boards file in notepad. Once opened you will need to go to the bottom and just copy and past my file there.
Follow the pictures please.
DO NOT forget to hit save !

Step 4: Installed Now What?

In the Arduino IDE, select the tools menu then Boards and make sure the  ATMEGA 328 on a breadboard (8MHz internal clock) is highlighted.
Also in tools select the Programmer and choose USBasp.
Lastly in tools select Burn Bootloader and wait as it takes a minute or so. 
We do not worries about what serial port because we are using this is USB and not serial.

Step 5: What Happened?

After pressing Burn Bootloader it will say  " Burning bootloader ti I/O Board ( this may take a minute)  at the bottom of the IDE.
Notice also at the bottom it also the 8MHz board selected.

Next after that is finished it will say " Done burning bootloader "

Possibly there will be some errors showing about sck period and update firmware.
This still works even if those errors are showing, ignore them.

2 People Made This Project!

Recommendations

  • Game Design: Student Design Challenge

    Game Design: Student Design Challenge
  • Make It Bridge

    Make It Bridge
  • For the Home Contest

    For the Home Contest

12 Comments

0
BerkcanA
BerkcanA

7 years ago on Introduction

Error while burning bootloader: missing 'bootloader.tool' configuration parameter

Any idea ?

0
AlexeyS4
AlexeyS4

Reply 3 years ago

For newer version of Arduino IDE use this modification. Worked for me.
Added parameters upload.tool, bootloader.tool.

atmega328bb.name=ATmega328 on a
atmega328bb.name=ATmega328 on a breadboard (8 MHz internal clock)
atmega328bb.upload.tool=avrdude
atmega328bb.upload.protocol=stk500
atmega328bb.upload.maximum_size=30720
atmega328bb.upload.speed=57600
atmega328bb.bootloader.tool=avrdude
atmega328bb.bootloader.low_fuses=0xE2
atmega328bb.bootloader.high_fuses=0xDA
atmega328bb.bootloader.extended_fuses=0x05
atmega328bb.bootloader.path=arduino:atmega
atmega328bb.bootloader.file=atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex
atmega328bb.bootloader.unlock_bits=0x3F
atmega328bb.bootloader.lock_bits=0x0F
atmega328bb.build.mcu=atmega328p
atmega328bb.build.f_cpu=8000000L
atmega328bb.build.core=arduino:arduino
atmega328bb.build.variant=arduino:standard

0
RamakantY3
RamakantY3

Tip 4 years ago

If you are on a Mac, remember to right click, show package contents in the Arduino in the downloads folder to get into the path for the boards. Txt

0
RamakantY3
RamakantY3

4 years ago

Very good guide. Was able to make to work on a Mac using the Arduino ide. If someone gets the bootloader.tool or uploader.tool missing, simply use the avrdude value. The boards file has a number of examples, so copy from another section and change the name accordingly. It worked for me.

0
lefolindo
lefolindo

8 years ago

where ar the file that you have provided ( the board file for atmega328 (8 mhz internal clock) ?

0
WWC
WWC

Reply 8 years ago

If you are talking about my files there is links to them in the Instructable. If you are talking about a ATmega328P file that can be found on line easily enough.

0
Steve25
Steve25

9 years ago on Introduction

Nice guide! But can you program every atmega and attiny's (like atmega8 ore attiny85) with Arduino IDE?

0
WWC
WWC

Reply 9 years ago on Introduction

I think not. If you search i believe wekapedia it will give you such an answer

0
Steve25
Steve25

Reply 9 years ago on Introduction

Well i found some text for the atmega8:
##############################################################
atmega8u.name=ATMEGA8
atmega8u.upload.protocol=arduino
atmega8u.upload.maximum_size=7680
atmega8u.upload.speed=115200
atmega8u.bootloader.low_fuses=0xff
atmega8u.bootloader.high_fuses=0xcc
atmega8u.bootloader.path=optiboot
atmega8u.bootloader.file=optiboot_atmega8.hex
atmega8u.bootloader.unlock_bits=0x3F
atmega8u.bootloader.lock_bits=0x0F
atmega8u.build.mcu=atmega8
atmega8u.build.f_cpu=16000000L
atmega8u.build.core=arduino
atmega8u.build.variant=standard
##############################################################

0
Steve25
Steve25

Reply 9 years ago on Introduction

What do i need to change in the code above? only the upload protocol to usbasp?

0
WWC
WWC

Reply 9 years ago on Introduction

I wish i could help you but this is really getting beyond my knowledge range on this matter.
Perhaps if you could ask in the Instructables forums there is some very smart people there that may be able to help you if you ask nicely.
I wish you good luck.