LPC1112 and IRC issue

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPC1112 and IRC issue

1,367 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bkastel1 on Wed Sep 25 10:21:16 MST 2013
Hi,

I have an interesting problem. I'm using IRC on LPC1112 and also config_pll routines to down-clock the part to get lower consumption. What I have found out is that when I set clock to 3MHz the clock is not 3MHz but it is a little bit lower. Did anybody so far saw such problem?
标签 (1)
0 项奖励
回复
6 回复数

1,356 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bkastel1 on Fri Sep 27 02:22:53 MST 2013
Hi.

First, thank you very much for your help and efforts to help. When I worked for a global distributor of electronic components NXP was my preferred vendor when I promoted  MCU's :)

So, regarding the IRC - I measured yesterday the PWM frequency with different Core clock frequencies on lpcxpresso board and found that it is fine. For example - core clock 3MHz, using PWM output I set PR of TIMER0 to 2 so to get 3 PCLK cycles for 1 TCR increment. Setting MR0 to 50 and MR3 to 100 I got a PWM frequency of 9,902kHz. Measuring IRC gave a value of 12,04MHz using PicoScope 2205. So I have to repeat this with my custom board and check if the measurements will be ok. I will report back on that one as well. It might be a problem of my board and not of the MCU.
0 项奖励
回复

1,356 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tha on Thu Sep 26 17:50:00 MST 2013
There is no way to directly measured the System Core Clock, so you will have to determine it base on the Main Clock.

After making the set_PLL function, read back the M and P values from the SYSPLLCTRL registers.  Determine what is the main clock by using equation show in 3.11.4.1 in the user manual.  Alternatively, set the CLKOUT pin to measured Main Clock.  Now go read the SYSAHBCLKDIV to determine the divisor used for the AHBCLK.

From there, you can determine what the System Core Clock is set at.

If you are using CMSIS, you can also make a call to the SystemCoreClockUpdate() function after the set_pll() function to determine the System Core Clock.
0 项奖励
回复

1,356 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tha on Thu Sep 26 17:36:56 MST 2013
The CLKOUT pin does not allow switching to the System Core Clock.  The valid options are:
- IRC
- System Oscillator
- WDOS
- Main Clock
0 项奖励
回复

1,356 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bkastel1 on Thu Sep 26 14:50:18 MST 2013
Regarding the clkout pin - I can measure frequncies higher than 12MHz, this works. But when I go below 12MHz this pin always puts out a frequency of 12MHz. Do you have any idea how I can measure the down-clocked frequency that is achieved using set_pll function? PWM and setting PR = 0 and some even number for MR registers?

0 项奖励
回复

1,356 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bkastel1 on Thu Sep 26 14:07:36 MST 2013
I noticed this when I was using PWM output - when I changed the frequency the PWM period also changed a little bit and i had prescaler for PMW set in such a way that is calculated the value based on the current clock frequency. I had prescaler to yield 1us tick but this was not the case when I started lowering the frequency. now I want to measure the core clock using clkout but I have difficulties making this work - I always measure 12,03Mhz regardless of the LPC_SYSCON->CLKOUTCLKSEL value. I used 0x03 to select main clock for CLKOUT but I can't measure the down-clocked value. any ideas? Then I can also put oscilloscope screen here to check this issue.
0 项奖励
回复

1,356 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tha on Wed Sep 25 17:08:25 MST 2013
What is the exact difference you are seeing?  Is the 3MHz the main clock or the system core clock?  If it's the system core clock, how are you measuring it?
0 项奖励
回复