Atmega1280 will not program with ISP programmer

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

I am attempting to program an Atmega1280 using an AVR Dragon programmer through AVR Studio 5.
I have the ISP clock set as low as possible.
My ISP port is wired nearly identical to how the Arduino Mega1280 is wired. http://arduino.cc/en/uploads/Mai...
I have an Arduino Mega2560 that is wired the same way as the Arduino Mega1280 and I am able to talk to it with the AVR dragon programmer.
I have also attempted programming my Atmega1280 with a CableAVR programmer, but still no luck.
I have attempted the programming on two boards containing the 1280's and still no luck.
Any thoughts on what I am missing?
Any chance these chips get shipped with the ISP disabled?

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

Quote:
My ISP port is wired nearly identical to how the Arduino Mega1280 is wired.

Please elaborate.

The mega1280 use pins PB1, PB2, PB3, RST
The mega1281 use pins PB1, PE0, PE1, RST

Since you have a Dragon, it is easier to use JTAG.
Virgin chips all come with SPIEN and JTAGEN.
Virgin chips should communicate fine at 200kHz ISP frequency.

David.

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

What I meant by NEARLY identical is that my board is routed a bit different (the traces aren't layed out the same as the Ardruino 1280)
I am using the Atmega1280.
Ringing the complete connection out with a multimeter I get Pin 1 on the Dragon AVR ISP connector ringing through to pin 22 on the ATMEGA1280. Pin 2 of the ISP is connected to my VCC, which is at 5 volts, and I have verified the presence of 5 volts on pins 10, 31, 61, and 80 on the ATMEGA1280. Pin 3 of the ISP rings through to pin 20 on the ATMEGA1280. Pin4 on the ISP rings through to pin 21 on the ATMEGA1280. Pin5 on the ISP rings through to pin 30 on the atmega1280. Pin 6 is connected to ground and I have verified ground on pins 11, 32, 62, and 81 on the atmega1280.

I compared data sheets for the 1280 to the 2560 and the ISP ports showed to be connected the same. I connected the Dragon AVR to the Ardruino2560, 6-pin ISP to 6-pin ISP, connected one to one, and double checked that connection(which I was able to communicate through with the Dragon AVR) and rung it out the same way I did my ATMEGA1280 circuit and it rang out the same.

I am really scratching my head on this one.

I have used the ISP port on the atmega chips for quite a while and never really had any trouble with them, which is why I went with the ISP connection for my current board. I unfortunately didn't put a connector in for the JTAG port.

I didn't, however, use the 4 pins for JTAG communication for anything else, so I may attempt to later white wire a connector in to see if I can can something to work.

Keep the suggestions coming, I am hoping I missed something stupid

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

Have you connected the AVCC pin to VCC?
Have you placed decoupling capacitors across EVERY VCC/GND pin pair?
Are you dealing with virgin chips or they have been already programmed before?

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

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

matt.b.lister sounds fairly 'Anglo' to me.
If you are quoting pins, please use the NAME rather than package number. By all means say TQFP package: MISO(22), SCK(20), ...

1. Your ISP pins must not be heavily loaded by external hardware.
2. Your Internal RC clock should be running unless it left the factory without the fuses set.

It is easier to apply one wire from an external 1MHz clock to XTAL1 than 4 wires to JTAG pins. You can normally 'get at' the crystal pins quite easily. There is no need to disconnect the crystal.

David.

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

The chips SHOULD all be virgin chips from digikey, all freshly populated by Screaming Circuits.

I gave the pin numbers rather than the names to be absolutely clear were the physical connections were made.

AVCC is connected to a 5V volt voltage reference and AVDD is tied to analog ground which is tied to Digital ground.
I can easily tie AVCC to my chips VCC, but I doubt that will help (though I could be wrong), I am measuring 5V on the AVCC pin reference to both AGND and DGND.
the ISP pins are connected to nothing else in the circuit. There use was to be exclusively ISP pins. Every VCC/AVCC pin does have a decoupling cap located 1-2mm from the pin and is decoupled to DGND/AGND

Into XTAL1 I have an external oscillator, CSX750FCC14.7456M-UT or 300-7209-1-ND from digikey.

From my understanding, the chip should be in an internal ocillator mode until I change the fuse bits, which I have been unable to access.

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

Are you sure the chip is properly oriented on PCB? Where do you think a pin #1 is located when you're looking at the chip marking text in a normal way?

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

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

It appears to be oriented the way I expect it to. Pin 1 on the top of the left side, pins counting up as you rotate counter-clockwise around the device.

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

If you have a brand new pcb design and it does not work, I would check the pcb design. It is not unknown for people to make routing errors.

Are you sure that "Screaming Circuits" did not fiddle with it?

Since you are confident the ISP routing is correct, are you sure the oscillator module is working too?

If your pcb design is proven, you can hen start suspecting "Screaming Circuits" or bad chips, or ...

David.

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

matt.b.lister@gmail.com wrote:
What I meant by NEARLY identical is that my board is routed a bit different (the traces aren't layed out the same as the Ardruino 1280)
I am using the Atmega1280.
Ringing the complete connection out with a multimeter I get Pin 1 on the Dragon AVR ISP connector ringing through to pin 22 on the ATMEGA1280. Pin 2 of the ISP is connected to my VCC, which is at 5 volts, and I have verified the presence of 5 volts on pins 10, 31, 61, and 80 on the ATMEGA1280. Pin 3 of the ISP rings through to pin 20 on the ATMEGA1280. Pin4 on the ISP rings through to pin 21 on the ATMEGA1280. Pin5 on the ISP rings through to pin 30 on the atmega1280. Pin 6 is connected to ground and I have verified ground on pins 11, 32, 62, and 81 on the atmega1280.

I compared data sheets for the 1280 to the 2560 and the ISP ports showed to be connected the same. I connected the Dragon AVR to the Ardruino2560, 6-pin ISP to 6-pin ISP, connected one to one, and double checked that connection(which I was able to communicate through with the Dragon AVR) and rung it out the same way I did my ATMEGA1280 circuit and it rang out the same.

I am really scratching my head on this one.

I have used the ISP port on the atmega chips for quite a while and never really had any trouble with them, which is why I went with the ISP connection for my current board. I unfortunately didn't put a connector in for the JTAG port.

I didn't, however, use the 4 pins for JTAG communication for anything else, so I may attempt to later white wire a connector in to see if I can can something to work.

Keep the suggestions coming, I am hoping I missed something stupid

Not smart, but not stupid either (or uncommon). Unlike the majority of MEGA chips, the 1280 (and 1281) do not use the SPI pins for ISP. I don't knwo what the Dragon ISP connector looks like, but assuming it is a dual row, 6 pin header, Pin 1 of the connector should go to pin 3 of your micro, and pin 4 of the connector should go to pin 2 of your micro (pin 3 of the connector goes to pin 11 of the micro).

Science is not consensus. Science is numbers.

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

Routing errors was the first thing I started looking at and expected because it was a new design...but everything ohms out where I expect it to.
I probed the external oscillator with an O-Scope and I do have a nice 14.7456MHz waveform.

That being said, I would expect the chip to come initialized to use its intenal oscillator.

I doubt screaming circuits caused any issue (though not ruling it out), they are just a pick-n-place assembler.

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

I have used Screaming Circuits many times without any issues. I strongly doubt they damaged your components.

Reread my post. You said that pin 1 of your ISP header is connected to pin 22 on the micro, and pin 4 on the header goes to pin 21 on the micro. This simply will not work. Look at page 350 of the datasheet for serial programming pin mapping.

Edit: sorry -- just realized you are using a 100 pin chip (not the 64).

Science is not consensus. Science is numbers.

Last Edited: Wed. Sep 14, 2011 - 03:38 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That's it, for sure. The 100-pin Mega640/1280/2560 pin diagram in a datashit doesn't show the PDI/PDO pins at all.

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

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

hobbss...Do you have a page in the datasheet for the 1280 or an app note that I can reference to see my screw up? I will give you suggestion a try a little later on today...ummmm....just thinking back to an earlier post I made....If you look at the Ardruino MEGA1280-http://arduino.cc/en/uploads/Mai...
They have the ISP port wired up the same way I do...

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

I've been involved in many many AVR new board designs over the years. Occasionally, this situation comes up on first prototypes--unable to "contact" the board with ISP.

I guess the first thing to consider is hard shorts of some kind. Turn the current way down on the power supply, and/or meter the current draw. Higher than 10-20mA? Hmmm--better shut things down and examine... These could be e.g. solder globs, or a design/routing error.

Next step is to check the levels on all supply and ground pins.

From there, I wouldn't want to tackle this situation without a 'scope. Preferably 2-channel. If you slow the ISP waaay down, to like 10kHz or something, even the soundcard 'scopes might suffice perhaps. (Are they dual-channel?)

Set up the ISP at a slow speed and set up for Read Signature operations. If you can't do Read Signature reliably and repeatedly, then you won't have much luck with other ISP operations. Once you >>can<< do that then other ISP operations with probably work. (NB--the Read Signature sequence is a short query and short response, so a ratty signal can allow that operation but other operations with bigger packets might fail.)

Now set up your 'scope with a good appropriate ground. In all of the below, READ THE SIGNAL RIGHT ON THE AVR PINS. Indeed, those will be harder to get at than the ISP header. But looking at the ISP header won't tell you what the AVR is seeing.

All set up? Put the 'scope onto the AVR's /RESET. It should be riding high, and drop during the Read Signature operation. Drops, comes back up, and looks clean? Good.

Now the SCK pin. A short burst during the Read Signature? Clean? Good.

Here is where two channels start to come in. Once satisfied with SCK, then I tie one channel to SCK and use that as the trigger channel. In turn, put the second channel on /RESET, MOSI, and MISO and look at the waveforms w.r.t. the SCK. The /RESET is kind of the sanity check, and the width of the whole pulse indicates the entire transaction time. MOSI should wiggle during the first part of the transaction and MISO during the latter part.

If all of the above is good and the MISO response is getting back to the ISP, then wtf--it should be working.

If there is no MISO response, then the AVR is dead. Or maybe the ISP bit rate is too fast.

Or, perhaps, is there other circuitry on the ISP pins? In particular, other SPI devices? Could they be interfering? Cut them loose if you have to--the objective here is to do ISP. In the worst hair-pulling situations, start with a bare board and little app circuitry--only enough to do ISP.

The Read Signature sequence is short enough that if you have to you can decode the bits manually off the 'scope. A logic analyzer usually has many channels and allows the whole sequence and all the signals above to be done at the same time and would simplify the decode. Perhaps starting with the LA versus the 'scope is "better". (I have the 'scope ready on my bench and have to dig out the LA; and it usually doesn't get that far down the chain of tests above.)

Quote:

are you sure the oscillator module is working too?

Of course the AVR needs a clock for ISP. If these are indeed "virgin" then the AVR should be running off the default internal clock.

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

matt.b.lister@gmail.com wrote:
hobbss...Do you have a page in the datasheet for the 1280 or an app note that I can reference to see my screw up? I will give you suggestion a try a little later on today...ummmm....just thinking back to an earlier post I made....If you look at the Ardruino MEGA1280-http://arduino.cc/en/uploads/Mai...
They have the ISP port wired up the same way I do...

Matt -- I am sorry. I assumed [erroneously] that the 1280 came in a 64 pin package. You do, in fact, have it wired correctly for the 100 pin 1280. What is the value of your pullup resistor on the reset line?

Science is not consensus. Science is numbers.

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

I checked the data sheet, I am using a 100 pin TQFP by the way,
PB1 = SCK = Pin 20;
PB2 = MOSI = PDI = Pin21;
PB3 = MISO = PDO = Pin 22.

Am I missing something?

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

theusch,
Lot of good suggestions, I will hook my LA up this evening and take a good close look at whats going on...

And you and enough people have said it- and as I went back through my schematics - I do indeed have a couple chips hooked up to the SPI ports.

Earlier, the only thing going through my head was that I didn't have any switches or LEDs connected to them...

and not being able to program the chip I can't turn the chip selects on those other SPI connects off...

So I am probably getting a lot of junk back into the ISP port when I attempt to program.

Like I said early, something stupid that I was missing.

I can't wait to revisit this this evening, Its been driving me nuts, and I bet it was this goofy mistake.

...Time to add a JTAG port

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

Quote:

and not being able to program the chip I can't turn the chip selects on those other SPI connects off...

Since AVR ISP is done with the AVR held in reset, and when the AVR is held in reset all port pins are floating inputs, add a weak pullup/pulldown the the chip selects of the external SPI devices to keep them unselected when the AVR is in reset. Simple, works well, and allows ISP.

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 was considering the same thing with the pull up/downs. And that would be fairly easy for me to implement on the current design

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

I just lifted the SDO pins on the three IC's I am suspecting were interfering with my ability to program the ATMEGA1280...and presto everythings is great.

Thanks to everyone for all your help.

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

Yo Matt.... my datasheet for 640/1280 shows PDO and PDI on sca and scl (42 and 43). In a mega8, they use miso and mosi for the isp data. On the mega128 and 1280 they use pdo and pdi. Two messages up you said mosi was pdi.... no no no... mosi means out...pdo

Imagecraft compiler user

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

matt.b.lister@gmail.com wrote:
(now): I just lifted the SDO pins on the three IC's I am suspecting were interfering with my ability to program the ATMEGA1280...and presto everythings is great.

(earlier): ...the ISP pins are connected to nothing else in the circuit. There use was to be exclusively ISP pins.

Where is the truth then?

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

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

There should be no need to ever disconnect SPI devices. Just make sure that they are deselected when AVR is in RESET (i.e. during ISP)

Regular SPI has active low chip select pins.
MicroWire has active high chip select.

Simply add an external pull-up for each SPI and a pull-down for any MicroWire.

If you ever design a pcb that does not use chip selects for SPI, sit on the naughty step.

David.

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

Quote:

Regular SPI has active low chip select pins.

What do you mean by "regular"?

Is a DS1305/6 with CE "irregular"?

Quote:
Since AVR ISP is done with the AVR held in reset, and when the AVR is held in reset all port pins are floating inputs, add a weak pullup/pulldown to the chip selects of the external SPI devices to keep them unselected when the AVR is in reset.

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

Quote:
Is a DS1305/6 with CE "irregular"?

Yes.

This device is basically a 3-Wire (MicroWire) device.

I take your point though. SPI is not always active low /CS. It is definitely more common.

We both agree on the pull-up / pull-down that must be effective when the AVR is in 3-state. Most chips have weak internal 'pulls'. I am happier with a real external resistor.

David.

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

Quote:

This device is basically a 3-Wire (MicroWire) device.

???
Quote:
Supports Motorola SPI
â„¢ (Serial Peripheral
Interface) Modes 1 and 3 or Standard 3-Wire
Interface

http://en.wikipedia.org/wiki/Ser...
Quote:
Microwire is essentially a predecessor of SPI. It's a strict subset: half duplex, and using SPI mode 0.

So, I guess I can't agree with

Quote:

This device is basically a 3-Wire (MicroWire) device.

http://www.maxim-ic.com/app-note...

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.