Mega8 starting at wrong osc speed
2009-05-15 by Tim Mitchell
Hi folks, Got a weird problem with a Mega8. It's in a timer device, the customer was reporting that the timed periods were half what they should be. On testing it, the timed periods were indeed half, unless you reset the device using the ISP header, in which case it worked correctly. It's running on 8MHz internal oscillator. Timer 0 is set to CK/8 and I have put a pin toggle into the Timer 0 overflow interrupt, which should give an overflow every 256uS. On power up I get an interrupt every 128uS! But if I reset it using the ISP header I get the correct 256uS. This suggests that the internal osc is running at 16MHz. The fuses are set to shortest startup time 6CK+0ms (but Bod is not enabled, which the datasheet says it should be with this setting). If I change it to 6CK+64ms then it appears to start up correctly every time. I have used Mega8's in loads of designs and I have never come across this. Has anyone seen this one before? -- Tim Mitchell