diff --git a/boards/microduino-corerf/doc.txt b/boards/microduino-corerf/doc.txt index 2c6fc8a476..ab371fad21 100644 --- a/boards/microduino-corerf/doc.txt +++ b/boards/microduino-corerf/doc.txt @@ -100,4 +100,74 @@ as system clock source. More pins can be used for hardware interrupts using the Pin Change Interrupt feature. See @ref boards_common_atmega for details. +## Debugging +The ATmega128RFR1 supports JTAG debugging. To use the JTAG debugging an external +JTAG debugger is required. There are several options for this MCU/board: + +* [AVR JTAGICE mkII](http://www.atmel.com/tools/avrjtagicemkii.aspx) +* [JTAGICE3](http://www.atmel.com/tools/jtagice3.aspx) +* [AVR Dragon](http://www.atmel.com/tools/avrdragon.aspx) + +Hint: The AVR Dragon is the ~~cheapest~~ least expensive debugger and also is +compatible with almost every AVR MCU. + +@warning With the default fuse settings, on chip debugging is disabled. + +@note If you are using a different debugger than the AVR Dragon, you have + to export the `AVR_DEBUGDEVICE` environment variable to the required + flag to pass to AVaRICE, e.g. when using the Atmel-ICE you have to + export `AVR_DEBUGDEVICE=--edbg`. If the debug device is not + connected via USB, you also need to export `AVR_DEBUGINTERFACE` to + the correct value. + + +### JTAG Pin Mapping + +| Pin | Pin Label | Signal | AVR Dragon Pin | +|:------|:----------|:----------|:------------------| +| PF7 | A0 | TDI | JTAG-9 | +| PF6 | A1 | TDO | JTAG-3 | +| PF5 | A2 | TMS | JTAG-5 | +| PF4 | A3 | TCK | JTAG-1 | +| VDD | 3V3 | VTG | JTAG-4 | +| GND | GND | GND | JTAG-2 | + +### Fuse Settings + +Be aware that changing the fuse settings can "brick" your MCU, e.g. if you +select a different clock setting that is not available on your board. Or if +you disable all options for programming the MCU. + +You can always de-brick your MCU using high voltage programming mode, which can +also be done using the AVR Dragon. But being careful to not brick your MCU in +the first place is clearly the better option ;-) + +In the following it is assumed that you connect the Dragon ISP header to the +Microduino CoreRF for ISP programming. + +#### Default Fuse Settings + +The default fuse settings of the Microduino CoreRF are: `E:F5, H:DA, L:FF`. +These settings can be restored via from the OCD settings via: + +``` +avrdude -c dragon_isp -p m128rfa1 -U hfuse:w:0xda:m +``` + +If you touched other fuse settings, you can restore the fuse settings using: + +``` +avrdude -c dragon_isp -p m128rfa1 -U efuse:w:0xf5:m -U hfuse:w:0xda:m -U lfuse:w:0xff:m +``` + +### On-Chip Debugging Fuse Settings + +To enable on-chip debugging, the `JTAGEN` (enable JTAG) and the `OCDEN` (enable +on-chip debugging) bits should be set: `E:F5, H:1A, L:FF`. This can be done +(when starting with the default settings) via: + +``` +avrdude -c dragon_isp -p m128rfa1 -U hfuse:w:0x1a:m +``` + */