Have you set the configuration of the oscillator correct
See datasheet - Special features of the CPU