Replacement Atmega 328P multiwii

Post Reply
Norbert1992
Posts: 14
Joined: Thu Oct 24, 2013 12:42 am

Replacement Atmega 328P multiwii

Post by Norbert1992 »

I repaced Atmega 328p in my hk multiwii 328p and now i can't program it. I'm sure all pins are soldered well. I need to change some setting of my arduino soft because i'ts brand new atmega 328p? any solution's tutorial?

jhitesma
Posts: 36
Joined: Wed Nov 20, 2013 5:41 pm

Re: Replacement Atmega 328P multiwii

Post by jhitesma »

Have you flashed an arduino bootloader to it yet?

Norbert1992
Posts: 14
Joined: Thu Oct 24, 2013 12:42 am

Re: Replacement Atmega 328P multiwii

Post by Norbert1992 »

After I asked question above i found that flashing arduino bootloader is required but... i dont know how to do it and i really can't find working solution. Any tutoria or advise maybe?

waltr
Posts: 733
Joined: Wed Jan 22, 2014 3:21 pm
Location: Near Philadelphia, Pennsyvania, USA

Re: Replacement Atmega 328P multiwii

Post by waltr »

I believe you need an USBasp programmer and connect it to the ICSP pins on the Atmega.
Search on this to learn how to program a new Atmega.

Norbert1992
Posts: 14
Joined: Thu Oct 24, 2013 12:42 am

Re: Replacement Atmega 328P multiwii

Post by Norbert1992 »

ok i have Usbasp but how to connect it to the board instead of preogrammer onboard. I can solder miso mosi etc directly to pins but if there is other option i dont want damage pins .

waltr
Posts: 733
Joined: Wed Jan 22, 2014 3:21 pm
Location: Near Philadelphia, Pennsyvania, USA

Re: Replacement Atmega 328P multiwii

Post by waltr »

I did not see any pad on this board for ICSP. So you either need to solder wires onto the Atmega or use this adapter for solderless connection:
http://www.hobbyking.com/hobbyking/stor ... arch=Atmel

This is also good to FLASH many ESCs.

Norbert1992
Posts: 14
Joined: Thu Oct 24, 2013 12:42 am

Re: Replacement Atmega 328P multiwii

Post by Norbert1992 »

look at this photo:

Image

there are 6 pins on the left next to usb conntcion. there is direct connction between those 6 pins and miso mosi sck pins so i think i can use it to connect my usbasp right?
Should i remove quartz 16 mhz for first usbasp connection and after change fuses solder it again?

waltr
Posts: 733
Joined: Wed Jan 22, 2014 3:21 pm
Location: Near Philadelphia, Pennsyvania, USA

Re: Replacement Atmega 328P multiwii

Post by waltr »

I would 'Ohm out" those pads to the atmega chip while refering to the Atmega data sheet to ensure those pads are for Flashing.
Here is a link on Flashing atmega's on an ESC (really the same chip) that shows the pins needed.
http://wiki.openpilot.org/display/Doc/F ... structions
See "Atmega8 pinout" diagram.
You need 6 pins from the Atmega: Vdd, Gnd, SCK, MISO, MOSI & RESET to program.
The XTAL does not need to be removed to Flash new code.

Norbert1992
Posts: 14
Joined: Thu Oct 24, 2013 12:42 am

Re: Replacement Atmega 328P multiwii

Post by Norbert1992 »

Thanks waltr, I'll try to flash bootloader by my USBasp and post resoults.

mattster98
Posts: 8
Joined: Sat Apr 19, 2014 12:06 am

Re: Replacement Atmega 328P multiwii

Post by mattster98 »

Norbert! Any luck? I just replaced the 328p on my HK Multiwii 328p and need to do the same thing. What I'm not sure about are the "fuse" settings for loading the bootloader.

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Replacement Atmega 328P multiwii

Post by scrat »

You can burn bootloader with Arduino. But I think you must burn bootloader to SMD atmel with internal clock 1Hz.

## FUSES Lo: FF Hi: DA Ex: 05

# 1) cd to Arduino 'hardware' folder

# 2) connect everything and test that comms work

CMD>> tools\avr\bin\avrdude.exe -C tools\avr\etc\avrdude.conf -c usbasp -p m328p

You should see something like
C:\Users\Kari\Documents\arduino-1.0\hardware>tools\avr\bin\avrdude.exe -C tools\
avr\etc\avrdude.conf -c usbasp -p m328p

avrdude.exe: warning: cannot set sck period. please check for usbasp firmware up
date.
avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.03s

avrdude.exe: Device signature = 0x1e950f

avrdude.exe: safemode: Fuses OK

avrdude.exe done. Thank you.

# 2) program fuses
CMD>> tools\avr\bin\avrdude.exe -C tools\avr\etc\avrdude.conf -c usbasp -p m328p -v -e -U -B 1000 efuse:w:0x05:m -U hfuse:w:0xDA:m -U lfuse:w:0xFF:m

# 3) program bootloader
CMD>> tools\avr\bin\avrdude.exe -C tools\avr\etc\avrdude.conf -c usbasp -p m328p -e -U flash:w:arduino\bootloaders\atmega\ATmegaBOOT_168_atmega328.hex

Post Reply