ATmega324PB Xplained Pro - how to re-enable JTAG using ISP

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

Hi all,

 

I am hoping someone can suggest a solution to my problem...

 

I have firmware written and tested for the ATmega328PB, but due to lack of availability, decided to investigate how simple it would be to port the code to ATmega324PB (probably very easy, I would think, given their similarities). So I got a ATmega324PB Xplained Pro, and recompiled the project for that target hardware. I programmed the ATmega324PB using my Atmel ICE via the JTAG port on the Xplained board. So far so good.

 

I have debug printing out a USART, and it was gibberish - no surprise. I had to go in and change some fuse settings to accommodate the board differences (use internal RC oscillator, disable brownout, etc.). When I went to save fuse settings, it warned me that SPI was being disabled. The 324PB has no option for SPI programming, as far as I know, so should not be a concern... however, since I am new to the 324PB, I decided to play it safe, and change the settings to avoid the warning. Big mistake. I had checked both JTAGEN and SPIEN, and this time when I saved, the warning did not appear.

 

From this point on, I could not talk to the ATmega324PB. Not through my Atmel ICE, and not through the built-in EDBG. When I try, the error message appears:

 

   No JTAG devices detected. Debugger command Activate physical failed.

 

   Unable to enter programming mode. Verify device selection, interface settings,

   target power, security bit, and connections to the target device.

 

One point of interest... the previously loaded firmware still runs, and on startup, it reads and prints the fuse settings. I can see that the values are:

 

LO = 0x62

HI = 0xD8

EX = 0xF7

 

This means that SPIEN is programmed (0) and JTAGEN is not. Somehow, JTAG got deselected (not by me!), perhaps because it is mutually exclusive with SPIEN?

 

In any case, I am now stuck... I cannot program this device.

 

Another strange thing... the Device Programming interface in Atmel Studio allows me to choose wither JTAG or SPI, which I find odd, since SPI is not an option for this chip.

So it seems that Atmel Studio leads to a bricked device with no way to recover.

(or maybe there is a way...I wonder if HVPP is an option here... I have never used it before).

 

Thanks for any help,

Garth

 

This topic has a solution.

Last Edited: Tue. Aug 1, 2017 - 04:43 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

SPI is not an option for this chip

 

You mean ISP? I would find it very hard to believe that ISP in not available unless no header was provided.

 

Do you have a manual for the M324PB Xplained board?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

So I can't see an SPI header on the board

 

 

 

but the chip itself has ISP, you may just need to find which header they come out of and use the squid cable to connect to it.

 

 

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Wow, thanks for the quick reply, js!

If you are right (and I think you are) that would be awesome. I will give that a try... I was looking in the manual for ISP, and it is mentioned just once, with no details, which gave me the impression it was not really supported.

It also seemed strange to me if SPI programming was not supported, and now I see that it looks like it is. BTW, I spent a fair while looking around a lot for this info... but obviously not in the right places!

Thanks for the assistance.

Garth

 

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

Hi js,

 

Just a quick update... after connecting up the SPI wires (including manually holding the RESET line to a pin of the RESET button, the only place I could find it exposed on the Eval board), I was able to reprogram the fuses, and restore JTAG communications to the MCU.

 

Thanks again for your help! If you are ever in the Vancouver BC area, I will buy you a beer! :)

 

Last Edited: Tue. Aug 1, 2017 - 04:44 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you are ever in the Vancouver BC area, I will buy you a beer! :)

If I will ever be rich enough to do that I'll buy you a beer. wink Some friends are just back from several weeks in Canada and US but I can't see that happening to me anytime soon.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

 I can't see that happening to me anytime soon.

 

What, no world tour to sign autographs!

(Perhaps that counts as a cross-post <smirk>)

 

JC