Today we have been using Arduino IDE on ATmega1284. It is not difficult to get it running but is a little tricky if you don’t know what you are exactly doing. In this post I will show you how to get it working from scratch, using always open hardware & software. This post is written in catalan. Sorry! You can always use google translator đ
1 – Instalar el plug-in per treballar amb aquest micro en Arduino.
En aquest link hi ha tots els arxius necessaris per lâentorn Arduino:
https://github.com/JChristensen/mighty-1284p/tree/v1.6.3
Com instalar aquests arxius:
- Go to https://github.com/JChristensen/mighty-1284p/tree/v1.6.3, click the Download ZIP button and save the ZIP file to a convenient location on your computer.
- Ensure that the Arduino IDE is not running.
- Go to your Arduino hardware folder.
- Unzip the downloaded file into the hardware folder.
- The download from GitHub will have a dash and branch name appended, so the folder will be named, e.g. mighty-1284p-v1.6.3. Rename the folder to just mighty-1284p.
- The following folders and files should now exist:
- hardware\mighty-1284p\avr\bootloaders
- hardware\mighty-1284p\avr\libraries
- hardware\mighty-1284p\avr\patched-3rd-party-libs
- hardware\mighty-1284p\avr\variants
- hardware\mighty-1284p\avr\boards.txt
- hardware\mighty-1284p\avr\boards.txt.alt
- hardware\mighty-1284p.gitignore
- hardware\mighty-1284p\README.md
- Move any mighty-1284p compatible 3rd party patched libs under [sketchfolder]\libraries as required. (Note: the mighty-1284p compatible “official” patched libs are already set-up to be used as default when using mighty-1284p by being in avr\libraries. If the wrong libs are being used, check to see that there aren’t old versions of the patched libs still under [sketchfolder]\libraries, as those would take precedence.)
- Restart the Arduino IDE.
- Select the desired board from the Tools > Board menu and enjoy those extra pins and all that extra memory!
Note: There is an alternative version of the boards.txt file supplied named boards.txt.alt. It provides more combinations of boards and clock speeds than the standard boards.txt selection menu. It uses a two-step selection of board type and then clock-speed via a submenu. As this differs from the standard boards.txt format, it is provided as an option for those users with more specialized needs, while the default boards.txt retains the more familiar style of interface, to minimise any potential for confusion.
To enable the alternate version, rename boards.txt to boards.txt.org, and then rename boards.txt.alt to boards.txt. Restart IDE, and the new selection options will appear.
2 – Carregar el bootloader al ATmega1284:
Ens hem fet un programador amb un Arduino MEGA 2560. El firmware del programador esta al mateix entorn del Arduino, a Exemples > ArduinoISP. Hem grabat el firmware al programador i OK. Ara tenim la placa dâarduino que ens fa de programador.
Hem connectat les potes del arduino mega al micro 1284 de la segĂŒent manera:
El connector on hi posa arduino esta pensat per conectar-ho a un arduino UNO. Com que nosaltres ho hem fet amb un Mega, els pins canvien per aquests:
ATmega1284 | Arduino mega 2560 |
RESET, pin 9 | 53 |
MOSI, pin 6 | 51 |
MISO, pin 7 | 50 |
SCK, pin 8 | 52 |
Per carregar el bootloader hem de seleccionar la placa que volguem de les disponibles. Nosaltres hem fet servir la âmaniacbugâ perquĂš tĂ© un pinout mĂ©s intuitiu.
Un cop seleccionada la placa cal seleccionar el programador que volem a Tools > Programmer. En aquest cas li hem dit Arduino as ISP.
Ara ja podem baixar el bootloader fent: Burn Bootloader al menĂș Tools.
Nota:Â Ens hem trobat amb el problema que lâidentificador del micro no era lâesperat. La placa esperava aquest:
0x1e 0x97 0x05
I sâha trobat amb aquest:
0x1e 0x97 0x06
AixĂČ Ă©s perquĂš els micros 1284 i 1284P tenen el mateix nucli perĂČ canvia el consum dâenergia i el identificador. AquĂ ho explica bĂ©:
https://sepzed.wordpress.com/2014/03/15/arduino-on-1284p-and-1284-non-p-version/
Per un moment enganyarem al entorn dient que el nostre micro tĂ© el identificador 0x1e 0x97 0x06. AixĂČ es configura a aquest arxiu:
C:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.conf
En: # ATmega1284P, signature = 0x1e 0x97 0x05; (canviar per 0x1e 0x97 0x06).
Un cop haguem modificat aquest arxiu ja ens deixa programar el bootloader. Per poder tornar a baixar sketchs al micro haurem de deixar lâarxiu avrdude.conf tal i com estava
3 â Carregar el programa al micro ATmega1284:
Es fa de la mateixa manera que es fa amb qualsevol placa dâarduino. Seleccionar la placa dins de Tools > Board.
Mes informaciĂł sobre el tema:
https://maniacbug.wordpress.com/2011/11/27/arduino-on-atmega1284p-4/
http://www.gammon.com.au/forum/?id=11635
https://github.com/JChristensen/mighty-1284p/tree/v1.6.3