Author Topic: Any guidance on burning bootloader to Moteino Mega / atmega1284p ??  (Read 1380 times)

Creotom

  • NewMember
  • *
  • Posts: 21
I fried a 1284p chip with a signal I hadn't properly protected from, I've chalked it up to a learning experience :-)
I'd like to try and repair the board.
I managed to replace the chip (I'm quite chuffed with how well that went, my first SMD).

I have a PICKIT2 which I wired as follows:
1 -> RST
2 -> 3.3V
3 -> GND
4 -> MO
5 -> SCK
6 -> MI

I powered the Moteino via the GND and VIN pins from another arduino.
When I start up  AVR Dudess and press detect I only get the following message:

Quote
avrdude.exe: initialization failed, rc=-2
             Double check connections and try again, or use -F to override
             this check.


avrdude.exe done.  Thank you.

Any pointers?
Is there a dummies guide to this procedure anywhere?
I'd love to be able to do this.

« Last Edit: April 03, 2019, 09:05:36 PM by Felix »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6490
  • Country: us
    • LowPowerLab
Re: Any guidance on burning bootloader to Moteino Mega??
« Reply #1 on: March 11, 2019, 07:51:17 PM »
Wiring looks ok although I don't know the pin order, make sure that's right tho.
PICKIT2 - is that even compatible with AVRs?

FYI - searching the forum for "isp bootloader" reveals many threads on this topic.

Creotom

  • NewMember
  • *
  • Posts: 21
Re: Any guidance on burning bootloader to Moteino Mega??
« Reply #2 on: March 12, 2019, 05:16:52 AM »
Quote
Wiring looks ok although I don't know the pin order, make sure that's right tho.
I used the pinout in this picture


Quote
PICKIT2 - is that even compatible with AVRs?
I'm not sure, I'm pretty new to all this. I chose it because it's recommended in your guide
https://lowpowerlab.com/guide/diy-moteino/bootloader-and-basic-testing/
Do you think I'd be safe with this one? It looks like one I just saw in one of your videos.
https://www.robotshop.com/eu/en/usb-avrisp-xpii-avr-programmer.html?gclid=EAIaIQobChMI6NPozaH84AIVCrHtCh0rKgujEAQYAyABEgKipPD_BwE

Quote
FYI - searching the forum for "isp bootloader" reveals many threads on this topic.
Thanks I'll keep reading. Like I say I'm quite new to this but getting there (slowly).

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6490
  • Country: us
    • LowPowerLab
Re: Any guidance on burning bootloader to Moteino Mega??
« Reply #3 on: March 12, 2019, 09:32:33 AM »
The content in the guide was contributed so I was not aware he used a PicKit2, I never tried one. I have an original AVRISP MKii by Atmel. The one in your link is likely a clone but it should work. There are many other ways to do it, even with another Arduino programmed with the ISP sketch.

Creotom

  • NewMember
  • *
  • Posts: 21
Re: Any guidance on burning bootloader to Moteino Mega??
« Reply #4 on: March 16, 2019, 11:33:53 AM »
I'm still trying to repair this Moteino but so far it's getting the better of me.
The USB AVRISP MKII I ordered arrived.
Felix you are correct it is a clone, manufactured by Waveshare.
I connected it using Atmel Studio 7 and tried to read the device. I am only getting the following error.



Is there anything I can try or should I just order the Atmel-ICE.


Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6490
  • Country: us
    • LowPowerLab
Re: Any guidance on burning bootloader to Moteino Mega??
« Reply #5 on: March 18, 2019, 02:27:18 PM »
As long as your target is powered and you have a correct ICSP connection it should work.
The drivers might be a problem. I would try to do this with the Arduino IDE as well, sometimes the IDE can see the programmer with generic drivers whereas the AS7 requires specific drivers.
Pick Moteino or Arduino and try to Burn Booloader.

Creotom

  • NewMember
  • *
  • Posts: 21
Re: Any guidance on burning bootloader to Moteino Mega??
« Reply #6 on: March 21, 2019, 06:29:33 AM »
Ok looks like I'm beaten on this one.  :-[

Creotom

  • NewMember
  • *
  • Posts: 21
Re: Any guidance on burning bootloader to Moteino Mega?? [SOLVED]
« Reply #7 on: March 28, 2019, 10:49:58 AM »
Got it working!!!!!!!!!!!!!

1. I got the ICE debug tool and it worked flawlessly with Atmel Studio. Pricey though.
2. I had Miso and Mosi mixed up
3. Doing a save as with the hex file makes it unusable for some reason. Must download zip and extract
4. The required fuse settings are on the Moteino mega graphic. These need to be set to burn the bootloader.

I will do a write up later with pictures for anyone like me who might need some hand holding.


« Last Edit: March 28, 2019, 10:51:52 AM by Creotom »