Very unstable internal RC oscillator on mega88PA

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

Having issues trying to get some UART communication to run on a mega88PA, I decided to check the clock. Board is working fine otherwise, apart from the UART.

I have a minimal board, dead stable 3.3V to VCC and AVCC, proper decoupling, brand new device, erased, fuses set to CLKDIV8 and to output clock on CLKO.

The clock frequency is correct at 1MHz, but I have 60-80% clock jitter, it's so unstable, my scope can hardly show the signal. No wonder the UART won't work with this.
Same throughout the supply range from 1.6 to 5V
Adding a simple while loop in the code doesn't help either.

I've been trough the datasheet to see if there's any difference in the clock system between the mega8, mega88 and mega88PA, and although there is obviously differences, theres nothing that should cause this.

I've tried 3 devices now, all with the same result.
I suspect my devices are bad.
Or did I miss something somewhere?

Any ideas?

/Jesper
http://www.yampp.com
The quick black AVR jumped over the lazy PIC.
What boots up, must come down.

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

Take a 10 second sample with a Logic Analyser. You might see a pattern.

Apart from a SUT, I can't see why a RC oscilator would be unstable.

Is the OSCCAL at the 'end of range'? i.e. near a discontinuity.

It does sound very strange.

David.

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

Haven't checked OSCCAL, but would expect it to be reasonable. The frequency is right, it's just jittering terribly.

This is devices right out the box.

I had a mega88 on the board a while back and had no issues.

/Jesper
http://www.yampp.com
The quick black AVR jumped over the lazy PIC.
What boots up, must come down.

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

Hmmm--the clock divider? Do you see the same symptoms if you set CLKPR to 0?

This report is kind of scary, as I use that series in a couple sleeping apps with the internal oscillator used to keep wakeup time to a minimum. (There is a 32kHz crystal for periodic recalibration.)

"A" series, eh? An artifact of the new fab/die size reduction?

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

Do you have a scope that you can use to look at Vcc? Yes, I know you said that it is dead stable and properly bypassed, but it would be nice to have some validation. I would check it by connecting the probe and ground lead as closely to the supply pins as possible. If you can do it, I would even look at the physical pin rather than the circuit board (maybe a solder connection problem). Yes, I know, but at this point "any port in a storm"!

At that time scale, supply voltage is one of very few things that can do it. Of course, it might be something internal that is not externally visible. What happens if the 32KHz oscillator is disabled?

How are you observing the clock? With the CKOUT function? Does it change with CLKPR setting?

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!