dsPIC33EP512GM304 OSC PLL setting help me!!

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
seokgi
Posts: 164
Joined: Fri Jan 13, 2012 4:21 am
Location: South KOREA
Has thanked: 18 times
Been thanked: 16 times
Contact:

dsPIC33EP512GM304 OSC PLL setting help me!!

Post 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.

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: dsPIC33EP512GM304 OSC PLL setting help me!!

Post 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

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: dsPIC33EP512GM304 OSC PLL setting help me!!

Post 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
P1.jpg (201.61 KiB) Viewed 2596 times
P2.jpg
P2.jpg (50.67 KiB) Viewed 2596 times

seokgi
Posts: 164
Joined: Fri Jan 13, 2012 4:21 am
Location: South KOREA
Has thanked: 18 times
Been thanked: 16 times
Contact:

Re: dsPIC33EP512GM304 OSC PLL setting help me!!

Post by seokgi »

Thank you very much.
But I want to use internal clock, so let's study with advice. Thank you for your attention.

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: dsPIC33EP512GM304 OSC PLL setting help me!!

Post 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

seokgi
Posts: 164
Joined: Fri Jan 13, 2012 4:21 am
Location: South KOREA
Has thanked: 18 times
Been thanked: 16 times
Contact:

Re: dsPIC33EP512GM304 OSC PLL setting help me!!

Post by seokgi »

Thank you QMESAR.
I will try it. and study it.

Post Reply