常见问答
- M051 系列(95)
- M0518 系列(97)
- M0519 系列(43)
- M0564 系列(1)
- Mini51 系列(90)
- Nano100 / 102 系列(101)
- Nano103 Base 系列(10)
- Nano110 / 112 LCD 系列(100)
- Nano120 USB 系列(111)
- Nano130 USB+LCD 系列(110)
- NUC029 系列(94)
- NUC100 / 200 系列(102)
- NUC120 / 122 / 123 / 220 USB 系列(116)
- NUC121/125 系列(1)
- NUC126 USB 系列(2)
- NUC130 / 230 CAN 系列(103)
- NUC131/NUC1311 CAN 系列(98)
- NUC140 / 240 USB+CAN 系列(114)
- M451 Base 系列(118)
- M451M 系列(117)
- M452 USB 系列(130)
- M4521 USB 系列(1)
- M453 CAN 系列(128)
- M463 CAN FD/USB HS 系列(1)
- M467 Ethernet/Crypto 系列(1)
- M471 系列(1)
- M479 Motor Control Series(1)
- M481 Base 系列(4)
- M482 USB FS OTG 系列(4)
- M483 CAN 系列(4)
- M484 USB HS OTG 系列(4)
- M485 Crypto 系列(4)
- M487 Ethernet 系列(4)
- M4TK 触摸 IC 系列(25)
- NUC442 / 472 系列(130)
- NUC472 Series(1)
- NUC505 系列(138)
よくあるご質問
Why can’t the clock source of HCLK be switched to PLL when the system clock source is initialized with the following commands? CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_HCLKSEL_Msk); CLK->CLKSEL0 |= CLK_CLKSEL0_HCLKSEL_PLL; 日付:2016-11-29
Q: Why can’t the clock source of HCLK be switched to PLL when the system clock source is initialized with the following commands?
CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_HCLKSEL_Msk);
CLK->CLKSEL0 |= CLK_CLKSEL0_HCLKSEL_PLL;
A: In the execution of the first command line,
CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_HCLKSEL_Msk);
HCLKSEL (CLKSEL0 [2: 0]) is set to 0x00. When HCLKSEL is set to 0x00, as shown below, the clock source of HCLK is switched to external crystal.
If the external crystal is not stable or enabled at this time, the switching clock source will fail and the HCLKSEL will be remain its default setting (initialized as 0x07, clock source as HIRC).
Therefore, in the execution of the second command line,
CLK->CLKSEL0 |= CLK_CLKSEL0_HCLKSEL_PLL;
HCLKSEL cannot be correctly set to PLL and HCLK cannot be switched to PLL.
To switch the clock source, user needs to make sure that the clock source to be switched is stable. It is recommended to switch the clock source using the following methods:
1. Write a value directly
CLK->CLKSEL0 = (CLK->CLKSEL0 & ~CLK_CLKSEL0_HCLKSEL_Msk) | CLK_CLKSEL0_HCLKSEL_PLL;
2. Call function
CLK_SetHCLK(CLK_CLKSEL0_HCLKSEL_PLL, CLK_CLKDIV_HCLK(2));
| 製品: | マイクロコントローラ ,8ビット 8051 MCU ,低ピンカウント 8051 シリーズ ,標準 8051 シリーズ ,Arm Cortex-M0 MCU ,M051 ベースシリーズ ,M0518シリーズ ,M0519シリーズ ,ミニ 51 ベースシリーズ ,ナノ 100/102 ベースシリーズ ,Nano103 ベースシリーズ ,ナノ 110/112 LCD シリーズ ,ナノ 120 USB シリーズ ,ナノ 130 アドバンストシリーズ ,NUC029 シリーズ ,NUC100/200 アドバンストシリーズ ,NUC120/122/123/220 USB シリーズ ,NUC130/230 CAN シリーズ ,NUC131/NUC1311 CAN シリーズ ,NUC140/240 コネクティビティシリーズ ,Arm Cortex-M4 MCU ,M451 ベースシリーズ ,M451M シリーズ ,M452 USB シリーズ ,M453 CAN シリーズ ,M4TK タッチキーシリーズ ,NUC442/472 シリーズ ,NUC505 シリーズ |
|---|---|
| アプリケーション: | |
| 機能: | Peripherals,ARM,Cortex-M0,Cortex-M4,Clock Control,HIRC,HXT,PLL |
粤公网安备 44030502010001号