LPC1768 Clock and Timer

Publisher:Xingfu8888Latest update time:2018-06-27 Source: eefocusKeywords:lpc1768  clock  timer Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The clock consists of 4 parts

1: CLKSRC: 01 in the example
   Select the clock source of PLL0 as follows:
  00 Select the internal RC oscillator as the clock source of PLL0 (default)
  01 Select the main oscillator as the clock source of PLL0
  10 Select the RTC oscillator as the clock source of PLL0
  11 Reserved, do not use this value

2: PLL0 configuration register (PLL0CFG – 0x400F C084)
FCCO = (2×M×FIN) / N // In the example, FCCO = 2×100×12Mhz / 6 = 100MHz

FIN The frequency of the PLL input clock in the clock source selection multiplexer
FCCO The system clock frequency (the output of the PLL current controlled oscillator)
N: The PLL0 prescaler value of the NSEL0 bit in the PLL0CFG register (PLL0CFG NSEL0 field + 1). N is an integer between 1 and 32
M: The PLL0 multiplier value of the MSEL0 bit in the PLL0CFG register (PLL0CFG MSEL0 field + 1).
Not all possible M values ​​are supported.

 

3: Re-division: CPU clock configuration register (CCLKCFG – 0x400F C104), the example here is 5 or 6 division. The division
value CCLKSEL can only be 0 and odd values ​​(1, 3, 5…, 255). CCLK is obtained from the output signal of PLL0 and divided by CCLKSEL+1

 

4: The clock input to the timer is divided again, in this case it is divided by 4

// Peripheral Clock Selection Register 0 (PCLKSEL0)
// PCLK_WDT: Peripheral Clock Selection for WDT
// <0=> Pclk = Cclk / 4
// <1=> Pclk = Cclk
// <2=> Pclk = Cclk / 2
// <3=> Pclk = Hclk / 8
// PCLK_TIMER0: Peripheral Clock Selection for TIMER0
// <0=> Pclk = Cclk / 4
// <1=> Pclk = Cclk
// <2=> Pclk = Cclk / 2
// <3=> Pclk = Hclk / 8

5: The clock obtained by the timer is 25mhz,

The timer can use PC and PR for re-division. In the example, here is 0, which means no more frequency division.

MR0 is the preset value. When a pulse comes, TC will increase by 1. When TC and MR0 are equal, the timer is triggered.

————》PR and PC ————> TC and MR0 --> Trigger

 


Keywords:lpc1768  clock  timer Reference address:LPC1768 Clock and Timer

Previous article:Differences in clock configuration between LPC1788 and LPC1768
Next article:LPC23XX Timer Function Examples

Recommended ReadingLatest update time:2024-11-16 16:34

Method for reliable oscillation of load capacitor of clock chip DS1302 applied to crystal oscillator
    In the actual use of DS1302, the auxiliary capacitor method can solve the oscillation stopping problem caused by the mismatch of crystal oscillator load capacitance in the application of DS1302.     Overview       DS1302 is a real-time clock chip produced by Dallas. It transmits data with the microcontroller in se
[Microcontroller]
Method for reliable oscillation of load capacitor of clock chip DS1302 applied to crystal oscillator
STM8 HSI and HSE manually switch clock source
Experimental platform: Sixiu Electronics Studio "Xiangyun Little Prince" development version int main(void) {   PI_DDR_DDR0=1; //Configure PI0 port to output mode   PI_CR1_C10=1; //Configure PI0 port to push-pull output mode   PI_CR2_C20=0; //Configure PI0 port low speed output   led1=1; //PI0 output is high level,
[Microcontroller]
[nrf51][nrf52][S130][SDK12.3] Modify the protocol stack clock
nrf_clock_lf_cfg_t clock_lf_cfg = NRF_CLOCK_LFCLKSRC; // see nrf_sdm.h for more details nrf_clock_lf_cfg_t clock_lf_cfg =  {     .source = NRF_CLOCK_LF_SRC_RC,     .rc_ctiv = 16, // Interval in 0.25 s, 16 * 0.25 = 4 sec     .rc_temp_ctiv = 2, // Check temperature every .rc_ctiv, but calibrate every .rc_temp_ctiv     
[Microcontroller]
[nrf51][nrf52][S130][SDK12.3] Modify the protocol stack clock
PIC18F8520 GPS Precision Clock Implementation
GPS (Global Positioning System) is the most complete satellite navigation system in the world. It not only has the real-time, continuous and high-precision three-dimensional positioning capability covering the whole world, but also has the precise timing function. This paper uses the precise timing fu
[Microcontroller]
PIC18F8520 GPS Precision Clock Implementation
STM32F334 system clock configuration RCC_Config()
MCU:STM32F334C8T6 Frameware:STM32F3348-Discovery_FW_V1.0.0 RCC clock configuration steps: Reset RCC to default value: RCC_DeInit(); This function can be found in the library function to select HSI as the system clock (see figure) Turn on the external high-speed clock crystal HSE Waiting for HSE work Setting AHB
[Microcontroller]
STM32F334 system clock configuration RCC_Config()
[STM32] STM32 port multiplexing and remapping (AFIO auxiliary function clock)
STM32F1xx official information: "STM32 Chinese Reference Manual V10" - Chapter 8 General and Multiplexed Function IO (GPIO and AFIO) Port multiplexing function Definition of port multiplexing STM32 has many built-in peripherals (such as serial port, ADC, DCA, etc.), and the external pins of these peripherals are
[Microcontroller]
[STM32] STM32 port multiplexing and remapping (AFIO auxiliary function clock)
Design of electronic clock based on LCM1602 LCD, DS1302 clock chip and E2PROM
It took an afternoon to finish the work! Many places can be optimized with loops, but based on simplicity and good readability, I use the traditional method! By DAVID QQ:1205946980 Program code download: http://www.51hei.com/f/1302eep.rar   #include reg52.h #define uchar unsigned char #define uint unsigned
[Microcontroller]
Design of electronic clock based on LCM1602 LCD, DS1302 clock chip and E2PROM
STC12C2052 single chip LED dot matrix electronic clock production
1. Design Purpose In daily life, we see electronic clocks made of digital tubes, but LED dot matrix clocks are rare. Although dot matrix clocks have their own shortcomings, such as insufficient hardware utilization and high prices, the font of dot matrix clocks can be easily changed. As long as the program in the micr
[Microcontroller]
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号