Can anyone help:
I have an application using a mega218AU, running at 3.3V, the part uses the internal 8MHz osc, clock div is cleared and the prescaler is not enabled (set to 0)
the problem is the part seems to be running at 4MHz, I tried as simple loop on a port pin:
At 8MHz this should give me a square wave with a period of ~0.5uS (at 0.125uS per cycle) but it giving me 1uS, I can't fathom out why it's happening, I never seen this with any other AT parts, having used the mega 64, 90USB, Tiny etc. If I run the simulator and set the frequency to 8MHz the delays are correct. I've tried running the part at 5V, clkout is correct, clock div8 is cleared. If I change the prescaler to 1/8 (1MHz) the square wave period goes up to 8uS, it's almost like the internal cpu osc is being divided by two. OSCCAL is set to A1 (the factory default setting)
I also tried a 100mS interupt, this works correctly with the clock set to 8MHz.
I've also tried a couple more of the prototypes both with the same problem.
I must be missing something obvious, I've never used this particular part before and on a tight shcedule to get the code finished, so if anyone offer any clues, I'd be very appreciative!