Page 1 of 1

DOUBT DSPIC33EP512MU810

Posted: Mon Oct 28, 2019 6:10 pm
by RLOPES780
What is the maximum clock I can with this microcontroller (internal) and how do I set it?

Thankful;
Ricardo.

Re: DOUBT DSPIC33EP512MU810

Posted: Mon Oct 28, 2019 6:19 pm
by Benj
Hi Ricardo,

Fastest clock speed is 140MHz or 140000000 which produces a instruction speed of 70MIPs.

Set your configuration settings like this.
Config.jpg
Config.jpg (113.13 KiB) Viewed 4746 times
And then add this code into a C code icon at the start of your project.

Code: Select all

//Setup configuration for 70MIPs using 7.37MHz int osc
PLLFBD = 68;// M=70
CLKDIVbits.PLLPOST = 0;// N1=2
CLKDIVbits.PLLPRE = 0;// N2=2
OSCTUN = 23;//Tune FRC oscillator from 7.37Mhz to 8.00566MHz

//Disable Watch Dog Timer
RCONbits.SWDTEN = 0;

// Clock switching to incorporate PLL
__builtin_write_OSCCONH(0x01);// Initiate Clock Switch to FRC with PLL

// 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);


//USB H/W initialization for 70 MIPs
//ACLKCON3 = 0x24C1;
ACLKCON3 = 0x22C1;
ACLKDIV3 = 0x7;

// Wait for PLL to lock
ACLKCON3bits.ENAPLL = 1;
while(ACLKCON3bits.APLLCK != 1);

Re: DOUBT DSPIC33EP512MU810

Posted: Mon Oct 28, 2019 8:54 pm
by RLOPES780
Hello Benj;
Thanks for listening.
I changed the settings and ran the program below but it didn't work.
(OBS) I am not using any external crystal.

Thankful;

Ricardo.

Re: DOUBT DSPIC33EP512MU810

Posted: Mon Oct 28, 2019 8:58 pm
by RLOPES780
sorry this program

Re: DOUBT DSPIC33EP512MU810

Posted: Mon Oct 28, 2019 10:49 pm
by RLOPES780
sorry benj this program

Re: DOUBT DSPIC33EP512MU810

Posted: Tue Oct 29, 2019 12:48 pm
by Benj
Hello Ricardo,

Could simply be the display that isn't working. I advise a 1 second LED flasher routine for a sanity check.

https://www.matrixtsl.com/wiki/index.ph ... ED_flasher

Re: DOUBT DSPIC33EP512MU810

Posted: Tue Oct 29, 2019 5:28 pm
by RLOPES780
Hello benj;

I did the led test and it didn't work.
With this program I gave you was using a crystal of 20mhz and the display worked.
I removed the crystal (there is no external crystal) I changed the settings it gave me and it still does not work.
Can you still help me?

Thankful;
Ricardo