Quickly learn Arm (23)--lpc2300 system clock 2

Publisher:机械梦想家Latest update time:2021-01-18 Source: eefocusKeywords:Arm  lpc2300 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Continuing from the previous article, let's take a look at the PLL setup steps:

1. If the PLL is already connected, we disconnect it first by using a feed sequence to disconnect the PLL. The feed sequence is of course implemented by writing the feed register PLLFEED. The feed sequence mechanism is used to prevent the relevant parameters of the PLL from being accidentally modified. The LPC2300 series ARM provides hardware protection. Only by writing 0xAA to the PLL feed register first and then writing 0x55, the relevant parameters of the PLL can be effectively changed.


2. Disable the PLL with a feed sequence, that is, stop the operation of the flow-controlled oscillator CCO.


3. Select the PLL input clock source through the clock source selection register CLKSRCSEL.


4. Write the PLL configuration register PLLCFG and use a feed sequence to make it effective. The PLL configuration register is only valid when the PLL is disabled.


5. Send another feed sequence to enable the PLL (to restart the stopped current-controlled oscillator CCO)


6. After the PLL is locked, that is, stable, connect the PLL with a feed sequence.


Note: The PLL will be turned off and switched out of the clock system during chip reset and financial power-down mode. After the chip wakes up from power-down mode, the program must reinitialize the PLL, activate the PLL and wait for it to lock before connecting to the PLL.


There are four registers associated with PLL, three of which are control registers and one is a status register.


PLL Control Register (PLLCON): A register that stores updated PLL control bits. Values ​​written to this register take effect only after a valid PLL feed sequence is sent.


PLL Configuration Register (PLLCFG): This register stores updated PLL configurations. Values ​​written to this register take effect only after a valid PLL feed sequence occurs.


PLL Status Register (PLLSTAT): A read-back register for PLL control and configuration information. If a write operation is performed to the PLL control register or the PLL configuration register, but no PLL feed sequence is generated, these values ​​will not reflect the current state of the PLL.


PLL Feed Register (PLLFEED): This register enables loading of PLL control and configuration information from the PLL control register and PLL configuration register into the image register that affects the operation of the PLL.

 

The following code is copied by me. Its main function is to select the 4MHz internal oscillator as the PLL clock, so that the input clock is increased to 288MHz. The process is as follows:


Select clock source --> Enable PLL --> Set division value --> PLL feed sequence --> Wait for PLL to be available --> Set CPU division value --> Connect PLL --> PLL feed sequence --> Wait for PLL to lock. The code is as follows:

   CLKSRCSEL   =0x01;

   PLLCON      =1;

   PLLCFG       =0<<16;

   PLLCFG      |=35;

   PLLFEED     =0xAA;

   PLLFEED     =0x55;

   while(((PLLSTAT & (1<<24))=0));

   CCLKCFT     =3;

   PLLCON      =3;

   PLLFEED     =0xAA;

   PLLFEED     =0x55;

   while(((PLLSTAT & (3<<25))!=(3<<25>>>;

     ......

Please note that the storage values ​​corresponding to the PLLCFG above are N-1=0, M-1=35. So N=1, M=36. Please pay attention to this point.


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

Previous article:Quickly learn Arm (24)--lpc2300 system clock 3
Next article:Quickly learn Arm (22)--lpc2300 system clock

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号