Author Topic: How to load sketch atmega328p with bootloader ?  (Read 2114 times)

0 Members and 1 Guest are viewing this topic.

Offline abdullahsebaTopic starter

  • Frequent Contributor
  • **
  • Posts: 335
  • Country: gb
How to load sketch atmega328p with bootloader ?
« on: May 13, 2017, 08:47:11 pm »
Hi
I have a atmega328p with the arduino bootloader installed but cant find out how I would load a sketch on to it without plugging it into the uno.
I need to do this in circuit because I later will be using the TQFP version of it.
Is there any way to do this with an existing arduino or do I need another programmer?
Thanks in advance.
This is my right hand this is my wrong hand
 

Offline igendel

  • Frequent Contributor
  • **
  • Posts: 359
  • Country: il
    • It's Every Bit For Itself (Programming & MCU blog)
Re: How to load sketch atmega328p with bootloader ?
« Reply #1 on: May 13, 2017, 09:04:24 pm »
Do you wish to preserve the existing bootloader on the chip?

If so, I think you can take a regular UNO (the kind with a DIP chip), take the chip out of it, and connect the RX, TX and Reset pins from the board to the appropriate pins on the standalone chip. Then burn the sketch from the Arduino IDE as usual. Don't forget the 16MHz crystal and all that  :)

[Edit: and connect the Grounds too!]
« Last Edit: May 13, 2017, 09:13:40 pm by igendel »
Maker projects, tutorials etc. on my Youtube channel: https://www.youtube.com/user/idogendel/
 
The following users thanked this post: abdullahseba

Offline abdullahsebaTopic starter

  • Frequent Contributor
  • **
  • Posts: 335
  • Country: gb
Re: How to load sketch atmega328p with bootloader ?
« Reply #2 on: May 13, 2017, 09:21:26 pm »
I did try that but it the IDE just uploaded forever untill error.
This is my right hand this is my wrong hand
 

Offline igendel

  • Frequent Contributor
  • **
  • Posts: 359
  • Country: il
    • It's Every Bit For Itself (Programming & MCU blog)
Re: How to load sketch atmega328p with bootloader ?
« Reply #3 on: May 13, 2017, 09:28:40 pm »
I did try that but it the IDE just uploaded forever untill error.

Plenty of things can go wrong... but check your connections carefully, it should work.
See here:
https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard
(mainly the "Uploading Using an Arduino Board" section, but it won't hurt to read the rest)

[Edit: that page is old, stating "Arduino Duemilanove" - you'd probably want to choose "Arduino Uno" instead]
Maker projects, tutorials etc. on my Youtube channel: https://www.youtube.com/user/idogendel/
 

Offline abdullahsebaTopic starter

  • Frequent Contributor
  • **
  • Posts: 335
  • Country: gb
Re: How to load sketch atmega328p with bootloader ?
« Reply #4 on: May 13, 2017, 10:22:10 pm »
No connections are fine It runs circuits fine.
This is my right hand this is my wrong hand
 

Offline igendel

  • Frequent Contributor
  • **
  • Posts: 359
  • Country: il
    • It's Every Bit For Itself (Programming & MCU blog)
Re: How to load sketch atmega328p with bootloader ?
« Reply #5 on: May 13, 2017, 10:39:16 pm »
Hmm... well, there's only so much I can do without testing the circuit myself, sorry. But again, this is a very common procedure, it should work, so keep looking. Is there something else interfering with the reset/RX/TX lines? Is there sufficient power? etc. etc.
Maker projects, tutorials etc. on my Youtube channel: https://www.youtube.com/user/idogendel/
 
The following users thanked this post: abdullahseba

Offline abdullahsebaTopic starter

  • Frequent Contributor
  • **
  • Posts: 335
  • Country: gb
Re: How to load sketch atmega328p with bootloader ?
« Reply #6 on: May 13, 2017, 10:48:44 pm »
Ah it does work, had the RX/TX the wrong way  |O |O First time didn't work cuz I kept the chip in and tied the uno's reset to ground to act as a USB to TTL.
Thanks  ;D
This is my right hand this is my wrong hand
 

Offline igendel

  • Frequent Contributor
  • **
  • Posts: 359
  • Country: il
    • It's Every Bit For Itself (Programming & MCU blog)
Re: How to load sketch atmega328p with bootloader ?
« Reply #7 on: May 13, 2017, 11:21:13 pm »
Ah it does work, had the RX/TX the wrong way

One of the most common mistakes. Someone else here made the same one just a couple of days ago:
https://www.eevblog.com/forum/microcontrollers/troubleshooting-custom-arduino-nano-board/msg1203081/#msg1203081
 :)
Maker projects, tutorials etc. on my Youtube channel: https://www.youtube.com/user/idogendel/
 
The following users thanked this post: abdullahseba


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf