Unable to properly program 324PAs but 324PBs work

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

So I have a custom PCB which was designed for the ATMega324PA that I'm trying to troubleshoot. When we populate the board with the 324PB chip, it is proogrammed and behaves properly. However, when we put in the 324PA, the programmer cannot verify the flash. It sometimes gets as far as address 0x1954 (which is 6484 out of ~11 000 bytes total) but will fail randomly along the Flash. 

 

As far as I know, the only difference in the hook ups for the PA and the PB is the need for extra filtering capacitors on the two additional Vcc and GND lines. W have those capacitors, but the PB chips all work and the PA chips don't. Maybe this specific behavior is known and you guys can quickly tell me precisely how I am being an idiot tody. Or maybe not, in which case I guess we wait the 26 week lead time for 324PBs, because circuit boards are voodoo to me. 

 

Thanks in advance!

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

If the 'PA are "virgin", then perhaps your ISP speed is borderline too fast?

 

I don't know if there is a migration app note for the 'PB.  I think there is a thread where the 'Freaks discussed the differences when it came out.

 

Are you using ISP, or an ICE, or ???

 

 

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

Using AVR Dragon with JTAG. The slider on the JTAG can't go any slower. 

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

Dunno, then.  Still could be ratty signal lines, I guess.  Grab an ISP and try that?

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

I would like to know where the OP got their hands on Mega 324PB's.....

 

Unless they bought a lot of them.

 

JIm

 

EDIT:

Looks like Digikey has some:

 

https://www.digikey.com/product-...

 

If you want a career with a known path - become an undertaker. Dead people don't sue! - Kartman

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

Last Edited: Mon. Sep 11, 2017 - 07:16 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I got some engineering samples about a year ago. 

 

Curiously your link shows ERROR for availability. 

 

The whole reason we hae to get this working with PAs is the PBs are impossible to get our hands on. 

 

 

 

OK, new update. Our PA chips are programmable in ISP mode but not in JTAG. Thiss is a real bummer because you cannot program the chips in ISP on our current boards (and why would we supply it when we have the perfectly good JTAG interface?.........)

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

Jtag fuse not programmed?

Jim

If you want a career with a known path - become an undertaker. Dead people don't sue! - Kartman

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

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

That would be a neat trick, to get the JTAG to work partially with the JTAG fuse disabled. 

 

The JTAG is enabled. I now have a minimal setup of a 324PA on a 44pin DIP breakout board. With nothing other than the breakout board being jumpered to the Dragon, and using the Dragon for power, I am able to program using the ISP interface but not the JTAG interface. A PB on the exact same breakout in the exact same breadboard with the exact same binary works with both. 

 

WHY?!?!?!?!?!?! 

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

and Mouser in QFN

http://www.avrfreaks.net/forum/mega324pb-tough-find-split-mega328pb-thread#comment-2237886

Yesterday's lead time report from microchipDIRECT states 17-Dec-2017 for QFP.

 

Edit : URL

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Mon. Sep 11, 2017 - 09:16 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

dtreth@gmail.com wrote:
Dragon, and using the Dragon for power,

 

The Dragon cannot power a target! 

 

Use a proper power supply for your target and proper connections from teh dragon to the target JTAG.

 

JIm

If you want a career with a known path - become an undertaker. Dead people don't sue! - Kartman

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

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

Transparency - I do not operate an AVR Dragon.

AVR Dragon
Introducing AVR Dragon

Overview

http://www.atmel.com/webdoc/avrdragon/avrdragon.Overview.html

...

AVR Dragon is powered by the USB cable, and can also source an external target with up to 300mA (from the VCC connector, 5V) when programming or debugging. For more information on technical details, read the AVR Dragon Requirements section. If the target is already powered by an external power source, the AVR Dragon will adapt and level convert all signals between the target and the AVR Dragon.

Note

If the target board is powered by an external power source, no connection should be made between the VCC connector and the external board.

...

 

"Dare to be naïve." - Buckminster Fuller

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

Was the board designed for a ATMega324PB chip? If so you will be missing about 4 power pins for the ATMega324PA version and it will not like it.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Since when can't the Dragon power a target when that target is a 20mA AT?
And I tried it with everything I owned that could produce 3-5 volts. None mattered.

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

No, it was designed for PA. As stated previously, I have those lines connected.

We have hacked the board to pieces to use SPI and that does work. The PB works with either.

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

Ok so as a matter of interest how long is the JTAG cable? Tools seem not to like anything longer than about 4-6inches (100-150mm)

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

On the chips that work, 2 feet. For my testing I used 3 inch duponts to connect the breakout to the Dragon. The 3 inch duponts didn't work.

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

gchapman wrote:
AVR Dragon is powered by the USB cable, and can also source an external target with up to 300mA (from the VCC connector, 5V) when programming or debugging. F

Provided the USB port can actually handle 500ma...many do not.

 

dtreth@gmail.com wrote:
Since when can't the Dragon power a target when that target is a 20mA AT?

If you search this site there are countless threads about dead dragons because of them being used(attempted to use) them as power sources.  It was a DUMB, STUPID, LAME idea from the vendor formerly known as Atmel to offer the idea of the Dragon being able to source the target.

 

dtreth@gmail.com wrote:
And I tried it with everything I owned that could produce 3-5 volts. None mattered.

THen take a step back and re-evaluate your entire setup.  Draw a schematic of everything...capacitors, resisters, inductors connections etc. and post it here for us to review.

 

JIm

If you want a career with a known path - become an undertaker. Dead people don't sue! - Kartman

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

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

Ok, so I would and did only use the Dragon power when I have a bare chip in order to reduce all sources of issues. Regardless, it's clearly not the problem so let's forget I mentioned it.

I can't give you the schematics for our proprietary board, but I'll upload a schematic of my test setup soon. It's literally just vcc and ground, plus filter caps, and the JTAG.

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

On the chips that work, 2 feet.

surprise I vaguely remember having a similar problem years ago, Atmel could not give me any answers. A short (~4") cable fixed things.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Ok, but if you read the line that you quoted you'd realize that doesn't really apply here. The ones that WORK work just fine with the long cable. The ones that won't work don't work with 3" connections.

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

theusch wrote:
I don't know if there is a migration app note for the 'PB.

Microchip Technology Inc

Microchip

AVR42769: Differences Between ATmega324 and ATmega324PB

http://www.microchip.com//wwwAppNotes/AppNotes.aspx?appnote=en591045

via http://www.microchip.com/wwwproducts/en/atmega324pb

 

"Dare to be naïve." - Buckminster Fuller

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

Thanks! It really is a great chip, if you can get your hands on it.

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

The ones that WORK work just fine

But it is NOT a PA chip, I had the problem with a M164 (edited) chip, others worked OK, I used to have ~250mm leads before this happened.

 

That's all I can contribute.

 

And this was my email to Atmel 9/06/2007, the problem was with a M164

 

At 10:29 PM 8/06/2007, you wrote:

test the dragon by putting the device in STK500 and
connect the STK500 to dragon JTAG connector.

As I didn't have a JTAG connector on the STK500 I decided to
wire up the M164 to the Dragon's zif socket with the JTAG
connection and to my surprise it WORKED!!

I then went back to my board and stripped it down to the bare minimum
but nothing I would do would get it to work with the M164 even though
it works with the M32.

 

As a last resort I changed the JATG cable and all of a sudden it worked,
tried another cable and it work MOST of the times but not all the time.

 

So it seems that the LENGTH of the 10 way ribbon cable is causing all the
problems, the original cable is about 300mm and it works with the M32 with
both the Dragon and the JTAG MK1 but not with the M164.

 

The second cable that worked MOST of the times is about 200mm.

The cable that seems to work ALL the times is only 150mm.

 

So the first thing you would have to suggest anyone with a similar problem
is to use a shorter cable perhaps. :'(

 

I will post my findings on avrfreaks, hopefully someone will be spared the
pain and headache I have been going through for the past 2 weeks.

 

Thank you very much for your help.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

Last Edited: Mon. Sep 11, 2017 - 10:28 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok, and I'm not trying to sound ungrateful. But I thought I was clear that my shortest 3" leads didn't help.

EDIT: 3" is ~75mm

Last Edited: Mon. Sep 11, 2017 - 10:48 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I got some engineering samples about a year ago. 

So, I might suggest you try with some current version chips.

 

I still recall some subtle differences with some pre-release XmegaE5 series chips.

An issue or two, (one of which involved the PDI programming interface, as a matter of fact), suddenly disappeared when using the production model chips a version or two post-release.

 

JC 

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

from the current datasheet :

(page 437)

37. Errata
37.1  Rev.A-H
Rev. A to H are not sampled.
37.2  Rev. I
Sampled. Not released in production.
37.3  Rev. J - K

(PTC malfunction when enter sleep mode)

An assumption is rev I is on the mega324PB Xplained Pro.

 

http://www.microchip.com/wwwproducts/en/atmega324pb

 

"Dare to be naïve." - Buckminster Fuller

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

Well, the engineering samples are the ones that are working. The PAs are real production chips from I wanna say Mouser.

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

OK I have a schematic of my test setup in which I can program a 324PB but not the 324PA. There's some contention in the office over whether or not the 644PAs work, because we only tried one, before we had any idea of what was happening. 

Last Edited: Wed. Sep 13, 2017 - 02:20 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"All caps 100pf"; assume that's a typo and should be 100nF.

Should be a bulk cap for mega324PB VCC (pin 5)

mega324PB pin 17 is SPI1 / UART2 / PTC

mega324PB pin 18 is SPI1 / UART2 / PTC

mega324PB pin 38 is SDA1

mega324PB pin 39 is SCL1

(dual pin 22 in picture) mega324PB pin 22 is JTAG TMS

mega324PB pin 24 is JTAG TDI

 

Did not compare mega324PA and mega324PB pinouts; should there be separate schematics?

 

"Dare to be naïve." - Buckminster Fuller

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

Damn, you got me. I typo'd those two. The PB is backward compatible with the PA. In the PA those lines are additional Vcc's and Grounds. 

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

Alright, I feel that I have to reply to this with the resolution. Turns out when I said 4" leads, we were actually using 6" leads. (My boss and i have differing definitions of "the short leads" apparently) I tried it with the 4" leads, and IT WORKS. IT WORKS! And I remember what oxygen tastes like. 

Thanks for your general help and specific guidance, as applicable. I made the tiniest JTAG ribbon cable I could manage and have been programming them like mad.

 

I'm also going to buy those 324PBs and get new boards designed for both chip sizes. 

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

Well done!

dtreth@gmail.com wrote:
I tried it with the 4" leads, and IT WORKS. IT WORKS!
DragonLair has series termination of 100R (better impedance match)

http://www.aplomb.nl/TechStuff/Dragon/Dragon.html (after mid-page for the schematic)

or local : http://www.avrfreaks.net/sites/default/files/DragonLair.sch.png

Same except for XMEGA PDI :

http://www.avrfreaks.net/forum/dragon-and-xmega32e5-difficulties-solved

 


https://oshpark.com/shared_projects (Dragon has 6 hits)

 

"Dare to be naïve." - Buckminster Fuller

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

I tried it with the 4" leads, and IT WORKS.

hmmm maybe someone should have told you this 3 days ago. wink

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Hmmm, something sounds very marginal there. I'd still be looking for a problem if such a small change makes such a big difference.

 

[Yes, I know that 6" down to 4" is a 33% decrease but in real terms that's a drop of just 2.5pF, 25nH and 0.25ns.]

'This forum helps those who help themselves.'

 

pragmatic  adjective dealing with things sensibly and realistically in a way that is based on practical rather than theoretical consideration.

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

Hmmm, something sounds very marginal there.

In the Dragon or the chips not on our boards, the same problem occurred more than 10 years ago with chips of the same family and the Dragon, other problems were also experienced with other programming mode like PDI from memory.

 

As I said before: Dragons are wimps. wink

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly