DSPIC33EPxxx Internal Oscillator setup

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

Moderator: Benj

Post Reply
JustinS
Flowcode v5 User
Posts: 40
Joined: Wed Sep 12, 2012 1:59 pm
Has thanked: 1 time
Been thanked: 7 times
Contact:

DSPIC33EPxxx Internal Oscillator setup

Post by JustinS »

I'm starting testing Flovcode V8 and DSPIC programming.
I test DSPIC3EP128MC202.
I searched the entire forum and can not find the C code for the internal oscillator configuration for the 140MHz frequency.
IntOsc Helper shows nothing
I am asking for quick help
:|

User avatar
celebriums
Posts: 125
Joined: Sun Sep 25, 2016 3:50 pm
Has thanked: 71 times
Been thanked: 33 times
Contact:

Re: DSPIC33EPxxx Internal Oscillator setup

Post by celebriums »

Hi Justin

It will work if you make the settings as below.

Menu> Project Options> General Options
ClockSpeed 8Mhz (internal speed up to 8 Mhz is not 140 Mhz. )

Menu> Project Options> Configure

_FCID 0xFFEF
_FPOR 0xFFFF
_WDT 0xFF7F
_FOSC 0xFFBF
_FOSCSEL 0xFFF8 (INT Fast RC (FRC))
_FGS 0xFFFF
Sincerely Regards
Sadık SUME

www.kaandesign.com.tr

JustinS
Flowcode v5 User
Posts: 40
Joined: Wed Sep 12, 2012 1:59 pm
Has thanked: 1 time
Been thanked: 7 times
Contact:

Re: DSPIC33EPxxx Internal Oscillator setup

Post by JustinS »

Thank you celebriums
I will try your setting.
Two years ago I used the following code in C.
And it worked OK.
I just found him today

//Setup configuration for 138.1875MHz or 69MIPs using 7.37MHz Internal Osc
PLLFBD = 73;// M=75
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(0x01);// Initiate Clock Switch to FRC

// Oscillator with PLL (NOSC=0b011)
__builtin_write_OSCCONL(0x01);// Start clock switching

while(OSCCONbits.COSC != 0b001);

// Wait for Clock switch to occur
while(OSCCONbits.LOCK != 1);

Post Reply