# PIC32 low SystemClock causes demo failures

**URL:** <https://forums.freertos.org/t/pic32-low-systemclock-causes-demo-failures/5758>\
**Category:** Kernel\
**Created:** [January 17, 2009, 11:51am UTC](https://forums.freertos.org/t/pic32-low-systemclock-causes-demo-failures/5758 "2009-01-17T11:51:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 17, 2009, 11:51am UTC](https://forums.freertos.org/t/pic32-low-systemclock-causes-demo-failures/5758/1 "2009-01-17T11:51:05Z")

</div>

**[randers](https://sourceforge.net/u/randers/)** wrote on [Saturday, January 17, 2009](https://sourceforge.net/p/freertos/discussion/382005/thread/fb65bedb/#7f20):

Hi,  
I have recognized the following certain behavior in the PIC32-demo-project:  
The original project works with 80Mhz-SysCLK & 40MHz-PBCLK.  
This is realized by the following lines in main.c:  
#pragma config FPLLMUL = MUL\_20, FPLLIDIV = DIV\_2, FPLLODIV = DIV\_1, FWDTEN = OFF  
#pragma config POSCMOD = HS, FNOSC = PRIPLL, FPBDIV = DIV\_2  
// SysCLK = 8 / FPLLIDIV \* FPLLMUL / FPLLODIV  
The compiler itself gets this information by the following lines in FreeRTOSConfig.h:  
#define configCPU\_CLOCK\_HZ&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( ( unsigned portLONG ) 80000000UL )&nbsp;  
#define configPERIPHERAL\_CLOCK\_HZ&nbsp;&nbsp;&nbsp; ( ( unsigned portLONG ) 40000000UL )

I lowered the CPU-Clock by setting FPLLODIV = DIV\_2 // DIV4, DIV8, …  
(and customizing FreeRTOSConfig.h)  
The PB-Clock is in each case half of the CPU-Clock.

The demo works with 80/40MHz (original settings). It works with 40/20MHz too.  
But with 20/10MHz and 10/5MHz failures are reported via LCD-display:  
"Error: Gen Q" ,&nbsp; "Error: Blck time" …

Is there anything known?

ralf

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [January 17, 2009, 1:49pm UTC](https://forums.freertos.org/t/pic32-low-systemclock-causes-demo-failures/5758/2 "2009-01-17T13:49:21Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Saturday, January 17, 2009](https://sourceforge.net/p/freertos/discussion/382005/thread/fb65bedb/#7f20/d433):

The demos do all sorts of the self checks - some more detailed than others.&nbsp; Some will check that an event occurred within the expected time.&nbsp; If you slow the clock right down then the resolution of time measurement will decrease and some tasks will start to think they have missed deadlines.&nbsp; It is not something to worry about, you have just changed the execution environment from that the tasks were expected to find the selves operating under.

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 17, 2009, 2:59pm UTC](https://forums.freertos.org/t/pic32-low-systemclock-causes-demo-failures/5758/3 "2009-01-17T14:59:24Z")

</div>

**[randers](https://sourceforge.net/u/randers/)** wrote on [Saturday, January 17, 2009](https://sourceforge.net/p/freertos/discussion/382005/thread/fb65bedb/#7f20/12b5):

Thanks for Your answer.  
I checked low clock rate under the aspect of minimal power consumption…  
But I have another certain behavior… I’ll start a new thread

ralf
