Quickly learn Arm (22)--lpc2300 system clock

Publisher:JFETLatest update time:2021-01-19 Source: eefocusKeywords:Arm  lpc2300 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

I have been busy with some work these days and have no time to look at Arm. The development board needs to be changed from 2478 to 2378, so I started to look at the information of 2378 again. In fact, the two are similar, but 2478 supports LCD, while 2378 does not, and the other differences are similar.


I have talked about some things about clocks, PLLs, etc., but I am still in the process of learning. If you use the C language template provided by the development board to write programs directly, it should not be difficult to get started quickly. Since there is no particularly urgent work, it doesn't hurt to learn more carefully. After checking some information, let's analyze the system clock.

    Quickly learn Arm (22)--lpc2300 system clock
Similar to what was said before, the LPC2300 series ARM has three clock sources, namely the main oscillator, the internal RC oscillator, and the RTC oscillator. Each oscillator can be selected and used according to different application requirements. The above is a schematic diagram. Among them: the internal RC oscillator frequency is 4MHz, which can be used as a watchdog timer clock source, RTC clock source, and can be used as a clock source to drive PLL and CPU. The RTC oscillator frequency is 32.768KHZ, which can be used as an RC clock source, a watchdog timer clock source, and can also be used as a clock source to drive PLL and CPU. The main oscillator operates in the range of 1MHz~24MHz, and can be used as a TRC clock source, a watchdog timer clock, and can also be used as a clock source to drive PLL and CPU.


The user can select the clock source of the input PLL or CPU core through the clock source selection register (CLKSRCSEL). PLL is used to up-convert the input clock signal Fin to provide a higher frequency clock for the CPU core and chip peripherals. That is, the input of PLL is Fin and the output is Fcco.

Link control bit in the PLL control register. When PLL is ready, this bit controls PLL as the clock source for the CPU and USB subsystem, otherwise the CPU and USB system directly use Fin. The clock divider is used to divide Fcco or Fin so that the peripherals and CPU work at the appropriate speed.

   

Next, let's take a look at the PLL, phase-locked loop:

    Quickly learn Arm (22)--lpc2300 system clock

The function of PLL is to increase the clock frequency and provide a higher frequency clock for the CPU and chip peripherals. The above is the PLL module inside the LPC2300 series ARM. CCO is the core component of PLL, through which PLL can generate signal output. The N frequency division and 2M distribution devices are combined with the desired frequency detection device to control the output frequency of CCO. The PLL link switch is located in the PLL control register. When the PLL is locked, the PLL is connected to the clock divider, otherwise Fcco is directly output from Fin without passing through PLL. Fin and Fcco have the following relationship through PLL:


Fcco=(Fin*2M)/N


That is to say, 2M plays the role of frequency increase, while N plays the role of frequency division.


Fin frequency range is: 32KHz~50MHz


The range of Fcco is: 275MHz~550MHz (288MHz clock performance is best)


The value of N is an integer between 1 and 32.


Recommendation: Use a smaller N value, which can reduce the multiplier M used when configuring the PLL.


For example, if we use an external clock Fin = 12MHz clock source, and want to get Fcco = 288MHz, then in order to minimize the frequency multiplication, we choose N = 1, and we can calculate M = 12.

 

The clock source is selected through the register CLKSRCSEL. When an external clock is selected as the clock source, there are two ways to connect the oscillator:

    Quickly learn Arm (22)--lpc2300 system clock
When the internal RC oscillator is selected as the PLL clock source, the nominal frequency of the internal RC oscillator (IRC) is 4MHz and the accuracy is 1%. When the CPU is powered on, reset, or woken up, the system automatically selects the internal RC oscillator as the system clock source.


Note: The IRC accuracy is up to the USB module requirements and cannot be used as a USB clock source.

 

When the RTC oscillator is selected as the clock source of the PLL, the RTC oscillator can be used as the RTC, watchdog timing clock source, and can also be used to replace the PLL and CPU.


Keywords:Arm  lpc2300 Reference address:Quickly learn Arm (22)--lpc2300 system clock

Previous article:Quickly learn Arm (23)--lpc2300 system clock 2
Next article:Quickly learn Arm (21)--Interrupt vector VIC controller VIC [3]

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号