Page 1 of 1
dsPIC33EP512GM304 OSC PLL setting help me!!
Posted: Tue Dec 03, 2019 8:53 am
by seokgi
Hi.
I'm using a 16-bit processor for the first time in this project and I use dsPIC33EP512GM304. It's very different from 8 bits. I've compiled and downloaded it, but I have to use the UART, which is very difficult to set up OSC PLLs, etc. Can anyone help me?
Thank you.
Re: dsPIC33EP512GM304 OSC PLL setting help me!!
Posted: Tue Dec 03, 2019 2:11 pm
by QMESAR
Hi
Yea the dsPIC33 is great micro.
Well you have to give some info to help you
(1) what OSC are you using Internal /External if external what is the frequency of the Chrystal
(2) what Clock speed you would like to use
Re: dsPIC33EP512GM304 OSC PLL setting help me!!
Posted: Tue Dec 03, 2019 2:20 pm
by QMESAR
Hi
Here is the config for using and 8Mhz Chrystal and running at 70Mips(140 Mhz)
Code: Select all
/***************************************************
* Configure device for 70 Mips with 8 MHZ XTAL
**************************************************/
PLLFBD = 68; /* M=70 (68 +2)*/
CLKDIVbits.PLLPOST = 0; /* N1=2 */
CLKDIVbits.PLLPRE = 0; /* N2=2 */
OSCTUN = 0; //Tune FRC oscillator, if FRC is used
//Disable Watch Dog Timer
RCONbits.SWDTEN = 0;
//-------------------------------------------------------------------
// Clock switching to incorporate PLL
__builtin_write_OSCCONH(0x03); // Initiate Clock Switch to Primary
__builtin_write_OSCCONL(0x01);
while (OSCCONbits.COSC != 0x3);
//--------------------------------------------------------------------
//ensure PLL lock before moving on into application code
//--------------------------------------------------------------------
while(OSCCONbits.LOCK != 1); /* Wait for Pll to Lock */
use a C icon enter the c code and place the C icon before the main loop so that it is execute on start up only
here are the settings for Project option

- P1.jpg (201.61 KiB) Viewed 3058 times

- P2.jpg (50.67 KiB) Viewed 3058 times
Re: dsPIC33EP512GM304 OSC PLL setting help me!!
Posted: Wed Dec 04, 2019 4:33 am
by seokgi
Thank you very much.
But I want to use internal clock, so let's study with advice. Thank you for your attention.
Re: dsPIC33EP512GM304 OSC PLL setting help me!!
Posted: Wed Dec 04, 2019 5:11 am
by QMESAR
HI
Yes I understand now that you want to use internal OSC then you have to say so when you ask for help .
any case the principal of setting it up is the same
Re: dsPIC33EP512GM304 OSC PLL setting help me!!
Posted: Wed Dec 04, 2019 7:00 am
by seokgi
Thank you QMESAR.
I will try it. and study it.