ATxmega256 can't connect with JTAG

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello all!

1. Background.

I am a complete novice to microcontrollers, do not judge me strictly.

Recently purchased several ATxmega256A3U-AU and debugger AVR-JTAG-USB from Olimex:  https://www.olimex.com/Products/...

Circuit diagram:

(Yes, I know that VCC, AVCC needs LC filters, additional capacitors and voltage regulator IC)

 

Connected this board to a 3.3V laboratory power supply. I didn't program the MCU and decided to just connect to it through JTAG.

Installed FTDI driver for the debugger device and it is defined in Windows 7 as a USB Serial Port (COM3). I installed AVR Studio 4.19 and tried to connect to the MCU.

(In the "Select AVR Programmer" dialog, selected "JTAG ICE" Platform and "Auto" Port).

 

2. Description of the problem.

After clicking "Connect", an error appears:

 

I tried different settings in the dialog "Select AVR Programmer" and FTDI driver but it didn't help.

I am sure that the MCU is working and sends data to the device through the JTAG.TDO port (Checked this with an oscilloscope by disconnecting the MCU.PB7 pin from JTAG.TDO contact).

I recorded a oscillogram of all data pins of JTAG connector:

TCK 010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
TMS 111111111110011110000000000111111000000000000000000000000000000000000000000000000000000000000000000111111
TDI 000000000000000000000110000000000000011110000000000000000110011111100110000110000000000000000000000000000
TDO 111111111111111111111100000011111111000000110011001100111111110011111100000000000000000000000000111111111

NSRST/RESET

Inverse of "Activate target device external reset upon connect" checkbox state in the error dialog
NTRST/PDI Always 0

But I'm not sure that decrypting the JTAG protocol will lead me to solve the problem.

 

The description for the debugging device said that it does not support my MCU series. Did I just buy the wrong debugging device?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Welcome to AVRFreaks!

 

Most AVR programmers/debuggers(no familiar with Olimex products)  do not supply target power, so you will need to connect your board to a power source(IIRC xmega need 3.3v) and try again.

Let us know if that works.

 

Jim

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

From the Olimex page you linked to

List of all supported targets: ATmega128, ATmega128L, AT90CAN128, ATmega16, ATmega16L, ATmega162, ATmega162L, ATmega162V, ATmega165, ATmega165V, ATmega169, ATmega169L, ATmega169V, ATmega32, ATmega32L, ATmega323, ATmega323L, ATmega64, ATmega64L

exactly where in that list do you see any mention of Xmega?

 

The fact is that almost 20 years ago Atmel made a debugger called Atmel ICE which could JTAG all the AVRs at that time that had JTAG (list above, most almost 20 years old). Perhaps ill advisedly they published the design and a bunch of companies got on the bandwagon and made clones. So then they brought out JTAGICEmkII and changed the protocol in later AVRs. Because only Atmel's closed firmware in mkII knew the protocol it meant that from that point onwards you had to buy Atmel's ICE. That continued when Xmega came along. While there have been newer debuggers from Atmel: Dragon, JTAGICE3, Atmel-ICE, Snap they've never been open so you can't buy clones from other people like Olimex.

Last Edited: Mon. Jun 15, 2020 - 08:43 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here is what avrdude v6.3 shows:

D:\AVR>avrdude -p x256a3u -c jtag1 -P com3 -U flash:r:"dump.raw":r

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.06s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

avrdude done.  Thank you.

 

Clawson, thanks for the answer! I am novice and just didn't know such details. Okay, I’ll buy another debugger device, but from Atmel.
I am regretting for the lost time only, now I have to wait another 2 weeks until this order is delivered to me =( I needed to carefully read all the descriptions on the manufacturer’s website, and not just in the store.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That's the OLD JTAG Mk1 you need the MK2 for newer chips, 100 times more complicated device and more expensive and no longer made by Atmel.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

For an Xmega these days I'd just get Atmel-ICE or Snap. But sometimes it may be easier to get an "Xplained" board that has an Xmega something like the one you want to use and a matched debugger built onto the board.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

clawson wrote:
get Atmel-ICE or Snap 

+1

 

clawson wrote:
get an "Xplained" board that has an Xmega something like the one you want to use and a matched debugger built onto the board.

Absolutely!

 

Note that, to get the on-board debugger, you need Xplained Pro, Mini, or Nano:

 

https://www.avrfreaks.net/commen...

 

https://www.avrfreaks.net/commen... - with pictures.

 

ATxmega256A3U seems to have only the  old Xplained - so no debugger:

 

 

https://www.microchip.com/DevelopmentTools/ProductDetails/PartNO/ATXMEGAA3BU-XPLD

 

EDIT

 

Also, being an older model, you may face issues using it with current tools:

 

https://www.avrfreaks.net/commen...

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Tue. Jun 16, 2020 - 08:31 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, I already ordered ATATMEL-ICE-PCBA yesterday. It's not clear why, only PCB costs 2 times cheaper. (I have a 3D printer, USB micro-B and JTAG cable, so this isn't a problem).

 

Thanks for suggest of the AVR Xplained board. But I'm interested in making a test board myself.

I have already connected all the MCU pins to the test board and plan to add many peripheral devices (lcd screen, control buttons / knobs, stepper motor drivers, sd card, usb, sensor inputs, actuator control buses, etc.)

When I learn to work with all the necessary peripheral devices, then I will develop a normal PCB and order its manufacture.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jsl4f5jx wrote:
Thanks for suggest of the AVR Xplained board. But I'm interested in making a test board myself.

Indeed, but:

you wrote:
I am a complete novice to microcontrollers

So there is really quite a lot learn before you're ready to do that!

 

See Tip #6 in my signature for some Beginner's Getting Started tips

 

When I learn to work with all the necessary peripheral devices, then I will develop a normal PCB and order its manufacture.

The learning is a whole lot easier when you have a known-working, supported board.

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...