dsPIC33EP512GM304 OSC PLL setting help me!!

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

Moderator: Benj

seokgi
Posts: 116
Joined: Fri Jan 13, 2012 4:21 am
Has thanked: 18 times
Been thanked: 11 times
Contact:

dsPIC33EP512GM304 OSC PLL setting help me!!

Postby seokgi » Tue Dec 03, 2019 8:53 am

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: 1160
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 357 times
Been thanked: 572 times
Contact:

Re: dsPIC33EP512GM304 OSC PLL setting help me!!

Postby QMESAR » Tue Dec 03, 2019 2:11 pm

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: 1160
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 357 times
Been thanked: 572 times
Contact:

Re: dsPIC33EP512GM304 OSC PLL setting help me!!

Postby QMESAR » Tue Dec 03, 2019 2:20 pm

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 42 times



P2.jpg
P2.jpg (50.67 KiB) Viewed 42 times
These users thanked the author QMESAR for the post (total 2):
LeighM (Tue Dec 03, 2019 2:24 pm) • chipfryer27 (Tue Dec 03, 2019 7:09 pm)
Rating: 10.53%
 

seokgi
Posts: 116
Joined: Fri Jan 13, 2012 4:21 am
Has thanked: 18 times
Been thanked: 11 times
Contact:

Re: dsPIC33EP512GM304 OSC PLL setting help me!!

Postby seokgi » Wed Dec 04, 2019 4:33 am

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: 1160
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 357 times
Been thanked: 572 times
Contact:

Re: dsPIC33EP512GM304 OSC PLL setting help me!!

Postby QMESAR » Wed Dec 04, 2019 5:11 am

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: 116
Joined: Fri Jan 13, 2012 4:21 am
Has thanked: 18 times
Been thanked: 11 times
Contact:

Re: dsPIC33EP512GM304 OSC PLL setting help me!!

Postby seokgi » Wed Dec 04, 2019 7:00 am

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