Notifications
Clear all

Bootloader onto ATMega328P-PU Chip and Then Loading Sketch

36 Posts
4 Users
2 Likes
6,102 Views
(@pugwash)
Sorcerers' Apprentice
Joined: 5 years ago
Posts: 923
 

@stargatefan

I learn new things each time I talk to you guys.

That is the way it should be, I also learn from others on this forum!


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1018
 

@pugwash@stargatefan

The bootloaders for the two chips are definitely different and as soon as I get some of the 328P chips I'll try to do a write up on what are the steps to program the two different chips, and any pitfalls you might encounter.

I'm working on a proto-board with a 28 Pin ZIF socket that will allow programming from either a connection to another Arduino or with an external FTDI adapter.  If it works out good enough, I might just put it into KiCad and have a few boards made.

SteveG


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1018
 
Posted by: @pugwash

That is the way it should be, I also learn from others on this forum!

And that is probably true for everyone on this forum, I know it is for me!

SteveG


   
ReplyQuote
(@stargatefan)
Member
Joined: 4 years ago
Posts: 15
Topic starter  

@codecage
@Pugwash
I'd be very interested if that protoboard works.

So the Word document attached shows how I loaded the bootloader and then programmed the sketch.  Note that I did confirm I could also program using the Uno board like Pugwash thought I could.  But I noticed if I programmed the bootloader with the Uno board I also had to load the sketch that way.  I couldn't switch between the Duemilanove bootloader and the Uno sketch.

I was also able to insert a 28 pin socket into my Uno into the socket I already have soldered into the Uno.  Then I put the ATMega328P-PU I want to program into the extra socket.  Hopefully this means I'll wear out less boards.

Getting the FTDI adapter working has taken something of a backseat for the moment.  I would still like to get it working.  But now I want to try to figure out how to get the Pirates  of the Carribean song to work with the Star Wars song (the one Bill introduced us to).  I've got the Star Wars song working with a pushbutton.  But the Pirates song doesn't execute inside of the loop.  I'm still trying to figure that one out.


   
ReplyQuote
(@pugwash)
Sorcerers' Apprentice
Joined: 5 years ago
Posts: 923
 

@stargatefan

This is the setup I used to get the bootloader on to the ATmega328P.

IMG 4257

 

I used the Mega as the master and Uno as the slave, and used Atmega_Board_Programmer from Nick Gammon's toolbox (files below) on the Arduino Mega.

As I was converting the ATmega328P to 8MHz, to run on 3.3V, the actual sketch uploading had to be done on a breadboard with NO oscillator attached. I used an FTDI USB to serial for the sketch uploading.

Unfortunately, I can't do any more experimenting with bootloaders until my new ATmega328P chips arrive from China, which due to the Corona Virus, is probably in the distant future!


   
Duce robot reacted
ReplyQuote
Duce robot
(@duce-robot)
Member
Joined: 5 years ago
Posts: 672
 

They have them on amazon with the bootloader already installed for arduino . $6.99


   
ReplyQuote
Page 3 / 3