• AVR Freaks

Helpful ReplyHot![FAQ]Why does my PIC32 run slower than expected?

Page: < 12 Showing page 2 of 2
Author
chongkamat
Starting Member
  • Total Posts : 41
  • Reward points : 0
  • Joined: 2013/08/13 08:00:10
  • Location: 0
  • Status: offline
Re:Why does my PIC32 run slower than expected? 2013/12/13 03:31:48 (permalink)
0
hi,
i'm using pic32mx795f512l, i config my pic run at 80MHz but it always run ay 8MHz. 
I'm using 8MHz crystal. May be i've a mistake
Please excuse my poor English.
Thanks.
Here is my code : 
 
#pragma config FNOSC    = PRIPLL        // Oscillator Selection
#pragma config FPLLIDIV = DIV_2         // PLL Input Divider (PIC32 Starter Kit: use divide by 2 only)
#pragma config FPLLMUL  = MUL_20        // PLL Multiplier#pragma config FPLLODIV = DIV_1         // PLL Output Divider
#pragma config FPBDIV   = DIV_1         // Peripheral Clock divisor
#pragma config FWDTEN   = OFF           // Watchdog Timer
#pragma config WDTPS    = PS1           // Watchdog Timer Postscale
#pragma config FCKSM    = CSDCMD        // Clock Switching & Fail Safe Clock Monitor
#pragma config OSCIOFNC = OFF           // CLKO Enable
#pragma config POSCMOD  = HS            // Primary Oscillator//
#pragma config IESO     = OFF           // Internal/External Switch-over
#pragma config FSOSCEN  = OFF           // Secondary Oscillator Enable
#pragma config CP       = OFF           // Code Protect
#pragma config BWP      = OFF           // Boot Flash Write Protect
#pragma config PWP      = OFF           // Program Flash Write Protect
#pragma config ICESEL   = ICS_PGx1      // ICE/ICD Comm Channel Select
#pragma config DEBUG    = OFF           // Debugger Disabled for Starter Kit
 
 
 

post edited by chongkamat - 2013/12/13 03:36:30
#21
RISC
Super Member
  • Total Posts : 5379
  • Reward points : 0
  • Status: offline
Re:Why does my PIC32 run slower than expected? 2014/01/26 03:50:26 (permalink)
5 (1)
Hi,
 
Search for SYSTEMConfigPErformance(FCY);
 
regards
#22
shenion
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2014/02/25 06:34:35
  • Location: 0
  • Status: offline
Re:Why does my PIC32 run slower than expected? 2014/02/26 14:44:58 (permalink)
5 (1)
Try adding to main:
        SYSTEMConfigPerformance(80000000);
 
The flash is slow, the above enables cache and set up optimal timings.
 
 
#23
glyons03
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2012/07/08 08:27:57
  • Location: 0
  • Status: offline
Re: Why does my PIC32 run slower than expected? 2014/07/19 15:27:00 (permalink)
0
are you using a debugging connection like ICD3? If you are connected you will not get the real time clock rate.
#24
M@rcel
Senior Member
  • Total Posts : 53
  • Reward points : 0
  • Joined: 2004/05/03 11:53:07
  • Status: offline
Re:Why does my PIC32 run slower than expected? 2014/07/23 04:29:14 (permalink)
3 (1)
chongkamat

#pragma config FPLLMUL  = MUL_20        // PLL Multiplier#pragma config FPLLODIV = DIV_1         // PLL Output Divider


Aren't you missing a newline here? FPLLODIV is now defaulted to DIV_256.
#25
WhyLee
New Member
  • Total Posts : 11
  • Reward points : 0
  • Joined: 2014/05/12 07:52:09
  • Location: 0
  • Status: offline
Re: Why does my PIC32 run slower than expected? 2014/09/30 07:04:54 (permalink)
0
i don't remember things on the pic32mx but sometimes the code runs fast but there maybe is an additional clock for the peripheral pins, that is slower. so that means that the pin does not follow your register fast enough but is synchronized to some sort of peripheral clock.
check some schematic in the data sheets for some clock between the register you are writing and the output pin.
maybe that is the case.
#26
Druzyek
New Member
  • Total Posts : 1
  • Reward points : 0
  • Joined: 2018/10/02 12:48:25
  • Location: 0
  • Status: offline
Re: Why does my PIC32 run slower than expected? 2018/10/07 16:45:45 (permalink)
0
Is there a common way to enable high performance from assembly or do I need to try to link in the C function somehow?
 
Edit: on the Pic32MM but would like to know how to do it on PIC32MX too if there is a difference.
post edited by Druzyek - 2018/10/07 16:47:06
#27
Blue_Key
Senior Member
  • Total Posts : 133
  • Reward points : 0
  • Joined: 2011/12/20 04:48:22
  • Location: 0
  • Status: offline
Re:Why does my PIC32 run slower than expected? 2018/10/25 01:57:22 (permalink)
0
Can someone provide a solution for the use without plib ?
 
plib doesn't compile for PIC32MK version....
#28
Mysil
Super Member
  • Total Posts : 3358
  • Reward points : 0
  • Joined: 2012/07/01 04:19:50
  • Location: Norway
  • Status: online
Re:Why does my PIC32 run slower than expected? 2018/11/30 06:57:03 (permalink)
0
Hi,
Attached is code I have been using for runtime setup on PIC32MK and some other PIC32M... devices.
It is mostly extract of code from PLIB source.
 
There is a restriction about attachments in the forum software, not accepting header files, so the header file must be renamed after downloading.
 
   Mysil
 
#29
_fragment_
Super Member
  • Total Posts : 403
  • Reward points : 0
  • Joined: 2008/10/08 09:17:55
  • Location: Idaho
  • Status: offline
Re: Why does my PIC32 run slower than expected? 2019/06/06 14:40:18 (permalink)
0
I'm working on a project with PIC32MX570F512H and I see that the processor header for the XC32 (v1.42) tools does NOT include #define _PCACHE. Just thought I would check to see if this was an accidental oops on Microchip's part or intentional. Anyone know?
 
Dave
#30
Page: < 12 Showing page 2 of 2
Jump to:
© 2019 APG vNext Commercial Version 4.5