LPC1768 has three independent clock sources that can be configured through software. After the MCU is powered on and successfully reset, the internal RC oscillator starts to oscillate and uses this as the operating frequency to read the code in the internal ROM area to perform initialization work, including the configuration of the system clock (in the file system_LPC17xx.c).
The process of system clock configuration is as follows:
The LPC1700 series Cortex-M3 microcontroller includes three independent oscillators, namely the main oscillator (usually refers to the external crystal oscillator), the internal RC oscillator and the RTC oscillator. Each oscillator can be selected according to specific application requirements (by configuring the clock source selection register CLKSRCSEL), the register configuration is as follows
Table 1 Clock source selection register bit description
NOTE: Note the following restrictions regarding clock source selection:
1. The accuracy of IRC does not meet the time base accuracy requirements of the USB interface, so the IRC oscillator should not be used as the clock source of the USB subsystem (through PLL0) (USB requires a 48MHz clock source with a duty cycle of 50%);
2. If the CAN baud rate is higher than 100kbit/s, the IRC oscillator should not be used as the clock source for the CAN controller (via PLL0)
It is worth mentioning that LPC1768 has a register specifically for the main oscillator called the System Control and Status Register (SCS). Before selecting the main oscillator as the clock source, you need to configure this register. In this register, you can configure the frequency range of the main oscillator, enable the main oscillator, or read the status of the main oscillator (whether it is stable). The bit description is as follows:
Table 2 System Control and Status Register (SCS) bit description
After the clock source is determined, the PLL will up-convert the input clock source and then divide it down to provide the actual clock used by the CPU, peripherals, or USB subsystem. It should be noted that the USB subsystem has its own specific PLL (see the description of "PLL1"). PLL0 can generate clock frequencies up to 100MHz, which is the maximum allowed by the CPU.
The multiplication and division values are changed by writing to MSEL0 and NSEL0 in the PLL0 configuration register (PLL0CFG). The register bit description is shown in Table 2.
Table 3 PLL0 configuration register bit description
Note: When configuring PLL0, the correct feed sequence must be written to the PLL0FEED register for changes in the PLL0CON and PLL0CFG registers to take effect. See the manual for PLL0 Feed Registers.
Formula for PLL0 output frequency (when PLL0 is activated and connected):
Fcco = (2 × M × FIN) / N.
Fcco represents the frequency value output after being processed by PLL0. If you want to provide operating frequency for the CPU and peripherals, they also need to be divided by clock dividers, such as the CPU clock configuration register (CCLKCFG), USB clock configuration register (USBCLKCFG), etc.
If you want to configure the values of M and N as needed, refer to Section 4.5.11 "Process for Determining PLL0 Frequency Parameters" in the "Timing and Power Control" chapter of the manual.
When building the LPC1768 project, we need to add the "system_17XX.c" file. The main function of this file is to configure the system clock. The configuration process is basically the same as this article.
Previous article:LPC1768 -- RTC real-time clock
Next article:LPC1768 -- How to use RTC
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
- How haptic technology can enhance driving safety
- Let’s talk about the “Three Musketeers” of radar in autonomous driving
- Why software-defined vehicles transform cars from tools into living spaces
- How Lucid is overtaking Tesla with smaller motors
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Problems with creating sheet symbols for multi-page schematics
- Zigbee Z-Stack 3.0.1 Modify channels using broadcasting
- The STM32 FFT library calculates the amplitude normally, but the phase is different each time. Has anyone encountered this problem?
- EEWORLD University----UCD3138 Analog Front End (AFE) Module
- "Show goods" to come to a wave of commonly used development boards
- Measurement of the phase difference between a sine wave and a square wave
- [Sipeed LicheeRV 86 Panel Review] - 6 waft-ui component tests (3)
- Hardware System Engineer's Handbook
- Integrated operational amplifier practical circuit diagram
- For electronic hardware, there are many circuit structures, which can be said to be the units that make up a component. All circuits...