What is the maximum clock I can with this microcontroller (internal) and how do I set it?
Thankful;
Ricardo.
DOUBT DSPIC33EP512MU810
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: DOUBT DSPIC33EP512MU810
Hi Ricardo,
Fastest clock speed is 140MHz or 140000000 which produces a instruction speed of 70MIPs.
Set your configuration settings like this.
And then add this code into a C code icon at the start of your project.
Fastest clock speed is 140MHz or 140000000 which produces a instruction speed of 70MIPs.
Set your configuration settings like this.
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);
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: DOUBT DSPIC33EP512MU810
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.
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.
- Attachments
-
- Flowcode1.fcfx
- (10.62 KiB) Downloaded 252 times
Re: DOUBT DSPIC33EP512MU810
sorry this program
- Attachments
-
- Flowcode1.fcfx
- (11.49 KiB) Downloaded 197 times
Re: DOUBT DSPIC33EP512MU810
sorry benj this program
- Attachments
-
- Flowcode1.fcfx
- (10.01 KiB) Downloaded 214 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: DOUBT DSPIC33EP512MU810
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
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
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: DOUBT DSPIC33EP512MU810
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
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
- Attachments
-
- Flowcode1.fcfx
- (9.97 KiB) Downloaded 235 times