Jean-Pierre du Plessis
Newbie level 6
Hi,
I realy need help with a external oscillator crystal. I added a 20MHz crystal to the dspic. I tried setting my configuration bits manualy and in code. The OSCCON register showed the complete switching between clock sources. The correct bits are set. This is my switching code.
But its seems when I flash a LED with the external crystal running a lot slowwer than with the FRC.
Tomorrow I will go out and buy an 10MHz crystal and try PPL mode.
Please help me?
I realy need help with a external oscillator crystal. I added a 20MHz crystal to the dspic. I tried setting my configuration bits manualy and in code. The OSCCON register showed the complete switching between clock sources. The correct bits are set. This is my switching code.
Code:
void InitCLK (void)
{
__builtin_write_OSCCONH(0x02);
__builtin_write_OSCCONL(0x1);
while (OSCCONbits.COSC != 2);
return;
} //End of clock initialization
But its seems when I flash a LED with the external crystal running a lot slowwer than with the FRC.
Tomorrow I will go out and buy an 10MHz crystal and try PPL mode.
Please help me?
Last edited by a moderator: