Differenze tra le versioni di "Gruppo Meteo/HowTo/DebugAVR"
(Creata pagina con ''''Come debuggare con AVR Dragon su arduino mega2560''' WARNING It is possible, using the tools discussed here to either ‘brick’ your processor or physically destroy it....') |
|||
Riga 47: | Riga 47: | ||
There are only 7 connections needed and these are as follows: | There are only 7 connections needed and these are as follows: | ||
− | arduinoPin Signal | + | {| border="1" |
− | 5v +5v 4 Output 5v Supply from Arduino | + | |arduinoPin |
− | GND GND 2 or 10 (either will do) - | + | |Signal |
− | analog in 4 TCK 1 Input | + | |Dragon Jtag |
− | analog in 5 TMS 5 Input | + | |I/O |
− | analog in 6 TDO 3 Output Test Data Output, data signal from target JTAG port to AVR Dragon | + | |Description |
− | analog in 7 TDI 9 Input | + | |- |
− | reset | + | |5v |
+ | | +5v | ||
+ | |4 | ||
+ | |Output | ||
+ | |5v Supply from Arduino | ||
+ | |- | ||
+ | |GND | ||
+ | |GND | ||
+ | |2 or 10 (either will do) | ||
+ | | - | ||
+ | |Ground reference | ||
+ | |- | ||
+ | |analog in 4 | ||
+ | |TCK | ||
+ | |1 | ||
+ | |Input | ||
+ | |Test Clock, clock signal from AVR Dragon to target JTAG port | ||
+ | |- | ||
+ | |analog in 5 | ||
+ | |TMS | ||
+ | |5 | ||
+ | |Input | ||
+ | |Test Mode Select, mode select signal from AVR Dragon to target JTAG port | ||
+ | |- | ||
+ | |analog in 6 | ||
+ | |TDO | ||
+ | |3 | ||
+ | |Output | ||
+ | |Test Data Output, data signal from target JTAG port to AVR Dragon | ||
+ | |- | ||
+ | |analog in 7 | ||
+ | |TDI | ||
+ | |9 | ||
+ | |Input | ||
+ | |Test Data Input, data signal from AVR Dragon to target JTAG port | ||
+ | |- | ||
+ | |reset | ||
+ | |RST | ||
+ | |6 | ||
+ | | | ||
+ | |Reset | ||
+ | |} | ||
Note: These pin numbers refer to the shield pin numbers of the Arduino Mega2560 and not to the pins on the processor. | Note: These pin numbers refer to the shield pin numbers of the Arduino Mega2560 and not to the pins on the processor. |
Versione delle 18:54, 19 mar 2014
Come debuggare con AVR Dragon su arduino mega2560
WARNING
It is possible, using the tools discussed here to either ‘brick’ your processor or physically destroy it. This also includes your AVR Dragon. Make sure you double and triple check all connections BEFORE you turn on any power and make sure you disconnect the power BEFORE making any wiring changes.
I can not be held responsible for your errors in skills or judgement.
materiali necessari
hardware:
- arduino mega2560
- AVR Dragon
- cavi ...
- un pc
software:
- un sistema operativo serio (Linux)
- toolchain gcc per avr
- avrdude
- avarice
- gdb
- ddd
Collegamenti
ISP: In System Programming using SPI is well suited for programming devices soldered onto external target boards. This section explains how to connect the Atmel AVR Dragon to SPI program an external target. The SPI lines are equipped with level converters that automatically will level shift the AVR Dragon signals to the target board voltage.
It is recommended that a 6-pin header connector with 2.54mm (100 MIL) spacing is placed on the target board to allow easy access to the SPI programming interface. The following pinout should be used.
6pin Header Connector with 2.54mm (100 MIL) spacing http://www.atmel.no/webdoc/avrdragon/images/ISPHEADER.jpg
Questo la disposizione dei pin sulla board Arduino http://arduino-info.wikispaces.com/file/view/Mega2560_R3_Label-small-v2%20%282%29.png/471429496/800x526/Mega2560_R3_Label-small-v2%20%282%29.png
il collegamento ISP una volta capito è facile: l'ordine è il medesimo, basta trovare il pin 1 del connettore.
link: http://www.atmel.no/webdoc/avrdragon/avrdragon.isp_description.html http://arduino-info.wikispaces.com/MegaQuickRef
Jtag:
There are only 7 connections needed and these are as follows:
arduinoPin | Signal | Dragon Jtag | I/O | Description |
5v | +5v | 4 | Output | 5v Supply from Arduino |
GND | GND | 2 or 10 (either will do) | - | Ground reference |
analog in 4 | TCK | 1 | Input | Test Clock, clock signal from AVR Dragon to target JTAG port |
analog in 5 | TMS | 5 | Input | Test Mode Select, mode select signal from AVR Dragon to target JTAG port |
analog in 6 | TDO | 3 | Output | Test Data Output, data signal from target JTAG port to AVR Dragon |
analog in 7 | TDI | 9 | Input | Test Data Input, data signal from AVR Dragon to target JTAG port |
reset | RST | 6 | Reset |
Note: These pin numbers refer to the shield pin numbers of the Arduino Mega2560 and not to the pins on the processor. Note: Although the +5v are joined, you will still need to provide power to your Mega board by any of the normal methods. The sole purpose of the +5v connection is to correctly configure the level shifters/converts used by the Dragon to process signals between the boards. If you are using a 3.3v Dragon, then it is important that you connect the +5v signal to the +3.3v signal instead. Otherwise there is a pretty good chance you will destroy your Mega in a few seconds. This signal can not power the Mega from the Dragon!
Note: Power up your Mega board before the Dragon.
Note: Make sure there are no other connections to pine 4, 5, 6 or 7 on the Mega, other than those to the Dragon.