JTAG Connection/Programming Problem

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

I've just put together a prototype board using an ATMega644 and was able to program it once with my JTAG MKII. After programming it, I was trying to connect to it to modify the fuses to work with an external crystal. The JTAG MKII will not connect anymore to do this... and if I try to program again it will not connect either. Basically no attempt at connecting works anymore... even though it initially allowed me to program the device including EEPROM. I have it set to use the external reset and am holding external reset low during connect... I've done this several times in the past now with almost identical board layouts. This was just a slightly modified board that I spent all weekend putting together and now won't let me program it again?@? It just asks if I want to switch to SPI instead, and I tell it no... then it asks if I want external reset enabled... I tell it yes and am holding the reset pin to ground... as I've done many times in the past... but it will no longer connect. I've tried to erase the chip and it won't do that without connecting either... I'm totally at a loss at this point.

Does anyone have any ideas? If I was never able to connect, I'd assume maybe I just have something wired wrong... but it allowed me to program it one time... and then just never again. My code disables JTAG in its initialization... could the connection not be working because of this? I'm thinking maybe I should've changed the crystal fuse settings to not do the divide by 8 and tell it I'm using a 16 Mhz crystal before loading my program? But now that I've loaded the program first seem to be stuck with my JTAG no longer connecting no matter what I do...

Thanks,
James

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

Quote:
I have it set to use the external reset and am holding external reset low during connect... My code disables JTAG in its initialization...

You SHOULD NOT hold down the reset pin, let the programmer do it's thing. I'm assuming that the reset pin is in fact going to the JTAG header??

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

It doesn't work that way either... I just tried manually holding reset to ground to be sure. The code I was able to load starts timers running (assuming a clock speed of 16 Mhz) and disables JTAG by setting the JTD bit twice in its initialization. I'm just wondering if because I downloaded the program first... before changing the clockspeed related fuse bits, i.e. do not divide by 8, and choosing the 16 Mhz option at the bottom... I'm now having these problems? I think I've always done it in that order in the past (change fuse bits first, then download program) but never knew that it mattered... so this time just did the program first arbitrarily. Could this be my problem? And if so, is there anything I can do to fix it? It just gives me the "device not found" error, asks if I want to try connecting with SPI (which I've never done before & am not sure how to do it) asks if I want external reset enabled, I tell it yes, and then it still can't connect. I thought maybe if I erase the chip & start over might have better luck, but it won't perform the erase because it says it cannot connect to device. Why would I have been able to load my code once & then never again? I've done this with several other boards (previous designs) & never had such problems until now... Also, I never changed *anything* about my setup between the time it let me program it once & then never again. I'm beginning to wonder if I should try to just remove the ATMega644 and replace it with a new one... and then be sure to program the fuse bits first before loading the program since there does not seem to be a way to erase the chip now or do anything with it...

- James

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

You've lost me a whole bunch about "that way". If you are "manually holding reset to ground" no code you load will be running, so it can't disable JTAG or anything else.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Sorry if my previous posts were confusing...

In a nutshell, I put together a board using the ATMega644... was able to program it with JTAGIce MKII using JTAG one time. Then I attempted to modify fuse bits to change clock speed settings and could not connect. I now can no longer connect no matter what I try... I just tried connecting to ISP pins and that fails also... Since I had no problem connecting initially, I thought my problems now must be related to the program I loaded. I set the JTD bit in my code, but if, like you say, holding the reset to ground should prevent code from running, that shouldn't be a problem? Is it necessary to first program fuses correctly BEFORE loading code? I loaded code and THEN tried to program fuses and am now totally shut out from any further connections...

- James

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

I just found the problem......

The trace I soldered to the AVR's reset pin was not done very well... I added solder to it & now it connects fine. I think the thing that really threw me off was the fact that it all worked fine the first time... which made me think my hardware was fine... so I was no longer even looking closely at the wiring connections, etc... Anyway, that was the problem. Thanks for you guys responses...

- James