This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
projects:3dprinting:anycubic_i3_mega:replacing_atmega2560 [2020/03/12 10:01] – [Problems] admin | projects:3dprinting:anycubic_i3_mega:replacing_atmega2560 [2022/02/04 12:40] (current) – [Install avrdude] admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Replace Atmega2560 at Trigorilla board ====== | ====== Replace Atmega2560 at Trigorilla board ====== | ||
- | You need to make sure that you can flash the arduino bootloader again onto the chip. | + | If the Atmega2560 is broken, gives for example wrong temperature readings ((See for example here: [[https:// |
- | For this you need an programmer like the AVR Dragon. | + | With the right equipment, removing the Atmega2560 and soldeering a new one should be pretty straightforward. Once done, you need to make sure that the arduino bootloader is in place. |
- | This is the wiring connection | + | For this you need a programmer like the [[https:// |
+ | |||
+ | ^ Connecting trigorilla ISP to AVR Dragon ISP ^ | ||
+ | | {{: | ||
+ | |||
+ | This is the wiring connection | ||
^ AVR Dragon ISP (pin) ^ Trigorilla ISP connector (pin) ^ | ^ AVR Dragon ISP (pin) ^ Trigorilla ISP connector (pin) ^ | ||
| 1: MISO | 1: D50 (Mega2560 pin 22) | | | 1: MISO | 1: D50 (Mega2560 pin 22) | | ||
Line 13: | Line 18: | ||
| 6: GND | 6: GND | | | 6: GND | 6: GND | | ||
- | To flash the bootloader, download and install avrdude: | + | (Pin marking is given on the silk-screen) |
+ | |||
+ | For flashing | ||
==== Download avrdude ==== | ==== Download avrdude ==== | ||
Line 23: | Line 30: | ||
<code bash> | <code bash> | ||
- | gunzip | + | # Dependencies |
- | cd avrdude-6.0 | + | sudo apt-get update |
+ | sudo apt-get install build-essential bison flex automake libelf-dev libusb-1.0-0-dev libusb-dev libftdi-dev libftdi1 | ||
+ | |||
+ | mkdir -p $HOME/ | ||
+ | cd !$ | ||
+ | wget http:// | ||
+ | tar xzf avrdude-6.4.tar.gz | ||
+ | # See here https:// | ||
+ | # for an explanation about word designaters in bash | ||
+ | cd !$:r:r | ||
./configure | ./configure | ||
make | make | ||
- | su root -c 'make install' | + | sudo make install |
</ | </ | ||
Line 49: | Line 65: | ||
Original bootloader: | Original bootloader: | ||
- | arduino-1.8.5/ | + | |
| | ||
or the newer one that fixes the WDT and the !!! problems((See for more info: https:// | or the newer one that fixes the WDT and the !!! problems((See for more info: https:// | ||
Line 60: | Line 76: | ||
=== 1. Unlock fuses, erase, verify === | === 1. Unlock fuses, erase, verify === | ||
+ | The original command would be: | ||
+ | |||
avrdude -p m2560 -c dragon_isp -P usb -Ulock: | avrdude -p m2560 -c dragon_isp -P usb -Ulock: | ||
- | + | But this command will cause avrdude to show an error at the verification step((See here: [[http://www.engbedded.com/fusecalc]])). To prevent this error, it is recommended to change this command | |
- | To prevent | + | |
avrdude -p m2560 -c dragon_isp -P usb -Ulock: | avrdude -p m2560 -c dragon_isp -P usb -Ulock: | ||
+ | |||
+ | The reason is that only the lowest 3 bits from the lockbits are used. The other bits don't return any sensible value and causes avrdude to indicate an error. Ideally you would need to use a logical AND to filter for the lowest 3 bits. | ||
=== 2. Write the bootloader, set the lock fuse, verify === | === 2. Write the bootloader, set the lock fuse, verify === | ||
avrdude -p m2560 -c dragon_isp -P usb -Uflash: | avrdude -p m2560 -c dragon_isp -P usb -Uflash: | ||
- | Similarly, to prevent an error with the fuse setting at the verification step((See here: [[https:// | + | Similarly |
avrdude -p m2560 -c dragon_isp -P usb -Uflash: | avrdude -p m2560 -c dragon_isp -P usb -Uflash: | ||
Line 89: | Line 108: | ||
</ | </ | ||
- | You may have to change the fuse setting verification step((See here: [[https://www.avrfreaks.net/forum/ | + | You may have to change the fuse setting verification step((See here: [[http://www.engbedded.com/fusecalc]])). See above for the change. |
===== Further information ===== | ===== Further information ===== | ||
* [[https:// | * [[https:// |