mega32p MK-II ISP, Help please with what I did [SOLVED]

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

Mega32P 16MHz connected to MK-II ISP. Using device programming tool within Atmel Studio 6.1.

The mega32p is one of many that came to me with a bootloader pre-installed, with the fuse bits set for a 2KByte boot size. And the lock bits were on preventing me from making a backup of this boot.

My goal was to change the fuses to use 1KB boot segment, erase and reprogram.

I changed the boot size to 1KB. Fine. Then I tried to chip erase. Error: Device ID (signature) cannot be read. I've power cycled, etc but cannot get the MK-II to see the device ID now.

Maybe I was supposed to chip erase first, because the lock bits were on?

Long time since I worked with the MK-II (USB). Could it be as simple as: I honked up the oscillator type fuses? It has a 16MHz ext. crystal.

EDIT: added info: Scope shows same 16MHz sine wave on pin 7, 8 of a a "good" board and the board that I bricked, as above. Crystal is 16MHz.

Last Edited: Mon. Jun 16, 2014 - 03:50 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
is one of many that came to me

Obviously you can also test another chip.

Erase first, then read the signature, and then start messing with the Fuses.

Your PCB, or a commercial one?

Are all of the Vcc/Ground pin pairs, and the AVcc/Ground pin pair, fitted with a by-pass cap, 0.1uF, physically mounted close to the micro?

Is AVcc connected to Vcc, perhaps through an LC filter?

Any idea what the Brownout setting is? What is Vcc? You might consider using a variable power supply and very carefully increasing the micro's Vcc to Vmax, reset, and try erasing and reading the signature again, in case the brownout is holding the chip in reset, and your Vcc is too low for the current settings.

JC

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

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

DocJC wrote:
Quote:
is one of many that came to me

Obviously you can also test another chip.

Erase first, then read the signature, and then start messing with the Fuses.

Your PCB, or a commercial one?

Are all of the Vcc/Ground pin pairs, and the AVcc/Ground pin pair, fitted with a by-pass cap, 0.1uF, physically mounted close to the micro?

Is AVcc connected to Vcc, perhaps through an LC filter?

Any idea what the Brownout setting is? What is Vcc? You might consider using a variable power supply and very carefully increasing the micro's Vcc to Vmax, reset, and try erasing and reading the signature again, in case the brownout is holding the chip in reset, and your Vcc is too low for the current settings.

JC


Commercial board. I have several. ISP MK-II works OK with them - I haven't attempted to chip-erase a 2nd one yet, out of concern that I have become a brick-maker.

Board is powered from USB 5V to a 3v3 regulator. Hardware is OK, I just borked something. Hmm, I'll look into the brow-out. Before I bricked it, the BOD was 2.7v.

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

I gave up (for now) reviving board #1.
These boards have a 16MHz crystal.
Board #2 is now bricked too. Same as #1.
Here's what I did with #2
Read signature. Got back mega32P. Brown-out voltage is 2.7V.
Read target voltage is 3.2V. OK.
Repeated above. OK.
Power cycle. Repeat above. OK.
read signature again: OK.
Don't do anything to board.
click erase chip.
Now it's bricked.

I also tried using avrdude:
c:\Arduino\hardware\tools\avr\bin>avrdude -p m328p -c stk500v2 -t
and
c:\Arduino\hardware\tools\avr\bin>avrdude -p m328p -c stk500 -t
Both said "timeout"

discouraged to say the least.
disgusted is more accurate.

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

Is there other stuff hanging on the programming lines?

Does the board have by-pass caps?

JC

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

DocJC wrote:
Is there other stuff hanging on the programming lines?

Does the board have by-pass caps?

JC

There is another device on the SPI port. It's chip select is high (disabling).

The board has a 5V to 3.3V regulator. Output has 3 capacitors: 0.1, 1.0, 22uF.

Because I was able to read the chip signature, read fuses, before I did a chip erase, with the MK-II ISP, I don't think this is a hardware problem.

Isn't it true that after a chip erase, the mega32P is in Atmel factory-new configuration. There is an external 16MHz crystal.

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

With the mkII is it possible to set the Reset disable fuse, or the JTag enable fuse? (I don't know)

If so, either of these might also lock you out of the chip, (I think).

JC

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

Solved:

There are two SPI bus devices on this board. Board design doesn't have pull-ups on the Slave Select bits. I added a pull-up on one of the SS's. No affect. A pull-up on the other made the MK II start working.

Somehow, the MK II was able to read the signature, but I don't know how, since the MK II software does a hardware reset which would undo the logic 1's on the two SS's. Must have been some residual capacitance on the AVR or the SPI device. Once bulk erased, this went away.

I would have put pull-ups had I designed the board.

Whew.

Thank you all for the collective head-scratching. Doc J's comment about other stuff on the SPI bus got me to open my eyes.