Author Topic: How to customise arduino bootloader for programming different types of atmega328  (Read 1001 times)

0 Members and 1 Guest are viewing this topic.

Offline marekpasekTopic starter

  • Contributor
  • Posts: 34
  • Country: cz
Hello,
Recently I have ordered few atmega328's from ebay. They were listed as atmega328p. When they arrived I tried to programme them with arduino uno board. The transfer failed. It seems that there are multiple types of these chips and everyone of them needs some special settings of bootloader :-//. In my case I received the type atmega328p-u, while my board operates with atmega328p-pu. Since I am not good at programming, I cannot programme appropriate bootloader myself, therefore I ask you for help. Where could I find some pre-made bootloader or at least a proper description of what has to be done?
Thank you very much.

Post scriptum:
Here is the error announcement:
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x17
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x17
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x17
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x17
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x17
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x17
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x17
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x17
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x17
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x17
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3051
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
The error shown is notning to do with that, you have a connection problem.
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline marekpasekTopic starter

  • Contributor
  • Posts: 34
  • Country: cz
It works perfectly with atmega328p-pu. The problem has to be in the chip.
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3051
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
In that case either the chip is dead, it has had reset or spi programming disabled, or you are connecting it incorrectly, check the pinout.  The error literally means NO comms can be established, if it was just "different chip variant than expected" you would get a signature error with a valid but unexpected signature bytes.
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 
The following users thanked this post: marekpasek

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3051
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Also, to confirm you are attempting to burn a bootloader (tools > burn bootloader), and you can successfully do so using the "-pu" you have but not with this other suspect chips you have.
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline marekpasekTopic starter

  • Contributor
  • Posts: 34
  • Country: cz
It does not allow me to burn it in any case, no matter which chip I insert  :-//. But it still allows to transfer code to the "p-pu" without a problem.
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3051
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Ok sounds like your problem may be a lack of understanding.

I am guessing you are unplugging the working chip from ardunio, plugging in new chip and trying to "upload" some program over normal upload process, that will not work.

If that is what ypu are trying to do then I suggest you google arduino on breadboard as starting point for your learning.
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 
The following users thanked this post: tooki

Offline marekpasekTopic starter

  • Contributor
  • Posts: 34
  • Country: cz
Your initial presumption sounds very accurate. So does the second. Though I am not sure what you mean by your advice. How does that help, if I connect the chip via jumper wires and breadboard instead of the socket, which is mounted nicely on the board?
 

Offline kosine

  • Regular Contributor
  • *
  • Posts: 159
  • Country: gb
A factory-new ATmega chip has no bootloader, though you can buy the chips with a bootloader preprogrammed.

If your chips are "raw", then they won't work on an Arduino board until a bootloader has been written to them. This has to be done by SPI, on a breadboard if necessary.

The raw chips have no hardware or software to handle USB, only SPI. The Arduino board has the USB hardware and the bootloader provides the software - once it's installed. A raw chip won't know what to do with the USB until it has a bootloader on it. So you can't do it in a spare Arduino board over USB. (Catch-22) It has to be done on a breadboard via SPI using a working Arduino as a ISP programmer.

Instructions are here:
https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard




 
The following users thanked this post: marekpasek

Offline marekpasekTopic starter

  • Contributor
  • Posts: 34
  • Country: cz
Sounds great. Thank you. :)
 

Offline malagas_on_fire

  • Frequent Contributor
  • **
  • Posts: 591
  • Country: pt
  • Kernel Panic
    • Malagas Lair
Also in the future if you plan to have more atmega328p search for USB tinyISP or USBasp which is a serial 3 wire  programmer that comes with header , so you place the chip on an arduino board or custom board and burn the bootloaders in a more easy way.


Search link
 https://www.ebay.com/sch/i.html?_from=R40&_sacat=0&_nkw=usbtinyisp&_blrs=spell_check


Win Driver:

https://www.hobbyist.co.nz/?q=usb-tiny-isp


Or do a homemade one ;D:

https://malagas.wordpress.com/2012/04/28/homemade-isp-usbasp/
If one can make knowledge flow than it will go from negative to positve , for real
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf