ATMEGA88V - Clock running at 1/8 speed???

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

My ATMEGA88V clock is running at 1/8th the correct speed. This is even though I programmed off the 1/8 flag, and also turned off the clock divider at startup (CLKPR = 0;); I am using a full swing external crystal at 3.6864 MHz.

I verified that the clock is too slow by setting the flag to make it output on B0, and looking at it with a scope.

The 88V is a slow version (<10MHz). Is it possible that it has a weirdness in this area?

Note that it also has a signature different from the one in the manual.

Any help would be appreciated.

Tiny Vital Systems, LLC
http://www.tinyvital.com
Embedded solutions
-------------
Microsoft Vista needs over 1GB of memory to work. We get our job done in 8KB!

Harvard architectures suck, but what the heck.

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

Can you post the signature?
It may be it isn't an '88 after all (suppliers have had parts mis-filed before), can you read the part number on the chip?
An ATMega8, for instance, would have different fuse bit meanings though the same package.

I have coded for about 2 dozen architectures, and they all have their place.
Don't get too religious about them (but AVR is excellent!)

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

Quote:

Note that it also has a signature different from the one in the manual.

Now THAT is weird. Are you SURE that the chip isn't running off the internal 1MHz oscillator? If you can't Read Signature repeatedly and reliably, I'd be very suspect of the results of other operations such as reading and setting fuses.

But apparently you got a program into it, so Write Flash worked at least once.

Slow down your ISP speed and work on the signature. And/or maybe Read Flash and see if it really looks like your program binary.

Others have reported blown signatures from time to time over the years, often on a stressed chip of some sort. I've seen one instance on my bench in 6 years. NOT common. Our board house says he cannot remember the last bad new AVR, and he does many thousands per month.

Lee

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

For an ATmega88, you can also set the CKOUT fuse and monitor the
CPU clock on port B0.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

Thanks for the ideas, folks....

1) Clock: I did set the CKOUT fuse and monitored the clock on port B0. It was about 1/8 my 3.6864MHZ clock (by tektronix scope reading). I'll have to see if there is any way the internal 128khz clock could have caused this, but it doesn't look like it.

I have an interrupt routine that goes off every 75 milliseconds (approx). It uses the reset at compare timer function, with x1 prescale (i.e. no prescale), and a count of 368640. This is with an XTAL of 3.6864 MHZ. It was supposed to go off every 10 msec.

2) Signature. I didn't write down the signature, and now my programmers are not able to read it (see my other post), But;
...It was consistent across all 5 of my chips
...It was one off from the mega88 - I *think* it was 1E 93 06, but am not sure. I know it was *close* to that specified.

3) I have tried VERY slow ISP speeds

Tiny Vital Systems, LLC
http://www.tinyvital.com
Embedded solutions
-------------
Microsoft Vista needs over 1GB of memory to work. We get our job done in 8KB!

Harvard architectures suck, but what the heck.

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

Correction, the count is 36864. I should preview :-(

Tiny Vital Systems, LLC
http://www.tinyvital.com
Embedded solutions
-------------
Microsoft Vista needs over 1GB of memory to work. We get our job done in 8KB!

Harvard architectures suck, but what the heck.

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

Well,

ATMega8  signature: 1E 93 07
ATMega88 Signature: 1E 93 0A

So did you check they didn't ship the wrong part yet?

I have coded for about 2 dozen architectures, and they all have their place.
Don't get too religious about them (but AVR is excellent!)

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

There is a fuse called DIV8 or something similiar.
This divides by 8. Active by default.

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

I found the bad signature. It is 1E 93 06.

I will post this in a separate thread.

Others have the correct code ( 1E 93 0A ).

I still have some parts I can't program even with the STK500 in high voltage mode. Is there any way to put a part in a "never program again" mode?

I solved my clock program (I was using the wrong flag, in spite of what I said) and got my application working with the parts with the good signature.

....

Also confusing was using the dragon. Put the thing into debug mode, and then go back and try to program, and it tells you it cant because the DWEN flag is set. Try to unset the flag and it says no, ain't in programming mode.

Turns out (discovered in the HELP button on the debug menu, not where it should be on the program menu) that you can go into debug, and from the debug dropdown, turn off the DWEN so that SPI programming works agian.

Sigh.

Tiny Vital Systems, LLC
http://www.tinyvital.com
Embedded solutions
-------------
Microsoft Vista needs over 1GB of memory to work. We get our job done in 8KB!

Harvard architectures suck, but what the heck.

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

Quote:

I found the bad signature. It is 1E 93 06.


Interesting. The .xml for a Mega168 shows
Quote:


$1E
$94
$06


so you've got a half-'88/half-'168 ?

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

Yes, and that's what the manual says.

Tiny Vital Systems, LLC
http://www.tinyvital.com
Embedded solutions
-------------
Microsoft Vista needs over 1GB of memory to work. We get our job done in 8KB!

Harvard architectures suck, but what the heck.

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

According to my search for signature 1E 93 06, you have an ATMega8515, not an ATMega88.
I guess you'd notice if you had 40 pins instead of 28 though...

I have coded for about 2 dozen architectures, and they all have their place.
Don't get too religious about them (but AVR is excellent!)

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

Well you should recognise a mega8515 as it normally ships with the STK500 and you've got one of those.

I can't usually read whats printed on the chip without a magnifying glass but when I've looked the pat has always been what is printed on it.

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

Yeah, it's 28 pins.

BTW... my customer, using a oommercial programmer, is unable to program these chips (he gets bad signature even from the batch where I am reading a good signature).

Tiny Vital Systems, LLC
http://www.tinyvital.com
Embedded solutions
-------------
Microsoft Vista needs over 1GB of memory to work. We get our job done in 8KB!

Harvard architectures suck, but what the heck.