\n

CLK

Peripheral Memory Blocks

address_offset : 0x0 Bytes (0x0)
size : 0x20 byte (0x0)
mem_usage : registers
protection : not protected

address_offset : 0x24 Bytes (0x0)
size : 0x4 byte (0x0)
mem_usage : registers
protection : not protected

Registers

PWRCON

CLKSEL0

CLKSEL1

CLKDIV

CLKSEL2

FRQDIV

AHBCLK

APBCLK

CLKSTATUS


PWRCON

System Power-down Control Register
address_offset : 0x0 Bytes (0x0)
size : -1 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0

PWRCON PWRCON read-write 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Resets to Resets to 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 XTLCLK_EN OSC22M_EN OSC10K_EN PD_WU_DLY PD_WU_INT_EN PD_WU_STS PWR_DOWN_EN PD_32K

XTLCLK_EN : External Crystal HXT Or LXT Enable Control (Write Protect) The default clock source is from HIRC. These two bits are default set to 00 and the XTAL1 and XTAL2 pins are GPIO. Note: To enable the external XTAL function, the P5_ALT[1:0] and P5_MFP[1:0] bits must also be set in P5_MFP.
bits : 0 - 1 (2 bit)
access : read-write

Enumeration:

#00 : 0

XTAL1 and XTAL2 are GPIO, disable both LXT HXT (default)

#01 : 1

HXT Enabled

#10 : 2

LXT Enabled

#11 : 3

XTAL1 is external clock input pin, XTAL2 is GPIO

End of enumeration elements list.

OSC22M_EN : 22.1184 MHz Internal High Speed RC Oscillator (HIRC) Enable Control (Write Protect)\nNote: The default of OSC22M_EN bit is 1.
bits : 2 - 2 (1 bit)
access : read-write

Enumeration:

#0 : 0

22.1184 MHz internal high speed RC oscillator (HIRC) Disabled

#1 : 1

22.1184 MHz internal high speed RC oscillator (HIRC) Enabled

End of enumeration elements list.

OSC10K_EN : 10 KHz Internal Low Speed RC Oscillator (LIRC) Enable Control (Write Protect)\n
bits : 3 - 3 (1 bit)
access : read-write

Enumeration:

#0 : 0

10 kHz internal low speed RC oscillator (LIRC) Disabled

#1 : 1

10 kHz internal low speed RC oscillator (LIRC) Enabled

End of enumeration elements list.

PD_WU_DLY : Wake-up Delay Counter Enable Control (Write Protect)\nWhen the chip wakes up from Power-down mode, the clock control will delay certain clock cycles to wait system clock stable.\nThe delayed clock cycle is 4096 clock cycles when chip work at 4~24 MHz external high speed crystal (HXT), 4096 clock cycles for 32.768 kHz external low speed crystal (LXT), and 16 clock cycles when chip works at 22.1184 MHz internal high speed RC oscillator (HIRC).\n
bits : 4 - 4 (1 bit)
access : read-write

Enumeration:

#0 : 0

Clock cycles delay Disabled

#1 : 1

Clock cycles delay Enabled

End of enumeration elements list.

PD_WU_INT_EN : Power-down Mode Wake-up Interrupt Enable Control (Write Protect)\nNote: The interrupt will occur when both PD_WU_STS and PD_WU_INT_EN are high.
bits : 5 - 5 (1 bit)
access : read-write

Enumeration:

#0 : 0

Disabled

#1 : 1

Enabled

End of enumeration elements list.

PD_WU_STS : Power-down Mode Wake-up Interrupt Status Set by Power-down wake-up event , which indicates that resume from Power-down mode The flag is set if the GPIO, UART, WDT, I2C, ACMP, Timer or BOD wake-up occurred. Note: This bit works only if PD_WU_INT_EN (PWRCON[5]) set to 1. Write 1 to clear the bit to 0.
bits : 6 - 6 (1 bit)
access : read-write

PWR_DOWN_EN : System Power-down Enable Bit (Write Protect)\nWhen chip wakes up from Power-down mode, this bit is cleared by hardware. User needs to set this bit again for next Power-down.\nIn Power-down mode, 4~24 MHz external high speed crystal oscillator (HXT), 32.768 kHz external low speed crystal oscillator (LXT), and the 22.1184 MHz internal high speed oscillator (HIRC) will be disabled in this mode, and 10 kHz internal low speed RC oscillator (LIRC) are not controlled by Power-down mode.\nIn Power-down mode, the system clock is disabled, and ignored the clock source selection. The clocks of peripheral are not controlled by Power-down mode, if the peripheral clock source is from 10 kHz internal low speed oscillator.\n
bits : 7 - 7 (1 bit)
access : read-write

Enumeration:

#0 : 0

Chip operating normally or chip in Idle mode because of WFI command

#1 : 1

Chip enters Power-down mode instantly or waits CPU sleep command WFI

End of enumeration elements list.

PD_32K : Enable LXT In Power-down Mode\nThis bit controls the crystal oscillator active or not in Power-down mode.\n
bits : 9 - 9 (1 bit)
access : read-write

Enumeration:

#0 : 0

No effect to Power-down mode

#1 : 1

If XTLCLK_EN[1:0] = 10, LXT is still active in Power-down mode

End of enumeration elements list.


CLKSEL0

Clock Source Select Control Register 0
address_offset : 0x10 Bytes (0x0)
size : -1 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0

CLKSEL0 CLKSEL0 read-write 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Resets to Resets to 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 HCLK_S STCLK_S

HCLK_S : HCLK Clock Source Selection (Write Protect)\nNote1: Before clock switching, the related clock sources (both pre-select and new-select) must be turn-on and stable.\nNote2: These bits are protected bit, and programming them needs to write 0x59, 0x16, and 0x88 to address 0x5000_0100 to disable register protection. Refer to the register REGWRPROT at address GCR_BA + 0x100.\nNote3: To set PWRCON[1:0], select HXT or LXT crystal clock.
bits : 0 - 2 (3 bit)
access : read-write

Enumeration:

#000 : 0

Clock source is from HXT or LXT

#001 : 1

Reserved

#010 : 2

Reserved

#011 : 3

Clock source is from LIRC

#111 : 7

Clock source is from HIRC

End of enumeration elements list.

STCLK_S : Cortex-M0 SysTick Clock Source Selection From Reference Clock (Write Protect)\nNote3: To set PWRCON[1:0], select HXT or LXT crystal clock.
bits : 3 - 5 (3 bit)
access : read-write

Enumeration:

#000 : 0

Clock source is from HXT or LXT

#001 : 1

Reserved

#010 : 2

Clock source is from HXT/2 or LXT/2

#011 : 3

Clock source is from HCLK/2

#111 : 7

Clock source is from HIRC /2

End of enumeration elements list.


CLKSEL1

Clock Source Select Control Register 1
address_offset : 0x14 Bytes (0x0)
size : -1 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0

CLKSEL1 CLKSEL1 read-write 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Resets to Resets to 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 WDT_S ADC_S SPI_S TMR0_S TMR1_S UART_S

WDT_S : WDT CLK Clock Source Selection (Write Protect)\nNote1: These bits are the protected bit, and programming them needs to write 0x59, 0x16, and 0x88 to address 0x5000_0100 to disable register protection. Refer to the register REGWRPROT at address GCR_BA + 0x100.\nNote2: To set PWRCON[1:0], select HXT or LXT crystal clock.
bits : 0 - 1 (2 bit)
access : read-write

Enumeration:

#00 : 0

Clock source is from HXT or LXT

#01 : 1

Reserved

#10 : 2

Clock source is from HCLK/2048 clock

#11 : 3

Clock source is from LIRC

End of enumeration elements list.

ADC_S : ADC Peripheral Clock Source Selection\nNote: To set PWRCON[1:0], select HXT or LXT crystal clock.
bits : 2 - 3 (2 bit)
access : read-write

Enumeration:

#00 : 0

Clock source is from HXT or LXT

#01 : 1

Reserved

#10 : 2

Clock source is from HCLK

#11 : 3

Clock source is from HIRC

End of enumeration elements list.

SPI_S : SPI Clock Source Selection\nNote: To set PWRCON[1:0], select HXT or LXT crystal clock.
bits : 4 - 4 (1 bit)
access : read-write

Enumeration:

#0 : 0

Clock source is from HXT or LXT

#1 : 1

Clock source is from HCLK

End of enumeration elements list.

TMR0_S : TIMER0 Clock Source Selection\nNote: To set PWRCON[1:0], select HXT or LXT crystal clock.
bits : 8 - 10 (3 bit)
access : read-write

Enumeration:

#000 : 0

Clock source is from HXT or LXT

#001 : 1

Clock source is from LIRC

#010 : 2

Clock source is from HCLK

#011 : 3

Clock source is from external trigger

#111 : 7

Clock source is from HIRC

End of enumeration elements list.

TMR1_S : TIMER1 Clock Source Selection\nNote: To set PWRCON[1:0], select HXT or LXT crystal clock.
bits : 12 - 14 (3 bit)
access : read-write

Enumeration:

#000 : 0

Clock source is from HXT or LXT

#001 : 1

Clock source is from LIRC

#010 : 2

Clock source is from HCLK

#011 : 3

Clock source is from external trigger

#111 : 7

Clock source is from HIRC

End of enumeration elements list.

UART_S : UART Clock Source Selection\nNote: To set PWRCON[1:0], select HXT or LXT crystal clock.
bits : 24 - 25 (2 bit)
access : read-write

Enumeration:

#00 : 0

Clock source is from HXT or LXT

#01 : 1

Reserved

#10 : 2

Clock source is from HIRC

#11 : 3

Clock source is from HIRC

End of enumeration elements list.


CLKDIV

Clock Divider Number Register
address_offset : 0x18 Bytes (0x0)
access : read-write
reset_value : 0x0
reset_Mask : 0x0

CLKDIV CLKDIV read-write 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Resets to Resets to 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 HCLK_N UART_N ADC_N

HCLK_N : HCLK Clock Divide Number From HCLK Clock Source\n
bits : 0 - 3 (4 bit)
access : read-write

UART_N : UART Clock Divide Number From UART Clock Source\n
bits : 8 - 11 (4 bit)
access : read-write

ADC_N : ADC Peripheral Clock Divide Number From ADC Peripheral Clock Source\n
bits : 16 - 23 (8 bit)
access : read-write


CLKSEL2

Clock Source Select Control Register 2
address_offset : 0x1C Bytes (0x0)
size : -1 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0

CLKSEL2 CLKSEL2 read-write 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Resets to Resets to 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 FRQDIV_S

FRQDIV_S : Clock Divider Clock Source Selection\nNote: To set PWRCON[1:0], select HXT or LXT crystal clock.
bits : 2 - 3 (2 bit)
access : read-write

Enumeration:

#00 : 0

Clock source is from HXT or LXT

#01 : 1

Reserved

#10 : 2

Clock source is from HCLK

#11 : 3

Clock source is from HIRC

End of enumeration elements list.


FRQDIV

Frequency Divider Control Register
address_offset : 0x24 Bytes (0x0)
access : read-write
reset_value : 0x0
reset_Mask : 0x0

FRQDIV FRQDIV read-write 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Resets to Resets to 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 FSEL DIVIDER_EN DIVIDER1

FSEL : Divider Output Frequency Selection\nThe formula of output frequency is\nFin is the input clock frequency.\nFout is the frequency of divider output clock.\nN is the 4-bit value of FSEL[3:0].
bits : 0 - 3 (4 bit)
access : read-write

DIVIDER_EN : Frequency Divider Enable Control\n
bits : 4 - 4 (1 bit)
access : read-write

Enumeration:

#0 : 0

Frequency Divider Disabled

#1 : 1

Frequency Divider Enabled

End of enumeration elements list.

DIVIDER1 : Frequency Divider 1 Enable Control\n
bits : 5 - 5 (1 bit)
access : read-write

Enumeration:

#0 : 0

Divider output frequency is depended on FSEL value

#1 : 1

Divider output frequency is the same as input clock frequency

End of enumeration elements list.


AHBCLK

AHB Devices Clock Enable Control Register
address_offset : 0x4 Bytes (0x0)
size : -1 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0

AHBCLK AHBCLK read-write 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Resets to Resets to 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ISP_EN

ISP_EN : Flash ISP Controller Clock Enable Control\n
bits : 2 - 2 (1 bit)
access : read-write

Enumeration:

#0 : 0

Flash ISP peripheral clock Disabled

#1 : 1

Flash ISP peripheral clock Enabled

End of enumeration elements list.


APBCLK

APB Devices Clock Enable Control Register
address_offset : 0x8 Bytes (0x0)
size : -1 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0

APBCLK APBCLK read-write 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Resets to Resets to 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 WDT_EN TMR0_EN TMR1_EN FDIV_EN I2C_EN SPI_EN UART_EN PWM01_EN PWM23_EN PWM45_EN ADC_EN ACMP_EN

WDT_EN : Watchdog Timer Clock Enable Control (Write Protect)\nNote: This bit is the protected bit, and programming it needs to write 0x59, 0x16, and 0x88 to address 0x5000_0100 to disable register protection. Refer to the register REGWRPROT at address GCR_BA + 0x100.
bits : 0 - 0 (1 bit)
access : read-write

Enumeration:

#0 : 0

Watchdog Timer clock Disabled

#1 : 1

Watchdog Timer clock Enabled

End of enumeration elements list.

TMR0_EN : Timer0 Clock Enable Control\n
bits : 2 - 2 (1 bit)
access : read-write

Enumeration:

#0 : 0

Timer0 clock Disabled

#1 : 1

Timer0 clock Enabled

End of enumeration elements list.

TMR1_EN : Timer1 Clock Enable Control\n
bits : 3 - 3 (1 bit)
access : read-write

Enumeration:

#0 : 0

Timer1 clock Disabled

#1 : 1

Timer1 clock Enabled

End of enumeration elements list.

FDIV_EN : Frequency Divider Output Clock Enable Control\n
bits : 6 - 6 (1 bit)
access : read-write

Enumeration:

#0 : 0

FDIV clock Disabled

#1 : 1

FDIV clock Enabled

End of enumeration elements list.

I2C_EN : I2C Clock Enable Control\n
bits : 8 - 8 (1 bit)
access : read-write

Enumeration:

#0 : 0

I2C clock Disabled

#1 : 1

I2C clock Enabled

End of enumeration elements list.

SPI_EN : SPI Peripheral Clock Enable Control\n
bits : 12 - 12 (1 bit)
access : read-write

Enumeration:

#0 : 0

SPI peripheral clock Disabled

#1 : 1

SPI peripheral clock Enabled

End of enumeration elements list.

UART_EN : UART Clock Enable Control\n
bits : 16 - 16 (1 bit)
access : read-write

Enumeration:

#0 : 0

UART clock Disabled

#1 : 1

UART clock Enabled

End of enumeration elements list.

PWM01_EN : PWM_01 Clock Enable Control\n
bits : 20 - 20 (1 bit)
access : read-write

Enumeration:

#0 : 0

PWM01 clock Disabled

#1 : 1

PWM01 clock Enabled

End of enumeration elements list.

PWM23_EN : PWM_23 Clock Enable Control\n
bits : 21 - 21 (1 bit)
access : read-write

Enumeration:

#0 : 0

PWM23 clock Disabled

#1 : 1

PWM23 clock Enabled

End of enumeration elements list.

PWM45_EN : PWM_45 Clock Enable Control\n
bits : 22 - 22 (1 bit)
access : read-write

Enumeration:

#0 : 0

PWM45 clock Disabled

#1 : 1

PWM45 clock Enabled

End of enumeration elements list.

ADC_EN : Analog-digital-converter (ADC) Clock Enable Control\n
bits : 28 - 28 (1 bit)
access : read-write

Enumeration:

#0 : 0

ADC peripheral clock Disabled

#1 : 1

ADC peripheral clock Enabled

End of enumeration elements list.

ACMP_EN : Analog Comparator Clock Enable Control\n
bits : 30 - 30 (1 bit)
access : read-write

Enumeration:

#0 : 0

Analog Comparator clock Disabled

#1 : 1

Analog Comparator clock Enabled

End of enumeration elements list.


CLKSTATUS

Clock Status Monitor Register
address_offset : 0xC Bytes (0x0)
size : -1 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0

CLKSTATUS CLKSTATUS read-write 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Resets to Resets to 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 XTL_STB OSC10K_STB OSC22M_STB CLK_SW_FAIL

XTL_STB : HXT Or LXT Clock Source Stable Flag
bits : 0 - 0 (1 bit)
access : read-write

Enumeration:

#0 : 0

HXT or LXT clock is not stable or disabled

#1 : 1

HXT or LXT clock is stable

End of enumeration elements list.

OSC10K_STB : LIRC Clock Source Stable Flag (Read Only)\n
bits : 3 - 3 (1 bit)
access : read-only

Enumeration:

#0 : 0

LIRC clock is not stable or disabled

#1 : 1

LIRC clock is stable

End of enumeration elements list.

OSC22M_STB : HIRC Clock Source Stable Flag (Read Only)\n
bits : 4 - 4 (1 bit)
access : read-only

Enumeration:

#0 : 0

HIRC clock is not stable or disabled

#1 : 1

HIRC clock is stable

End of enumeration elements list.

CLK_SW_FAIL : Clock Switch Fail Flag\nNote1: This bit is updated when software switches system clock source. If switch target clock is stable, this bit will be set to 0. If switch target clock is not stable, this bit will be set to 1.\nNote2: This bit is read only. After selected clock source is stable, hardware will switch system clock to selected clock automatically, and CLK_SE_FAIL will be cleared automatically by hardware.
bits : 7 - 7 (1 bit)
access : read-write

Enumeration:

#0 : 0

Clock switching success

#1 : 1

Clock switching failed

End of enumeration elements list.



Is something missing? Is something wrong? can you help correct it ? Please contact us at info@chipselect.org !

This website is sponsored by EmbeetleEmbeetle, an IDE designed from scratch for embedded software developers.