JTAGICE debugger issue

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

Hello everyone, I am trying to connect the Mini AVR JTAG ICE Debugger to my development board but I am getting the error

Quote:
The OCD JTAG adapter was detected, but there is no target power. Apply power to the target application or target device and click retry. Click cancel to try to connect to another port. Retry or Cancel.

The power led on my board lights up and the program I wrote that turns on various LEDs works fine. Yet, I get the error above.

I am using Atmel Studio 4.18 in this case. It says in the ad

Quote:
Works with AVR Studio 4.12/4.14/4.16/4.17/4.18

I'm assuming it uses the same firmware for all 5 versions?
Does anyone know what could be the problem? I've tried powering my development board with just the JTAG debugger, I've also tried removing the jumper from the JTAG debugger that enables it to power the board and adding external power. In both cases I get the same error.

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

You haven't really identified what debugger you are talking about but if it's a clone of one of the Atmel ones then note it will not power the target board but it does have a VTG (Voltage target) pin in the header that must be connected as the ICE uses this to sense the target voltage and adapt for 3.3V/5V conversion if necessary. Perhaps your debugger is also like this? If so then maybe you haven't got VTG present?

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

The first step is identifying your hardware. e.g. a link to Ebay or shop that shows a photo of your device.

Then you connect pins 2, 4 to GND, VCC and 1, 3, 5, 9 to JTAG of the target.

In Studio 4.19 choose
Tools->Program AVR->Connect

If this fails, connect pin #6 (nRST) to RESET on your AVR.
Alternatively, erase the chip via ISP. (you may have a program running that uses JTD)

If you still have a problem, write down each step and number it. Then post the result of each numbered step.

Most JTAGICE-1 clones do not provide power. If yours does, it will probably be on pin#7. Without you telling us which clone you have, no-one can help much.

David.

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

Quote:
In Studio 4.19 choose
Tools->Program AVR->Connect

I tried that and that is when I get the error.

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

I'll try erasing the chip with my ISP programmer. What is JTD?

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

Quote:

What is JTD?

JTAG Disable. An AVR aplication can disable JTAG at runtime. Thus, regardless of the JTAG Enable use, the cip running an app can have disabled JTAG. It follows that JTAG can not be used for anything while this situation lasts.

The (reasonable) options in this case are

- Use high-voltage programming to erase the chip
- Use ISP to erase the chip

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

How do I erase a chip using AVRdude in the command line? ATMega32 chip usbasp programmer.

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

No you don't. Using the nRST pin will enable you to connect regardless of JTD.

Neither of your links have got a manual.
Did it come with a manual?

Seriously. Spend 10 minutes of your life describing exactly what you have connected and number each step.

You will get a solution within minutes.

David.

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

david.prentice wrote:

Neither of your links have got a manual.
Did it come with a manual?

No, the debugger did not come with a manual. I only have a manual for my development board. I will post the steps. Here is the schematic of my development board:
http://www.divshare.com/download...

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

Your dev board does not connect pin#6 of the JTAG header.

It also seems to connect both pin#4 and pin#7 to VCC.

I am impressed by the use of upward-pointing GND symbols. Surely they must put your board at risk from lightning strike !

Is this common in Aussie and Far Eastern schematics?

Although I have no manual, I can 'guess' that your board has got PL2303, mega16, 74HC244. i.e. USB chip, AVR, level-shifter chip. And J2 probably supplies power to pin#7. There might be another unpopulated jumper for updating the firmware. Since there will never be any new firmware from Atmel, there is not much point in populating.

So everything should work perfectly out of the box.

David.

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

Here are the steps:

Attachment(s): 

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

More steps:

Attachment(s): 

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

Maybe my Baud rate is wrong? What should it be set to? Maybe out of the box it works with Atmel Studio 4.14? I'm trying to get it to work on 4.18.

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

First off. Have you got J2 open and the AVR pcb externally powered?

By steps, I mean things like:
1. remove J2
2. Connect 10-way ribbon
3. plug in JTAGICE to USB
4. apply power to dev board
5. start AS4.19 and select:Tools->Program AVR->Connect
6. Select JTAGICE and COM3 and 115200 baud.
7. ...

I really don't want to know about the Prolific. Just that you installed the driver and that it is recognised as COM3.

The importance of the numbered steps is :
I or someone can advise doing (4) before (3) or whatever.
It also means that we can reproduce your steps.

Sometimes screenshots are useful. Clear descriptions of your wires and order of steps is more important. Since you have a dev board, we can assume that it is soldered correctly and you have proper capacitors and headers.

Of course, a clear photo of your wiring does no harm. It is essential when you use a breadboard or home-made pcb.

I can assure you that JTAGICE-1 clones work fine. My one uses FTDI and is on COM8 for this laptop.
PL2303 and COM3 should work exactly the same.

Since all we have is Ebay photos, you could possibly tell us what J2 actually does. Is there a J1 or J3 ? What chip is used for the level-converter...

In the process, it will help all the other owners of this Ebay device.

David.

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

Quote:
My one uses FTDI and is on COM8 for this laptop.

My one uses ATMega16U2 running USBtoSerial and is on COM1 8)

AFAIR the ASes are picky and do not give descriptive feedback when something fails so perhaps try it with avrdude or avarice. AFAIK none of those complain about improper voltage.

Or take some raw ATMega16 and wire Mk1 on a breadboard instead of resuscitating the corpse.

No RSTDISBL, no fun!

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

Brutte wrote:
try it with avrdude or avarice.

Do you know of any tutorials or would you perhaps be willing to write one on how to install and use AVARICE, DDD, and AVR-GDB? I don't have that much experience with Linux.

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

Quote:
Do you know of any tutorials

www.lmgtfy.com

No RSTDISBL, no fun!

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

Could someone please look at the schematic and tell me what is the correct polarity for power? It says POWER in blue a it says VCC 1 and 2 is ground. They use some symbols I am unfamiliar with. Vcc is a square connected to a rectangle and GND is something like two triangles and a rectangle.

Attachment(s): 

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

That is most likely a "barrel" power connector, found on most low-voltage appliances and boards (before the move to micro-USB connectors for charging and powering e.. cell phones.

Not sure which one is the tip and which is the pin part though.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

The barrel is -ve and the tip is +ve.
Your diagram implies that there is a switch that opens when you insert the "barrel" power connector.

In your schematic, the switch is not going to do anything. It probably has a terminal #3 that is not shown.

Have you got your JTAGICE-1 working properly in AS4.19 yet?

I can assure you that the JTAGICE-1 clones work just fine.

David.

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

Quote:

Your diagram implies that there is a switch that opens when you insert the "barrel" power connector.

In your schematic, the switch is not going to do anything. It probably has a terminal #3 that is not shown.


FWIW that is exactly how I read it. Assume pin 2 is the terminal with a V shape. The terminal with an arrow is not numbered in the schematics - I will number it 3.

When a plug is absent terminal 2 and 3 are in contact. In this situation the system can be supplied by e.g. a battery with its (-) on terminal 3, that goes into terminal 2 that is the GND supply terminal proper.

When a plug is present its barrel pushes terminal 2 off terminal 3. The barrel of the plug now suples the system and the battery (-) is not connected since terminal 3 is not in contact with terminal 2.

[Caveat Emptor: I hope I got all the barrels, tips and polarities rigt..]

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

Thank you david.prentice, the polarity is correct. So, I've tried powering the development board via, debugger, seperate USB cable that is exclusively there to power the board, and external DC power adapter. In all three cases I get the voltage error I wrote about.
Steps:
1. Connect 10 pin ribbon to dev board.
2. Connect external power to barrel jack.
3. Plug debugger into PC USB slot.(Onboard jumper that selects debugger power or external power is removed, it is the only jumper on the debugger)
4. While the debugger starts up the power led and the leds on porta on my dev board light up as if I was powering the board through the debugger. A led flashes on the debugger. This lasts about 5 seconds. Once the led stops flashing the power to the board cuts out. I'm assuming the debugger has to initialize and check if the jumper is present or not. I'm also assuming the default is to act as if the jumper is present until it discovers the jumper has been removed. Once it realizes there is no jumper the power led and the leds on porta turn off.
5. I turn on the switch on my dev board for external dc power.
6. I go to program AS.
7. Select JTAGICE COM3.
8. I get the error.

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

Do (5) before (3)
Then press reset switch on dev board.
Then try Connect.

Studio can be a bit fussy about the order of power-up of your AVR and the USB.

David.

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

david.prentice wrote:
Do (5) before (3)

Won't that destroy my board since the dc power will be on and the debugger will also power the board for the first five seconds regardless if the debugger power jumper is present or removed? So two sources of power at the same time. Maybe I should do as you say but leave the ribbon cable unplugged, plug the debugger into the USB slot, and after five seconds, once the debugger has initialized and realized there isn't a power jumper present, plug the ribbon cable into the dev board?

Edit: I tried turning on the external power and then plugging the jtag ribbon cable into the dev board. I plugged the debugger into the usb slot of my pc and let it initialize first before those two steps. I still get the error. I've tried a shorter ribbon cable too, no change.

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

I have no idea how your debugger 'power' works. I can only guess that your jumper simply connects 5V to pin#7.

It does not take much effort on your part to see for yourself. Even better if you reveal the answer to the rest of the world.

In practice, you often have boards with interconnecting ribbon cables. I am suggesting that you power-up in different orders. e.g. simultaneous, USB first, dev first.

You can achieve 'simultaneous' by removing external power from your dev board, and supplying power via the USB JTAG jumper.

Providing your dev board does not present a heavy load, there is no problem with it receiving power from your JTAG dongle i.e. PC's USB power.

OTOH, I often run AVRs at 3.3V. If your dongle only supplies 5V, it is not possible to use dongle power.

You just need to apply common sense to 'connections'. e.g. I would not connect a PC directly to a noisy 440VAC motor.

David.

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

Maybe the firmware that came with my debugger is for AS 4.12 and is not compatible with AS 4.18? Can I please get a link to AS 4.12? I can't find it.

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

Oldest you can get from Atmel is 4.13: http://www.atmel.com/tools/STUDI...

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

4.12 is included in the januari -13 Technical Library DVD.

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

Quote:

4.12 is included in the januari -13 Technical Library DVD.

which can be found here: http://www.atmel.no/techlib/

Start the download right away - it will take an hour or a few.. Make sure you have enough disk space free. The ZIP of the ISO is almost 7 GB..

Also, while downloading TechLib, prepare some virtual CD/DVD/ISO software if you do not have this installed already. E.g. Daemon Tools (there might be better alternatives out there now, but DT is what I am used to since sometime in the dark ages..).

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

Last Edited: Fri. Nov 1, 2013 - 11:46 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AFIK, the JTAGICE-1 firmware has been unchanged for years. e.g. Hardware revision:0xC1 SW major:0x80 SW minor:0x00

If your board has no 'upgrade' jumper, you won't be able to upgrade anyway. Mind you, these Chinese clones only started appearing about 5 years ago. Well after 0xC1:0x80:0x00 was released.

You seem remarkably reluctant to say what is on your dongle.

Or even to run the command line programs:

jtagice -cCOM3 -dATmega32 -s

Unfortunately, jtagice.exe does not report the HW, SW versions.

You could use avrdude:

avrdude -cjtag1 -Pcom3 -pATmega32 -v

This will tell you hardware and firmware versions.

David.

p.s. I strongly advise you not to go for obsolete AS4.12 or AS4.13. It will crash with modern avr-gcc ELF files.

Getting out a maginifying glass and pencil and paper is far better use of your time. i.e. reveal what is on your pcb.

You could even compare it with published jtagice-1 schematics.

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

My dongle consists of:

1 x Texas instruments 15 E60YK64 HC244
1 x ATMega 16a 1308
1 x PL-2303HK LF13313A
1 x 7.3728 MHz crystal oscillator
1 x 12.000 MHz crystal oscillator
1 x jumper

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

david.prentice wrote:

You could use avrdude:

avrdude -cjtag1 -Pcom3 -pATmega32 -v

This is the output:
Note: I used an ATmega16 this time.

avrdude: Version 5.10, compiled on Jan 19 2010 at 10:45:23
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\WinAVR-20100110\bin\avrdude.conf"


         Using Port                    : com4
         Using Programmer              : jtag1
         AVR Part                      : ATMEGA16
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page
      Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           eeprom         4    10   128    0 no        512    4      0  9000  90
00 0xff 0xff
           flash         33     6   128    0 yes     16384  128    128  4500  45
00 0xff 0xff
           lock           0     0     0    0 no          1    0      0  9000  90
00 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  90
00 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  90
00 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0
 0 0x00 0x00
           calibration    0     0     0    0 no          4    0      0     0
 0 0x00 0x00

         Programmer Type : JTAGMKI
         Description     : Atmel JTAG ICE (mkI)
         ICE hardware version: 0xc3
         ICE firmware version: 0x80
         Vtarget         : 0.0 V
         JTAG clock      : 1 MHz (1.0 us)

avrdude: jtagmkI_initialize(): warning: OCDEN fuse not programmed, single-byte E
EPROM updates not possible
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e9403
avrdude: safemode: lfuse reads as 9F
avrdude: safemode: hfuse reads as 99

avrdude: safemode: lfuse reads as 9F
avrdude: safemode: hfuse reads as 99
avrdude: safemode: Fuses OK

avrdude done.  Thank you.
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My crystal ball is pretty good.

I did not even google for the schematic !

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

david.prentice wrote:
My crystal ball is pretty good.

I did not even google for the schematic !

Yes, you obviously have a lot of experience.

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

Hmm

Vtarget: 0.0 V 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So are you running ok with AS4.19 now ?

We both have the 'current' firmware: 0x80
My clone is a "ET-AVR JTAG USB V1.0"

I doubt if the hardware 0xC3 or 0xC1 means anything.
Mind you, my clone will work with a 3.3V target but it does not actually read Vtgt properly. It always says 5.0V.

If your dev board can run at 3.3V, you can see what AS4.19 reads for the target voltage. If avrdude says 0.0V, I doubt that your clone reads it properly either.

David.

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

No, AS still brings up the target voltage error. I tried 3.3V, it doesn't bring up the target voltage error just says connect failed on top and asks me to select the programmer again. VTarget in avrdude is 0v evem when the dev board is set to 3.3v.

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

Have you actually measured the voltage on pin #4, #7 of the JTAG header?

Have you tried clicking 'Connect' with the dev board RESET button held down?

At least you know that avrdude can talk to your dongle.

Both the IAR C-SPY and Rowley Crossworks can talk to a JTAGICE-1. Mind you, I would persevere with AS4.19 first.

David.

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

Yes, I just tried clicking connect with the dev board reset button held down. Same error. How would I measure the voltage of pins 4 and 7? Have the dongle plugged in and everything powered up and then measure from the underside? On which pin would I put + and and on which negative? Or so I measure the pins in the header with board powered up and the ribbon cable removed?

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

david.prentice wrote:

At least you know that avrdude can talk to your dongle.

Yes, that is at least a sign of "life".

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

In my world you put the black probe of your multimeter on what you believe to be "Ground" and the red probe on the signal that you want to measure. Is this not a universal truth?

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

clawson wrote:
In my world you put the black probe of your multimeter on what you believe to be "Ground" and the red probe on the signal that you want to measure. Is this not a universal truth?

Which is ground pin 4 or pin 7 is the signal pin 4 or pin 7?

ps. Welcome to Earth, hope you enjoy your stay.

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

According to the schematic both pins 4 and pin 7 and vcc.

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

Well I was going to say that Atmel's standard 10 pin JTAG header was on this page in one of their user manuals:

http://www.atmel.no/webdoc/jtagi...

But I hope your browser does a better job of rendering that page than mine (I suspect the content was authored with Microsoft tools so is probably slugged to only display correctly in a Microsoft browser!)

EDIT: nope it's a dog's breakfast in IE8 too :-(

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

I see what you mean about crap webpage (as rendered by FireFox)

Yes, I would physically inspect the pcb traces to pins #4, #7. And measure the voltages that I find there at both the dongle end and the devboard end.

I would have 100% confidence in the Chinese $8.95 dongle. My ETT clone has a case and cost about $35 several years ago. But it works fine (obviously for a limited range of AVRs)

The dongle should work fine with Studio 4.19, C-SPY and CrossWorks.
It should also work fine in Linux with CrossWorks.

I would guess that there will be several readers that own and use this dongle.

David.

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

It's all right everyone. Thank you for helping me. I've got access to a debugger that I know works in AS 6 so I'll be using that when I can. I was hoping that this one would be a cheap solution. I do want to explore other IDEs and AVARICE, DDD, AVRGDB and so on but I'll have to do that some other time.