Nations N32G430 Series User Manual

32-bit arm cortex-m4 microcontroller
Hide thumbs Also See for N32G430 Series:
Table of Contents

Advertisement

N32G430 series
32-bit ARM® Cortex®-M4 microcontroller
User manual V1.0

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the N32G430 Series and is the answer not in the manual?

Questions and answers

Summary of Contents for Nations N32G430 Series

  • Page 1 N32G430 series 32-bit ARM® Cortex®-M4 microcontroller User manual V1.0...
  • Page 2: Table Of Contents

    Clock control unit ..............................75 Clock Tree Diagram ............................76 HSE clock ..............................76 HSI clock ............................... 77 Nations Technologies Inc. 2 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 3 GPIOD register overview ..........................132 GPIO port mode description register (GPIOx_PMODE)................133 GPIO port type definition (GPIOx_POTYPE) .................... 134 Nations Technologies Inc. 3 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 4 Software Interrupt Event Register(EXTI_SWIE) ..................187 Interrupt Request Pending Register(EXTI_PEND) ..................188 RTC Timestamp Selection Register(EXTI_TS_SEL) .................. 188 DMA controller ................................190 Nations Technologies Inc. 4 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 5 CRC cyclic redundancy check code register (CRC_CRC16D) ..............211 LRC result register (CRC_LRC) ........................212 Advanced-control timers (TIM1 and TIM8) ......................... 213 Nations Technologies Inc. 5 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 6 Capture/compare register 3 (TIMx_CCDAT3) ..................283 Capture/compare register 4 (TIMx_CCDAT4) ..................284 Break and Dead-time registers (TIMx_BKDT) ..................285 Nations Technologies Inc. 6 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 7 Capture/compare enable registers (TIMx_CCEN)................... 344 Counters (TIMx_CNT) ..........................346 Prescaler (TIMx_PSC) ..........................346 Auto-reload register (TIMx_AR) ......................346 Nations Technologies Inc. 7 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 8 Trigger multiplexer ..........................367 Operating mode ............................368 Waveform generation ..........................371 Register update ............................372 Counter mode............................373 Nations Technologies Inc. 8 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 9 WWDG configuration flow ........................396 WWDG registers ..............................397 WWDG register Map ..........................397 WWDG control register (WWDG_CTRL) ....................397 Nations Technologies Inc. 9 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 10 ADC regulars data register (ADC_DAT) ....................425 ADC differential mode selection register (ADC_DIFSEL) ..............426 ADC calibration factor (ADC_CALFACT)..................426 Nations Technologies Inc. 10 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 11 DMA application ............................. 460 Packet error check ............................ 462 Noise filter ............................... 462 SMBus ..............................462 Debug mode ................................465 Nations Technologies Inc. 11 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 12 USART control register 2 register (USART_CTRL2) ................516 USART control register 3 register (USART_CTRL3) ................517 USART guard time and prescaler register (USART_GTP)..............519 Nations Technologies Inc. 12 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 13 GPIOs of RTC............................562 RTC register write protection ........................562 RTC clock and prescaler .......................... 563 RTC calendar ............................563 Nations Technologies Inc. 13 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 14 Setup freqeuency for pre-scale ratio of beeper ..................590 Bypass clock ............................591 Output Duty cycle ............................ 591 Nations Technologies Inc. 14 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 15 Low power mode support ........................641 Peripheral debugging support ........................641 DBG registers ............................... 642 DBG register overview ..........................642 Nations Technologies Inc. 15 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 16 Introduction ................................645 UID register ................................645 UCID register ............................... 645 Version history ................................646 Notice ..................................647 Nations Technologies Inc. 16 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 17 Table 5-17 USART2 alternate function remapping ..................119 Table 5-18 UART3 alternate function remapping..................... 119 Table 5-19 UART4 alternate function remapping.................... 120 Nations Technologies Inc. 17 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 18 Table 5-48 GPIOB register overview ......................129 Table 5-49 GPIOC register overview ......................130 Table 5-50 GPIOD register overview ......................132 Nations Technologies Inc. 18 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 19 Table 15-2 Analog watchdog channel selection ....................405 Table 15-3 Right-align data ..........................409 Table 15-4 Left-aligne data ..........................409 Nations Technologies Inc. 19 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 20 Table 22-4 CAN register overview ........................615 Table 23-1 Debug port pin ..........................641 Table 23-2 DBG register overview ........................642 Nations Technologies Inc. 20 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 21 Figure 9-10 CCDATx(x=4,7,8,9), trigger ADC when DIR = 0 ............... 224 Figure 9-11 CCDATx(x=4,7,8,9), trigger ADC when DIR = 1 ............... 225 Nations Technologies Inc. 21 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 22 Figure 9-41 Example of Hall sensor interface ....................256 Figure 10-1 Block diagram of TIMx(x = 2, 3, 4 and 5) ................294 Nations Technologies Inc. 22 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 23 Figure 10-31 Triggers timers 1 and 2 using the TI1 input of TIM1 ..............325 Figure 10-32 Example of counter operation in encoder interface mode ............327 Nations Technologies Inc. 23 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 24 Figure 17-4 Transfer sequence diagram of slave receiver ................455 Figure 17-5 Master transmitter transmission sequence diagram ..............457 Nations Technologies Inc. 24 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 25 Figure 19-6 Schematic diagram of TE/BUSY change when the host transmits continuously in one-way only mode ................................ 527 Nations Technologies Inc. 25 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 26 Figure 22-5 silent mode ........................... 599 Figure 22-6 loopback silent mode ........................599 Figure 22-7 Send mailbox status ........................602 Nations Technologies Inc. 26 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 27 Figure 22-14 CAN error state diagram ......................612 Figure 23-1 N32G430 level and Cortex®-M4 level debugging block diagram ..........639 Nations Technologies Inc. 27 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 28: Abbreviations In The Text

    For all models of N32G430 microcontroller series, the existence and number of a peripheral, please refer to the data sheet of the corresponding model. Nations Technologies Inc. 28 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 29: Memory And Bus Architecture

    TIM1 TIM3 UART3 IWDG TIM4 TIM8 WWDG TIM5 UART4 EXTI COMP USART2 Beeper SPI1/I2S1 I2C1 TIM6 I2C2 SPI2/I2S2 Nations Technologies Inc. 29 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 30: Bus Address Mapping

    Atomic accesses can be made through the bit-band Alias to performed read-modify-write operations on the target bits of the bit-band region. The specific mapping is as follows: Nations Technologies Inc. 30 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 31: Figure 2-2 Bus Address Map

    0x0001 0000 - 0x07FF FFFF Aliased to TIM2 0x4000 0000 - 0x4000 03FF 0x0000 0000 - 0x0000 FFFF Flash/SystemMemory/Sram Nations Technologies Inc. 31 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 32: Table 2-1 List Of Peripheral Register Addresses

    0x4001_1000 – 0x4001_13FF Reserved 0x4001_0C00 – 0x4001_0FFF Reserved 0x4001_0800 – 0x4001_0BFF Beeper 0x4001_0400 – 0x4001_07FF EXTI 0x4001_0000 – 0x4001_03FF AFIO Nations Technologies Inc. 32 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 33 Both the peripheral registers and SRAM are mapped into a bit-band area, which allows a single bit-band area write and read operation to be performed. Nations Technologies Inc. 33 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 34: Boot Management

     System memory can be accessed in two address areas, 0x0000_0000 or 0x1FFF_0000 (ICode/DCode/DMA);  Boot from the built-in SRAM:  The built-in SRAM is mapped to boot space (0x0000_0000); Nations Technologies Inc. 34 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 35: Memory System

    FLASH specification Flash consists of a main storage area and an information area, which are described separately below: Nations Technologies Inc. 35 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 36: Table 2-3 Flash Bus Address List

    USART1 serial interface to program the flash memory.  System configuration area, which contains basic information of the chip. Nations Technologies Inc. 36 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 37  Set the FLASH_CTRL.PER bit to' 1';  Select the page to be erased with the FLASH_ADD register; Nations Technologies Inc. 37 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 38 Check the FLASH_ STS.BUSY bit to confirm that there are no other flash operations in progress;  Unlock the FLASH_CTRL.OPTWE bit; Nations Technologies Inc. 38 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 39 0xFF. When the option byte and its complement are both 0xFF (the state after erasing), the above verification steps are skipped and verification is not required. Nations Technologies Inc. 39 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 40: Table 2-4 Option Byte List

    0:Reset occurs when entering stop0/stop2 mode 1:No reset occurs when entering stop0/stop2 mode  USER[0]:WDG_SW configuration options, read through FLASH_OB [2] Nations Technologies Inc. 40 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 41 Read protection is set by configuring RDP bytes in the option byte block. Three different read protection levels can be configured, as shown in the following Table Nations Technologies Inc. 41 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 42: Table 2-5 Read Protection Configuration List

    RDP value 0xA5) will be reloaded into the system, and the read protection will be released;  The following access operations to the flash memory will be prohibited: Nations Technologies Inc. 42 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 43: Table 2-6 Flash Read-Write-Erase Permission Control Table

    L0, the main storage area will be Read-Write- Read-Write- Read-Write- automatically erased. Flash option byte area Read-Write-Erase Erase Erase Erase Nations Technologies Inc. 43 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 44 Erase Erase Allow to change to L1 level or L2 Flash memory mass allow allow allow allow erase Nations Technologies Inc. 44 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 45 L2 protection level, unable to boot from SRAM erase level JTAG/SWD is prohibited. Flash option byte area Flash system storage Nations Technologies Inc. 45 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 46 Flash option byte area Read-Write-Erase Erase Erase Erase automatically erased. prohibit prohibit Read-Write-Erase prohibit Flash system storage Nations Technologies Inc. 46 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 47: Icache

    CPU will be able to work at a higher frequency. When the instruction requested by the CPU is in the Nations Technologies Inc. 47 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 48 The iCache is designed as instruction cache. When the instruction is updated by application software or the instruction Nations Technologies Inc. 48 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 49: Sram

     I/D/S/DMA can be accessed.  I/D BUS can run programs at full speed from Remap to SRAM. Nations Technologies Inc. 49 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 50: Flash Register Description

    FLASH_CAHR 030h Reserved Reset Value FLASH control and status register See for abbreviations in register descriptions 1.1 section. Nations Technologies Inc. 50 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 51 011: three cycle delay, when 96MHz < HCLK Other values: reserved 2.2.4.2.2 The FLASH key register (FLASH_KEY) Address offset: 0x04 Reset value: 0x0000 0000 Nations Technologies Inc. 51 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 52 '1', and writing '1' can clear this bit. Reserved Reserved, the reset value must be maintained. PGERR Programming error Nations Technologies Inc. 52 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 53 After detecting the correct unlocking sequence, hardware clears this bit to '0'. After an unsuccessful unlocking operation, this bit cannot be changed until the Nations Technologies Inc. 53 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 54 Note: When the FLASH_STS.BUSY bit is '1', this register cannot be written. 2.2.4.2.7 The FLASH Option byte register 2 (FLASH_OB2) Address offset: 0x18 Reset value: 0x0c800000 Nations Technologies Inc. 54 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 55 Not used (if these bits are written in the Flash option byte, they will be read in this register with no effect on the device.) IWDGSLEEPFRZ IWDG to freeze in sleep mode Nations Technologies Inc. 55 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 56 When this bit is '1', it means that the option byte does not match its complement. Note: This bit is read-only. 2.2.4.2.9 Write protection register (FLASH_WRP) Address offset: 0x20 Reset value: 0x0000 FFFF Nations Technologies Inc. 56 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 57 (see for detailed operation instructions 2.2.2.3.3 iCache locking Chapter). 0: disable 1: enable LOCKSTRT[3:0] iCache lock start. 0: disable 1: enable Nations Technologies Inc. 57 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 58: Power Control (Pwr)

     STOP2 mode: Turn off MR and switch to BKR power supply to save register and SRAM contents. Nations Technologies Inc. 58 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 59: Power Supply Supervisor

    Refer to the electrical characteristics section of the data sheet for details on power-on and power-off resets. Nations Technologies Inc. 59 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 60: Figure 3-2 Power On Reset/Power Down Reset Waveform

    16. For example, this feature can be used to perform emergency shutdown tasks. Figure 3-3 PVD threshold diagram VDD/VDDA 100mV PVD threshold hysteresis PVD output Nations Technologies Inc. 60 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 61: Nrst

    1, no pending interrupt/event. except NRST, PA0_WKUP, PA8, Reset after wakeup, all needs to be Nations Technologies Inc. 61 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 62: Table 3-2 Modules Running Status

    Sleep Wakeup Wakeup Wakeup capability capability capability Flash memory SRAM Backup Registers POR(VDDD) POR(VDDA) POR(VDDBK) Clock Security System Nations Technologies Inc. 62 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 63: Sleep Mode

    The CPU stops and all peripherals including peripherals around the Cortex®-M4 core (such as NVIC, SysTick, etc.) can run and wake up the CPU when an interrupt or event occurs. Nations Technologies Inc. 63 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 64: Stop0 Mode

    Independent Watchdog (IWDG) optional: Once enabled, it will keep counting until a reset is generated.  RTC optional: It can be turned on by RCC_BDCTRL.RTCEN. Nations Technologies Inc. 64 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 65: Stop2 Mode

    HSI RC oscillator is set as the system clock when STOP2 mode is waken up by an interrupt or wake-up event. The codes will resume execution after STOP2 wakeup from where it stopped. Peripheral initialization is needed after Nations Technologies Inc. 65 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 66: Standby Mode

    After waking up from STANDBY mode, code execution is same as power on (boot pin is detected, reset vector initialization, etc.). PWR_CTRLSTS.STBYF flag indicates that MCU exits from STANDBY mode. Nations Technologies Inc. 66 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 67: Pwr Registers

    Clear PA8 wakeup flag. This bit is always read as 0. 0: No effect 1: Clear the wakeup flag after 2 System clock cycles. Nations Technologies Inc. 67 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 68 0: No effect. 1: Clear the STANDBY.STBYF Flag . Reserved Reserved, the reset value must be maintained. Power down deep-sleep. Nations Technologies Inc. 68 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 69: Power Control Status Register (Pwr_Ctrlsts)

    1: Falling edge WKUPRTCEN RTC internal wakeup enable 0: Wakeup is disabled 1: Wakeup is enabled WKUP3EN Enable PC13_WKUP pin Nations Technologies Inc. 69 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 70 Hardware will set this bit. it can be cleared by hardware, by a system reset or by setting PWR_CTRL.CLRWKUP1. 0: No wakeup event occurred 1: A wakeup event was received from the WKUP pin Nations Technologies Inc. 70 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 71: Power Control Register 2(Pwr_Ctrl2)

    1: SRAM is in retention in STANDBY mode. Reserved Reserved, the reset value must be maintained. STOP2S STOP2 sleep mode control. 0: No-effect Nations Technologies Inc. 71 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 72 Bit field Name Description 1: Chip is set to be in STOP2 mode. Nations Technologies Inc. 72 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 73: Reset And Clock Control (Rcc)

     Window watchdog end of count condition (WWDG reset)  Independent watchdog end of count condition (IWDG reset) Nations Technologies Inc. 73 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 74: Figure 4-1 System Reset Generation

    WWDG reset MMU reset Pulse Power reset Generator SW reset (min 20us) BKP EMC reset Low Power Management reset Nations Technologies Inc. 74 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 75: Backup Domain Reset

    FCLK is the free-running clock of Cortex™-M4F. For more details, refer to the ARM Cortex™-M4 technical reference manual. Nations Technologies Inc. 75 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 76: Clock Tree Diagram

    The high-speed external clock signal (HSE) can be generated from the following two clock sources:  HSE external crystal/ceramic resonator  HSE user external clock Nations Technologies Inc. 76 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 77: Hsi Clock

    If the HSE crystal oscillator fails, the HSI clock can be used as a backup source. Refer to section 4.3.8 Clock security system (CLKSS). Nations Technologies Inc. 77 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 78: Pll Clock

    HSE. The software can obtain the accurate RTC clock base by adjusting the prescaler of the RTC, and obtain the accurate independent watchdog (IWDG) timeout time by Nations Technologies Inc. 78 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 79: System Clock (Sysclk) Selection

    LSE fault. When LSE and LSI are enabled and ready, the RCC_BDCTRL.LSECLKSSEN bit must be enabled after configuring the RCC_BDCTRL.RTCSEL to select the RTC clock source. Nations Technologies Inc. 79 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 80: Rtc Clock

     SYSCLK    PLL clock division   The clock selection is controlled by RCC_CFG.MCO[3:0] bits. Nations Technologies Inc. 80 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 81: Rcc Registers

    Reserved Reserved Reserved Reserved Reset Value RCC_BDCTRL 020h Reserved Reserved Reserved Reset Value RCC_CTRLSTS 024h Reserved Reset Value Nations Technologies Inc. 81 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 82: Clock Control Register (Rcc_Ctrl)

    This bit cannot be cleared when PLL is used as the system clock. 0: Disable PLL 1: Enable PLL Nations Technologies Inc. 82 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 83 HSI oscillator. This bit cannot be reset if the HSI is used directly or indirectly as system clock. 0: Disable HSI oscillator 1: Enable HSI oscillator Nations Technologies Inc. 83 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 84: Clock Configuration Register (Rcc_Cfg)

    When the system clock is output to the MCO pin, it should be ensured that the output clock frequency does not exceed the maximum frequency of the I/O Nations Technologies Inc. 84 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 85 Set and cleared by software to divide HSE before PLL entry. This bit can only be written when PLL is disabled. 0: HSE clock not divided Nations Technologies Inc. 85 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 86 01: HSE oscillator used as system clock 10: PLL used as system clock 11: Not applicable SCLKSW[1:0] System clock switch Nations Technologies Inc. 86 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 87: Clock Interrupt Register (Rcc_Clkint)

    Set by the software to clear the CLKSSIF flag. 0: No effect 1: Clear the CLKSSIF flag 22:21 Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 87 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 88 Set and cleared by software to enable and disable LSI ready interrupt. 0: Disable LSI ready interrupt 1: Enable LSI ready interrupt CLKSSIF Clock security system interrupt flag Nations Technologies Inc. 88 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 89: Apb2 Peripheral Reset Register (Rcc_Apb2Prst)

    1: Clock ready interrupt caused by LSI oscillator APB2 Peripheral Reset Register (RCC_APB2PRST) Address offset: 0x0c Reset value: 0x0000 0000 Nations Technologies Inc. 89 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 90 AFIORST Alternate function IO reset Set and cleared by software. 0: Clear the reset 1: Reset Alternate Function Nations Technologies Inc. 90 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 91: Apb1 Peripheral Reset Register (Rcc_Apb1Prst)

    Set and cleared by software. 0: Clear the reset 1: Reset window watchdog 10:7 Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 91 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 92: Ahb Peripheral Clock Enable Register (Rcc_Ahbpclken)

    Reserved Reserved, the reset value must be maintained. ADCEN ADC interface clock enable Set and cleared by software. Nations Technologies Inc. 92 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 93 Reserved, the reset value must be maintained. DMAEN DMA clock enable Set and cleared by software. 0: DMA clock disabled 1: DMA clock enabled Nations Technologies Inc. 93 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 94: Apb2 Peripheral Clock Enable Register (Rcc_Apb2Pclken)

    TIM1 timer clock enable Set and cleared by software. 0: TIM1 timer clock disabled 1: TIM1 timer clock enabled Nations Technologies Inc. 94 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 95: Apb1 Peripheral Clock Enable Register (Rcc_Apb1Pclken)

    1: I2C2 clock enabled I2C1EN I2C1 clock enable Set and cleared by software. 0: I2C1 clock disabled 1: I2C1 clock enabled Nations Technologies Inc. 95 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 96 TIM2EN TIM2 timer clock enable Set and cleared by software. 0: TIM2 clock disabled 1: TIM2 clock enabled Nations Technologies Inc. 96 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 97: Backup Domain Control Register (Rcc_Bdctrl)

    In debug mode, set and cleared by software to bypass oscillator. This bit can only be written when the external low-speed oscillator is disabled. Nations Technologies Inc. 97 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 98: Clock Control/Status Register (Rcc_Ctrlsts)

    1: Window watchdog reset occurred IWDGRSTF Independent watchdog reset flag Set by hardware when an independent watchdog reset occurs Nations Technologies Inc. 98 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 99 0: Internal 40KHz RC oscillator clock not ready 1: Internal 40KHz RC oscillator clock ready LSIEN Internal low-speed oscillator enable Set and cleared by software. Nations Technologies Inc. 99 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 100: Ahb Peripheral Reset Register (Rcc_Ahbprst)

    0: Clear the reset 1: Reset IO Port A Block Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 100 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 101: Clock Configuration Register 2 (Rcc_Cfg2)

    0xxxx: ADC PLL clock is disabled 10000: PLL clock not divided 10001: PLL clock divided by 2 10010: PLL clock divided by 4 Nations Technologies Inc. 101 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 102: Retention Domain Control Register (Rcc_Rdctrl)

    Reserved, the reset value must be maintained. LPTIMERRST LPTIMER reset Set and cleared by software. 0: Clear the reset 1: Reset LPTIMER Nations Technologies Inc. 102 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 103: Pll And Hsi Configuration Register (Rcc_Pllhsipre)

    1: HSI clock divided by 2 AHB Peripheral Clock Enable Register 1 (RCC_AHB1CLKEN) Address offset: 0x80 Reset value: 0x0000 003E Nations Technologies Inc. 103 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 104 ADC_HCLK interface clock enable Set and cleared by software. 0: ADC_HCLK interface clock disabled 1: ADC_HCLK interface clock enabled Nations Technologies Inc. 104 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 105: Gpio And Afio

    In this way, there is no risk of an IRQ occurring between the read and the modify access. Nations Technologies Inc. 105 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 106: Function Description

    Alternate function push-pull + pull-up Alternate function push-pull + pull-down Reserved Alternate function open-drain Alternate function open-drain + pull-up Nations Technologies Inc. 106 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 107: Table 5-2 I/O List Of Functional Features Of The Pin

    OPEN DRAIN Disabled Disabled resistance of GPIO data is "0", when "1" high resistance of GPIO when "1" Nations Technologies Inc. 107 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 108: Figure 5-2 Alternate Function Mode

    I/O Pin Pull diode down Read Input data register TTL Schmitt trigger Alternate function input To on-chip peripheral Nations Technologies Inc. 108 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 109: Figure 5-3 Input Floating / Pull-Up / Pull-Down Configuration Mode

    In open drain mode, the I/O state can be obtained by reading the input data register.  In push-pull mode, the read access to the output data register gets the last written value. Nations Technologies Inc. 109 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 110: Figure 5-4 Output Mode

    Analog From on-chip peripheral I/O Pin diode Read Input data register TTL Schmitt trigger Analog To on-chip peripheral Nations Technologies Inc. 110 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 111: Status After Reset

    '1' is set or cleared accordingly, and the bit not written with '1' will not be changed. The software does not need to disable interrupts, and is completed in a single AHB write operation. Nations Technologies Inc. 111 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 112: External Interrupt /Wakeup Line

    EXTI1[5:0] bits in the AFIO_EXTI_CFG1 register EXTI1 PD14 PD15 EXTI15[5:0] bits in the AFIO_EXTI_CFG4 register EXTI15 PD14 PD15 Nations Technologies Inc. 112 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 113: Alternate Function

    GPIO PC14 and PC15 can be used as GPIO, LSE oscillator pins and timestamp input.  PC13 can be used as GPIO, tamper input, timestamp input, RTC output and standby wakeup source. Nations Technologies Inc. 113 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 114: Table 5-4 Debug Interface Signal

    To avoid any uncontrolled I/O levels, the device embeds internal pull-ups and pull-downs on the JTAG input pins: Nations Technologies Inc. 114 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 115: Table 5-6 Adc External Trigger Injected Conversion Alternate Function Remapping

    Remap TIM1_ETR PA12 TIM1_CH1 AF10 PB14 AF10 TIM1_CH2 TIM1_CH3 PA10 PA11 TIM1_CH4 AF10 PA10 TIM1_BKIN PB12 PB13 TIM1_CH1N Nations Technologies Inc. 115 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 116: Table 5-9 Tim2 Alternate Function Remapping

    TIM3_CH1 TIM3_CH2 TIM3_CH3 TIM3_CH4 5.2.5.7.4 TIM4 alternate function remapping Table 5-11 TIM4 alternate function remapping Alternate function Remap Nations Technologies Inc. 116 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 117: Table 5-12 Tim5 Alternate Function Remapping

    PB14 AF13 AF10 TIM8_CH2 PB15 AF13 TIM8_CH3 AF10 AF10 TIM8_CH4 AF10 AF10 TIM8_BKIN AF10 AF13 TIM8_CH1N PA15 AF11 Nations Technologies Inc. 117 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 118: Table 5-14 Lptim Alternate Function Remapping

    5.2.5.9.1 USART1 alternate function remapping Table 5-16 USART1 alternate function remapping Alternate function Remap USART1_CTS PA11 USART1_RTS PA12 USART1_TX Nations Technologies Inc. 118 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 119: Table 5-17 Usart2 Alternate Function Remapping

    5.2.5.10.1 UART3 alternate function remapping Table 5-18 UART3 alternate function remapping Alternate function Remap UART3_TX PB10 AF10 UART3_RX PB11 AF10 Nations Technologies Inc. 119 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 120: Table 5-19 Uart4 Alternate Function Remapping

    5.2.5.11.1 I2C1 alternate function remapping Table 5-20 I2C1 alternate function remapping Alternate function Remap PA15 I2C1_SCL PD13 PA14 I2C1_SDA PD12 I2C1_SMBA Nations Technologies Inc. 120 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 121: Table 5-21 I2C2 Alternate Function Remapping

    5.2.5.12.1 SPI1/I2S1 alternate function remapping Table 5-22 SPI1/I2S1 alternate function remapping Alternate function Remap SPI1_I2S1_NSS_WS PA15 PA10 SPI1_I2S1_SCK_CK SPI1_I2S1_MISO_MCK SPI1_I2S1_MOSI_SD Nations Technologies Inc. 121 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 122: Table 5-23 Spi2/I2S2 Alternate Function Remapping

    AF10 5.2.5.13.2 COMP2 alternate function remapping Table 5-25 COMP2 alternate function remapping Alternate function Remap COMP2_OUT PA12 PA14 Nations Technologies Inc. 122 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 123: Table 5-26 Comp3 Alternate Function Remapping

    NJTRST TIMESTAMP alternate function remapping Table 5-30 TIMESTAMP alternate function remapping Alternate function Remap PC13 TIMESTAMP PC14 PC15 Nations Technologies Inc. 123 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 124: I/O Configuration Of Peripherals

    Table 5-37 CAN CAN pin Configuration GPIO configuration CAN_TX Digital Input Alternate function push-pull CAN_RX Digital output Alternate function push-pull Nations Technologies Inc. 124 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 125: Table 5-38 Usart

    Alternate function push-pull + pull down JTDI Input Pull-up Alternate function push-pull + pull up JTDO Output Alternate function push-pull Nations Technologies Inc. 125 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 126: Gpio Locking Mechanism

    If the lock sequence operation is wrong, then it must be redone (w1-> w0-> w1-> r0) to initiate the lock operation again. Nations Technologies Inc. 126 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 127: Gpio Registers

    Reset value GPIOA_POTYPE 0x04 Reset value GPIOA_SR 0x08 Reset value GPIOA_PUPD 0x0C Reset value GPIOA_PID 0x10 Reset value Nations Technologies Inc. 127 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 128 Reset value GPIOA_PLOCK 0x1C Reset value GPIOA_AFL 0x20 Reset value GPIOA_AFH 0x24 Reset value GPIOA_DS 0x2C Reset value Nations Technologies Inc. 128 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 129: Gpiob Register Overview

    Reset value GPIOB_PUPD 0x0C Reset value GPIOB_PID 0x10 Reset value GPIOB_POD 0x14 Reset value GPIOB_PBSC 0x18 Reset value Nations Technologies Inc. 129 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 130: Gpioc Register Overview

    GPIOC register overview Table 5-49 GPIOC register overview Offset Register GPIOC_PMODE 0x00 Reset value GPIOC_POTYPE 0x04 Reset value Nations Technologies Inc. 130 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 131 Reset value GPIOC_PBSC 0x18 Reset value GPIOC_PBC 0x28 Reset value GPIOC_PLOCK 0x1C Reset value GPIOC_AFH 0x24 Reset value Nations Technologies Inc. 131 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 132: Gpiod Register Overview

    Reset value GPIOD_SR 0x08 Reset value GPIOD_PUPD 0x0C Reset value GPIOD_PID 0x10 Reset value GPIOD_POD 0x14 Reset value Nations Technologies Inc. 132 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 133: Gpio Port Mode Description Register (Gpiox_Pmode)

    Reset value(Port A) : 0xABFFFFFF Reset value(Port B) : 0xFFFFFEBF Reset value(Port C) : 0xFC000000 Reset value(Port D) : 0xFF000000 Nations Technologies Inc. 133 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 134: Gpio Port Type Definition (Gpiox_Potype)

    Reset value (Port B) : 0x00000000 Reset value (Port C) : 0x00000000 Reset value (Port D) : 0x00000000 Nations Technologies Inc. 134 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 135: Gpio Slew Rate Configuration Register (Gpiox_Sr)

    Reset value (Port B) : 0x00000100 Reset value (Port C) : 0x00000000 Reset value (Port D) : 0x00000002 Nations Technologies Inc. 135 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 136: Gpio Port Input Data Register (Gpiox_Pid)

    Reset value (Port B) : 0x00000000 Reset value (Port C) : 0x00000000 Reset value (Port D) : 0x00000000 Nations Technologies Inc. 136 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 137: Gpio Port Output Data Register (Gpiox_Pod)

    Reset value (Port B) : 0x00000000 Reset value (Port C) : 0x00000000 Reset value (Port D) : 0x00000000 Nations Technologies Inc. 137 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 138: Gpio Port Bit Clear Register (Gpiox_Pbc)

    These bits are write-only and can be accessed in word mode only. 0: Does not affect the corresponding PODy bit 1: Clear the corresponding PODy bit to 0 Nations Technologies Inc. 138 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 139: Gpio Port Configuration Lock Register (Gpiox_ Plock)

    For Port D, only PLOCKK, PLOCK0, PLOCK12, PLOCK13, PLOCK14 and PLOCK15 bit fields are defined, other fields are reserved. Nations Technologies Inc. 139 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 140: Gpio Alternate Function Low Register (Gpiox_Afl)

    Reset value (Port B) : 0x00000000 Reset value (Port C) : 0x00000000 Reset value (Port D) : 0x00000000 Nations Technologies Inc. 140 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 141: Gpio Driver Strength Configuration Register (Gpiox_ Ds)

    Reset value (Port B) : 0x55555555 Reset value (Port C) : 0x54000000 Reset value (Port D) : 0x55000001 Nations Technologies Inc. 141 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 142: Afio Registers

    AFIO register overview Table 5-51 AFIO register overview Offset Register AFIO_RMP_CFG 0x00 Reset value AFIO_EXTI_CFG1 0x04 Reset value 0x08 AFIO_EXTI_CFG2 Nations Technologies Inc. 142 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 143 AFIO_EFT_CFG1 0x18 Reset value AFIO_EFT_CFG2 0x1C Reset value AFIO_FILT_CFG 0x20 Reset value AFIO_DIGEFT_CFG1 0x24 Reset value 0x28 AFIO_DIGEFT_CFG2 Nations Technologies Inc. 143 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 144: Alternate Function Mapping Configuration Control Register (Afio_Rmp_Cfg)

    Select break line rules to convert external trigger remapping. External interrupt configuration register 1 (AFIO_EXTI_CFG1) Address offset : 0x04 Reset value : 0x00000000 Nations Technologies Inc. 144 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 145 011010 : 1'b0 011011 : 1'b0 011100 : PA[7] pin 011101 : PB[7] pin 011110 : 1'b0 011111 : 1'b0 Nations Technologies Inc. 145 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 146 000001 : PB[0] pin 000010 : 1'b0 000011 : PD[0] pin 000100 : PA[1] pin 000101 : PB[1] pin Nations Technologies Inc. 146 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 147 101010 : 1'b0 101011 : 1'b0 101100 : PA[11] pin 101101 : PB[11] pin 101110 : 1'b0 101111 : 1'b0 Nations Technologies Inc. 147 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 148 010001 : PB[4] pin 010010 : 1'b0 010011 : 1'b0 010100 : PA[5] pin 010101 : PB[5] pin Nations Technologies Inc. 148 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 149 111011 : PD[14] pin 111100 : PA[15] pin 111101 : PB[15] pin 111110 : PC[15] pin 111111 : PD[15] pin Nations Technologies Inc. 149 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 150 100001 : PB[8] pin 100010 : 1'b0 100011 : 1'b0 100100 : PA[9] pin 100101 : PB[9] pin Nations Technologies Inc. 150 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 151: External Interrupt Configuration Register 2 (Afio_Exti_Cfg2)

    Reset value : 0x00000000 Bit field Name Description 31:30 Reserved Reserved, the reset value must be maintained. 29:24 EXTI7[5:0] EXTI7 configuration Nations Technologies Inc. 151 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 152 100010 : 1'b0 100011 : 1'b0 100100 : PA[9] pin 100101 : PB[9] pin 100110 : 1'b0 100111 : 1'b0 Nations Technologies Inc. 152 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 153 001001 : PB[2] pin 001010 : 1'b0 001011 : 1'b0 001100 : PA[3] pin 001101 : PB[3] pin Nations Technologies Inc. 153 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 154 110011 : PD[12] pin 110100 : PA[13] pin 110101 : PB[13] pin 110110 : PC[13] pin 110111 : PD[13] pin Nations Technologies Inc. 154 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 155 011001 : PB[6] pin 011010 : 1'b0 011011 : 1'b0 011100 : PA[7] pin 011101 : PB[7] pin Nations Technologies Inc. 155 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 156 These bits are written by software to select the source input for EXTI4 external interrupt. 000000 : PA[0] pin 000001 : PB[0] pin 000010 : 1'b0 000011 : PD[0] pin Nations Technologies Inc. 156 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 157 101001 : PB[10] pin 101010 : 1'b0 101011 : 1'b0 101100 : PA[11] pin 101101 : PB[11] pin Nations Technologies Inc. 157 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 158: External Interrupt Configuration Register 3 (Afio_Exti_Cfg3)

    000010 : 1'b0 000011 : PD[0] pin 000100 : PA[1] pin 000101 : PB[1] pin 000110 : 1'b0 Nations Technologies Inc. 158 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 159 101100 : PA[11] pin 101101 : PB[11] pin 101110 : 1'b0 101111 : 1'b0 110000 : PA[12] pin Nations Technologies Inc. 159 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 160 010001 : PB[4] pin 010010 : 1'b0 010011 : 1'b0 010100 : PA[5] pin 010101 : PB[5] pin 010110 : 1'b0 Nations Technologies Inc. 160 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 161 111101 : PB[15] pin 111110 : PC[15] pin 111111 : PD[15] pin 15:14 Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 161 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 162 100001 : PB[8] pin 100010 : 1'b0 100011 : 1'b0 100100 : PA[9] pin 100101 : PB[9] pin 100110 : 1'b0 Nations Technologies Inc. 162 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 163 001000 : PA[2] pin 001001 : PB[2] pin 001010 : 1'b0 001011 : 1'b0 001100 : PA[3] pin Nations Technologies Inc. 163 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 164 110010 : 1'b0 110011 : PD[12] pin 110100 : PA[13] pin 110101 : PB[13] pin 110110 : PC[13] pin Nations Technologies Inc. 164 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 165: External Interrupt Configuration Register 4 (Afio_Exti_Cfg4)

    001010 : 1'b0 001011 : 1'b0 001100 : PA[3] pin 001101 : PB[3] pin 001110 : 1'b0 001111 : 1'b0 Nations Technologies Inc. 165 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 166 110101 : PB[13] pin 110110 : PC[13] pin 110111 : PD[13] pin 111000 : PA[14] pin 111001 : PB[14] pin Nations Technologies Inc. 166 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 167 011010 : 1'b0 011011 : 1'b0 011100 : PA[7] pin 011101 : PB[7] pin 011110 : 1'b0 011111 : 1'b0 Nations Technologies Inc. 167 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 168 000001 : PB[0] pin 000010 : 1'b0 000011 : PD[0] pin 000100 : PA[1] pin 000101 : PB[1] pin Nations Technologies Inc. 168 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 169 101010 : 1'b0 101011 : 1'b0 101100 : PA[11] pin 101101 : PB[11] pin 101110 : 1'b0 101111 : 1'b0 Nations Technologies Inc. 169 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 170 010001 : PB[4] pin 010010 : 1'b0 010011 : 1'b0 010100 : PA[5] pin 010101 : PB[5] pin Nations Technologies Inc. 170 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 171 111011 : PD[14] pin 111100 : PA[15] pin 111101 : PB[15] pin 111110 : PC[15] pin 111111 : PD[15] pin Nations Technologies Inc. 171 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 172: Tolerance Configuration Register (Afio_Tol5V

    0: Enable 5V tolerance 1: Disable 5V tolerance PB3TOLENN Pin PB3 5V tolerance enable 0: Enable 5V tolerance Nations Technologies Inc. 172 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 173 0: Enable 5V tolerance 1: Disable 5V tolerance PA1TOLENN Pin PA1 5V tolerance enable 0: Enable 5V tolerance Nations Technologies Inc. 173 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 174: Analog Filter Configuration Register 1 (Afio_Eft_Cfg1)

    Pin PD15 EFT enable 0: Disable EFT 1: Enable EFT PD14EFTEN Pin PD14 EFT enable 0: Disable EFT 1: Enable EFT Nations Technologies Inc. 174 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 175: Digital Glitch Filter Stage (Glitch Width) Configuration Register (Afio_Filt_Cfg)

    00000 : Filter bypass Others : counter value indicating minimum pulse width in terms of APB clock cycles Nations Technologies Inc. 175 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 176: Digital Glitch Filter Configuration Register 1 (Afio_Digeft_Cfg1)

    0: Disable EFT 1: Enable EFT PD12DIGEFTEN Pin PD12 Digital EFT enable 0: Disable EFT 1: Enable EFT Nations Technologies Inc. 176 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 177 Pin PC13 Digital EFT enable 0: Disable EFT 1: Enable EFT 12:0 Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 177 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 178: Interrupts And Events

    BusFault Pre-fetch fault, memory access fault 0x0000_0014 settable UsageFault Undefined instruction or illegal state 0x0000_0018 Reserved 0x0000_001C - Nations Technologies Inc. 178 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 179 17 24 settable DMA1_Channel7 DMA1 Channel7 global interrupt 0x0000_0084 18 25 settable DMA1_Channel8 DMA1 Channel8 global interrupt 0x0000_0088 Nations Technologies Inc. 179 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 180 44 51 settable TIM8_TRG_COM TIM8 Trigger and Commutation interrupts 0x0000_00F0 45 52 settable TIM8_CC TIM8 Capture Compare interrupt 0x0000_00F4 Nations Technologies Inc. 180 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 181: External Interrupt/Event Controller (Exti)

    Three types of trigger events are supported: rising edge, falling edge or double edge.  Wake-up to exit low-power mode Nations Technologies Inc. 181 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 182: Functional Description

    In addition, by writing '1' in the software interrupt/event register, an interrupt/event request can also be generated by Nations Technologies Inc. 182 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 183  Configure 24 interrupt/event line mask bits (EXTI_IMASK,EXTI_EMASK);  Configure the request bit of the software interrupt event register (EXTI_SWIE). Nations Technologies Inc. 183 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 184: Exti Line Mapping

    EXTI line mapping Figure 6-2 External interrupt GPIO mapping EXTI0 PD14 PD15 EXTI1 PD14 PD15 EXTI15 PD14 PD15 Nations Technologies Inc. 184 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 185: Exti Registers

    EXTI_PEND 014h Reserved Reset Value EXTI_TS_SEL TSSEL[3:0] 018h Reserved Reset Value Interrupt Mask Register(EXTI_IMASK) Address offset : 0x00 Nations Technologies Inc. 185 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 186: Event Mask Register(Exti_Emask)

    1: open the event request from line x Rising Edge Trigger Selection Register(EXTI_RT_CFG) Address offset : 0x08 Reset value : 0x00000000 Nations Technologies Inc. 186 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 187: Falling Edge Trigger Selection Register(Exti_Ft_Cfg)

    1: Enable falling edge trigger (interrupts and events) on input line x is allowed. Software Interrupt Event Register(EXTI_SWIE) Address offset : 0x10 Reset value : 0x00000000 Nations Technologies Inc. 187 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 188: Interrupt Request Pending Register(Exti_Pend)

    Write '1' in this bit to clear it, or change the polarity of edge detection to clear this bit. RTC Timestamp Selection Register(EXTI_TS_SEL) Address offset : 0x18 Reset value : 0x00000000 Nations Technologies Inc. 188 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 189 1: select EXTI1 as the trigger source of timestamp event; …… 15: Select EXTI15 as the trigger source of timestamp events. Nations Technologies Inc. 189 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 190: Dma Controller

     Access totally 5 AHB slaves: Flash, SRAM, ADC, APB1 and APB2.  Configurable data transmit number (0~65535). Nations Technologies Inc. 190 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 191: Block Diagram

     Calculate the number of outstanding operations, perform a decrement operation of the DMA_TXNUMx register, Nations Technologies Inc. 191 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 192: Channel Priority And Arbitration

    0x2 / 00B1 0x2 / B2 3: R B2 [7:0] @0x2, W 00B2 [15:0] @0x4 0x4 / 00B2 Nations Technologies Inc. 192 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 193 0 to make it 16 bits and become 0x0055, then duplicate it to 32-bit data 0x0055_0055 and provide to HWDATA[31:0]; (if destination size is 32-bit then DMA will only pad source data with 0). Nations Technologies Inc. 193 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 194: Peripheral/Memory Address Incrementation

    53). Repeat step 1~8 on channel 1~8 and finally. Enable corresponding channel. Nations Technologies Inc. 194 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 195: Flow Control

    If the user wants to turn off the circular mode, the user needs to write 0 to DMA_CHCFGx.CHEN to disable the DMA channel, and then write 0 to DMA_CHCFGx.CIRC (when DMA_CHCFGx.CHEN is 1, other bits in the Nations Technologies Inc. 195 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 196: Error Management

    DMA request to DMA controller’s DMA channels. Table 7-4 DMA request mapping DMA channel select Peripheral DMA request sel =0 sel = 1 Usart1_tx Nations Technologies Inc. 196 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 197 = 21 Tim1_com sel = 22 Tim1_up sel = 23 Tim1_trig sel = 24 Tim2_ch1 sel = 25 Tim2_ch2 Nations Technologies Inc. 197 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 198 = 45 Tim8_ch1 sel = 46 Tim8_ch2 sel = 47 Tim8_ch3 sel = 48 Tim8_ch4 sel = 49 Tim8_com Nations Technologies Inc. 198 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 199: Dma Registers

    Reset Value DMA_PADDR4 ADDR[31:0] 04Ch Reset Value DMA_MADDR4 ADDR[31:0] 050h Reset Value DMA_CHSEL4 CH_SEL[5:0] 054h Reserved Reset Value Nations Technologies Inc. 199 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 200: Dma Interrupt Status Register (Dma_Intsts)

    Address offset: 0x00 Reset value: 0x0000 0000 Bit field Name Description Transfer error flag for channel x (x=1…8). 31/27/23/19/15/11/7/3 ERRFx Nations Technologies Inc. 200 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 201: Dma Interrupt Flag Clear Register (Dma_Intclr)

    Clear transfer complete flag for channel x (x=1…8). 29/25/21/17/13/9/5/1 CTXCFx Software can set this bit to clear TXCF of corresponding channel. Nations Technologies Inc. 201 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 202: Dma Channel X Configuration Register (Dma_Chcfgx)

    11: Reserved PSIZE[1:0] Peripheral data size. Software can configure data size read/write from/to peripheral address. 00: 8-bits 01: 16-bits Nations Technologies Inc. 202 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 203: Dma Channel X Transfer Number Register (Dma_Txnumx)

    DMA channel x transfer number register (DMA_TXNUMx) Note:The x is channel number, x = 1…8 Address offset: 0x0c+20 * (x–1) Reset value: 0x0000 0000 Nations Technologies Inc. 203 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 204: Dma Channel X Peripheral Address Register (Dma_Paddrx)

    Reset value: 0x0000 0000 This register can only be written if the channel is disabled (DMA_CHCFGx.CHEN = 0). Nations Technologies Inc. 204 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 205: Dma Channel X Channel Request Select Register (Dma_Chselx)

    0x05: UART3_TX 0x06: UART3_RX 0x07: UART4_TX 0x08: UART4_RX 0x09: SPI1_TX 0x0A: SPI1_RX 0x0B: SPI2_TX 0x0C: SPI2_RX 0x0D: I2C1_TX Nations Technologies Inc. 205 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 206 0x2B: TIM5_TRIG 0x2C: TIM6 0x2D: TIM8_CH1 0x2E: TIM8_CH2 0x2F: TIM8_CH3 0x30: TIM8_CH4 0x31: TIM8_COM 0x32: TIM8_UP 0x33: TIM8_TRIG Nations Technologies Inc. 206 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 207: Crc Calculation Unit

     The verification initial value can be configured, and the size end of the data to be verified can be configured.  Support 8bit LRC check value generation The following figure is the block diagram of CRC unit. Nations Technologies Inc. 207 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 208: Crc Function Description

    If the initial value needs to be set, the LRC register should be configured first. Nations Technologies Inc. 208 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 209: Crc Registers

    The written data is the CRC value to be checked. The read data is the CRC calculation result. Only 32- bit operations are supported. CRC32 independent data register (CRC_CRC32IDAT) Address offset: 0x04 Reset value: 0x0000 0000 Nations Technologies Inc. 209 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 210: Crc32 Control Register (Crc_Crc32Ctrl)

    It can reset CRC module and set data register to be 0xFFFF_FFFF. This reset can only write 1, and hardware will clear to 0 automatically. CRC16 control register (CRC_CRC16CTRL) Address offset: 0x0C Reset value: 0x0000 0000 Nations Technologies Inc. 210 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 211: Crc16 Input Data Register (Crc_Crc16Dat)

    Address offset: 0x14 Reset value: 0x0000 0000 Bit field Name Description 31:16 Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 211 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 212: Lrc Result Register (Crc_Lrc)

    CRC_CRC16DAT will be XOR with CRC_LCR register value. The result will be stored in CRC_LRC. Software read the result. It should be cleared before next use. Nations Technologies Inc. 212 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 213: Advanced-Control Timers (Tim1 And Tim8)

    Incremental (quadrature) encoder interface: used for tracking motion and resolving rotation direction and position;  Hall sensor interface: used to do three-phase motor control; Nations Technologies Inc. 213 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 214: Figure 9-1 Block Diagram Of Tim1

    The event Interrupt and DMA output The capture channel 1 input can come from IOM or comparator output Nations Technologies Inc. 214 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 215: Tim1 And Tim8 Function Description

    TIMx_CTRL1.UPDIS=0. The counter CK_CNT is valid only when the TIMx_CTRL1.CNTEN bit is set. The counter starts counting one clock cycle after the TIMx_CTRL1.CNTEN bit is set. Nations Technologies Inc. 215 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 216: Counter Mode

    • The repetition counter reloads the contents of the TIMx_REPCNT • Update auto-reload shadow registers with preload value(TIMx_AR), when TIMx_CTRL1.ARPEN = 1. Nations Technologies Inc. 216 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 217: Figure 9-4 Timing Diagram Of Up-Counting. The Internal Clock Divider Factor = 2/N

    Internal clock CK_PSC divided by N Timer clock = CK_CNT Counter register Counter overflow Update interrupt flag(UDITF) Update event(UEV) Nations Technologies Inc. 217 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 218: Figure 9-5 Timing Diagram Of The Up-Counting, Update Event When Arpen=0/1

    Counter overflow Update event(UEV) Update interrupt flag(UDITF) Auto-reload preload register Write a new value in TIMx_AR Auto-reload shadow register Nations Technologies Inc. 218 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 219: Figure 9-6 Timing Diagram Of The Down-Counting, Internal Clock Divided Factor = 2/N

    In this mode, the TIMx_CTRL1.DIR direction bits have no effect and the count direction is updated and specified by Nations Technologies Inc. 219 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 220: Figure 9-7 Timing Diagram Of The Center-Aligned, Internal Clock Divided Factor =2/N

    Internal clock divided by N CK_PSC Timer clock = CK_CNT Counter register Counter underflow Update event(UEV) Update interrupt flag(UDITF) Nations Technologies Inc. 220 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 221: Figure 9-8 A Center-Aligned Sequence Diagram That Includes Counter Overflows And Underflows (Arpen = 1)

    Center-aligned asymmetric mode is only for TIM1. In center-aligned asymmetric mode(TIMx_CTRL1. ASYMMETRIC is 1 and TIMx_CTRL1.CAMSEL[1:0] is non- Nations Technologies Inc. 221 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 222 In this case, the counter restarts from 0, as does the prescaler's counter. Please note: if the update source is a counter overflow, auto-reload update before reloading the counter. Nations Technologies Inc. 222 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 223: Figure 9-9 The Output Waveform Corresponding To The Asymmetric Mode

    ADC only when MMSEL3 = 1. If TIMx_CTRL1.CMODE[1:0]=00 in CCDATx(x=4,7,8,9), the CCDAT value of CCDATx will only trigger ADC when DIR =0. Nations Technologies Inc. 223 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 224: Figure 9-10 Ccdatx(X=4,7,8,9), Trigger Adc When Dir = 0

    Trigger ADC to sample 4 times If TIMx_CTRL1.CMODE[1:0]=01 in CCDATx(x=4,7,8,9), the CCDAT/CCDDAT value of CCDATx will only trigger ADC when DIR =1. Nations Technologies Inc. 224 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 225: Figure 9-11 Ccdatx(X=4,7,8,9), Trigger Adc When Dir = 1

    Trigger ADC to sample 4 times If TIMx_CTRL1.CMODE[1:0]=1x in CCDATx(x=4,7,8,9), the CCDAT/CCDDAT value of CCDATx will trigger ADC when DIR =0 or DIR=1. Nations Technologies Inc. 225 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 226: Repetition Counter

    Repetition counters feature automatic reloading. The update event ( generated by setting TIMx_EVTGEN.UDGN or hardware through slave mode controller) occurs immediately, regardless of the value of the repeat counter. Nations Technologies Inc. 226 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 227: Figure 9-13 Repeat Count Sequence Diagram In Down-Counting Mode

    00 01 Underflow Overflow TIMx_REPCNT = 0x0 UDITF TIMx_REPCNT = 0x1 UDITF TIMx_REPCNT = 0x2 UDITF Software clear Nations Technologies Inc. 227 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 228: Clock Selection

    1 ' by soft, the clock source of the prescaler is provided by the internal clock CK_INT. Nations Technologies Inc. 228 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 229: Figure 9-16 Control Circuit In Normal Mode, Internal Clock Divided By 1

    This mode is selected by configuring TIMx_SMCTRL.SMSEL=111. The counter can be configured to count on the rising or falling edge of the clock at the selected input. Nations Technologies Inc. 229 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 230: Figure 9-18 Control Circuit In External Clock Mode 1

    The following figure is a schematic diagram of the external trigger input module in External clock source mode 2 Nations Technologies Inc. 230 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 231: Figure 9-19 External Trigger Input Block Diagram

    Figure 9-20 Control circuit in external clock mode 2 CNTEN CK _INT ETRP ETRF Counter clock = CK_CNT=CK_PSC Counter register Nations Technologies Inc. 231 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 232: Capture/Compare Channels

    The output part generates an intermediate waveform OCxRef (active high) as reference. The polarity acts at the end of the chain. Nations Technologies Inc. 232 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 233: Figure 9-22 Capture/Compare Channel 1 Main Circuit

    Comparator mode Write CCDAT1H Write in progress CNT>CCDAT1 CNT=CCDAT1 Write CCDAT1L CC1SEL[0] CC1SEL[1] TIM1_CCMOD1.OC1PEN From time base unit Nations Technologies Inc. 233 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 234: Input Capture Mode

    In capture mode, the TIMx_CCDATx registers are used to latch the counter value after the ICx signal detects. There is a capture interrupt flag TIMx_STS.CCxITF, which can issue an interrupt or DMA request if the Nations Technologies Inc. 234 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 235: Pwm Input Mode

    Configure TIMx_CCEN.CC1P equal to ‘0’ to select the active polarity of filtered timer input 1(TI1FP1), valid on the rising edge.  Configure TIMx_CCMOD1.CC2SEL equal to ‘10’ select TI1 as valid input for TIMx_CCDAT2. Nations Technologies Inc. 235 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 236: Forced Output Mode

    OCxREF. And the flag still can be set. Therefore, the interrupt and DMA requests still can be sent. Nations Technologies Inc. 236 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 237: Output Compare Mode

    Otherwise the TIMx_CCDATx shadow register will be updated at the next update event. Here is an example. Nations Technologies Inc. 237 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 238: Pwm Mode

    User should not modified TIMx_CTRL1.DIR by software, it is updated by hardware. Nations Technologies Inc. 238 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 239: Figure 9-27 Center-Aligned Pwm Waveform (Ar=8)

    To be on the safe side, user is suggested setting TIMx_EVTGEN.UDGN to generate an update by software before starting the counter, and not writing the counter while it is running. Nations Technologies Inc. 239 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 240: Figure 9-28 Edge-Aligned Pwm Waveform (Apr=8)

    When TIMx_CNT > TIMx_CCDATx, the reference PWM signal OCxREF is low. Otherwise it will be high. If the Nations Technologies Inc. 240 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 241: One-Pulse Mode

    TIMx_CCEN.CC2P= ‘0’; 3. TI2FP2 acts as the trigger (TRGI) of the slave mode controller and starts the counter, TIMx_SMCTRL.TSEL= Nations Technologies Inc. 241 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 242: Clearing The Ocxref Signal On An External Event

    Here is an example for the case that when ETRF input becomes high, the behavior of OCxREF signal for different value of OCxCEN. Timer is set to be in PWM mode in this case. Nations Technologies Inc. 242 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 243: Complementary Outputs With Dead-Time Insertion

    The relationships between the output signals of the dead-time generator and the reference signal OCxREF are as follow. Assume that TIMx_CCEN.CCxP=0, TIMx_CCEN.CCxNP=0, TIMx_BKDT.MOEN=1, TIMx_CCEN.CCxEN=1, Nations Technologies Inc. 243 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 244: Figure 9-31 Complementary Output With Dead-Time Insertion

    If user set TIMx_CCEN.CCxEN=0 and TIMx_CCEN.CCxNEN=1, it will not complemented, and OCxN will become active when OCxREF is high. On the other hand, if user set TIMx_CCEN.CCxEN=1 and Nations Technologies Inc. 244 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 245: Break Function

    (CCxNP^OIxN)! = 0, that is, the OCx and OCxN still cannot be driven to active level at the same time. Nations Technologies Inc. 245 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 246: Figure 9-32 Output Behavior In Response To A Break

    Break in OCxREF =OIx Delay Delay Delay =OIxN OCxN (CCxENN=1,CCxNEN=1,CCxP=0,CCxNP=0,OIx= ~OIxN) =OIx Delay =OIxN OCxN (CCxEN=1,CCxNEN=0,CCxP=0,CCxNP=0,OIx=~OIxN) OCxN (CCxEN=1,CCxNEN=0,CCxP=0,CCxNP=0,OIx=OIxN) Nations Technologies Inc. 246 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 247: Debug Mode

    2. The slave mode is selected as reset mode (TIMx_SMCTRL.SMSEL=100), and the trigger input is selected as TI1 (TIMx_SMCTRL.TSEL=101); 3. Setting TIMx_CTRL1.CNTEN = 1 to start counter; Nations Technologies Inc. 247 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 248: Figure 9-34 Control Circuit In Reset Mode

    The delay between the rising edge on TI2 and the actual start of the counter is due to the resynchronization circuit on TI2 input. Nations Technologies Inc. 248 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 249: Figure 9-35 Control Circuit In Trigger Mode

    The delay between the rising edge on TI1 and the actual stop of the counter is due to the resynchronization circuit on TI1 input. Figure 9-36 Control circuit in Gated mode Nations Technologies Inc. 249 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 250 When TI1 detects a rising edge, the counter starts counting on the rising edge of ETR, and the trigger flag is set (TIMx_STS.TITF=1); Nations Technologies Inc. 250 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 251: Timer Synchronization

    The following figure shows the output timing diagram of OCx and OCxN when a COM commutation event occurs in three different configurations: Nations Technologies Inc. 251 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 252: Encoder Interface Mode

    The relationship between the counting direction and the encoder signal is shown in Table 9-1 Counting direction versus encoder signals Nations Technologies Inc. 252 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 253: Table 9-1 Counting Direction Versus Encoder Signals

    The following figure shows the example of counter behavior when IC1FP1 polarity is inverted (CC1P= '1', other configurations are the same as above) Nations Technologies Inc. 253 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 254: Figure 9-40 Encoder Interface Mode Example With Ic1Fp1 Polarity Inverted

    Figure 9-40 Encoder interface mode example with IC1FP1 polarity inverted forward jitter backward jitter Counter down Nations Technologies Inc. 254 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 255: Interfacing With Hall Sensor

    (TIMx_CTRL2.CCPCTL=1) and support the rising edge of TRGI Trigger an update (TIMx_CTRL2.CCUSEL=1). This example is shown in the following figure. Nations Technologies Inc. 255 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 256: Figure 9-41 Example Of Hall Sensor Interface

    Interfacing timer Counter(CNT) (CCDAT2) CCDAT1 TRGO=OC2REF Advanced-control timers(TIM1&TIM8) OC1N OC2N OC3N Write CCxEN、CCxNEN and OCxMD for next step Nations Technologies Inc. 256 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 257: Timx Register Description(X=1, 8)

    0x0C Reset value TIMx_STS 0x10 Reset value TIMx_EVTGEN 0x14 Reset value TIMx_CCMOD1 Output compare mode 0x18 Reset value Nations Technologies Inc. 257 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 258 Reset value TIMx_PSC 0x28 Reset value TIMx_AR 0x2C Reset value TIMx_REPCNT 0x30 Reset value TIMx_CCDAT1 0x34 Reset value Nations Technologies Inc. 258 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 259 Reset value TIMx_DADDR 0x4C Reset value TIMx_CCMOD3 0x54 Reset value TIMx_CCDAT5 0x58 Reset value TIMx_CCDAT6 0x5C Reset value Nations Technologies Inc. 259 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 260: Control Register 1 (Timx_Ctrl1)

    In center-aligned symmetry mode, channel 4/7/8/9 trigger mode, only when TIMx_CTRL2.MMSEL3 = 1, the TRGO output will be valid. 00: Up-counting to CCDAT4/7/8/9, trigger valid Nations Technologies Inc. 260 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 261 10: Center-aligned mode 2. The counter counts in center-aligned mode, and the output compare interrupt flag bit is set to 1 when up-counting. Nations Technologies Inc. 261 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 262: Control Register 2 (Timx_Ctrl2)

    Trigger mode can automatically set TIMx_CTRL1.CNTEN bit by hardware. Control register 2 (TIMx_CTRL2) Offset address: 0x04 Nations Technologies Inc. 262 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 263 0: When TIMx_BKDT.MOEN = 0, after dead-time OC1N = 0 1: When TIMx_BKDT.MOEN = 0, after dead-time OC1N = 1 Nations Technologies Inc. 263 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 264 Note: This bit only applied to channels with complementary outputs. Reserved Reserved, the reset value must be maintained Nations Technologies Inc. 264 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 265: Slave Mode Control Register (Timx_Smctrl)

    01: ETRP frequency divided by 2 10: ETRP frequency divided by 4 11: ETRP frequency divided by 8 Nations Technologies Inc. 265 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 266 Note: These bits must be changed only when not in use (e. g. TIMx_SMCTRL.SMSEL=000) to avoid false edge detection at the transition. Reserved Reserved, the reset value must be maintained Nations Technologies Inc. 266 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 267: Dma/Interrupt Enable Registers (Timx_Dinten)

    Offset address: 0x0C Reset value: 0x0000 Bit field Name Description Reserved Reserved, the reset value must be maintained Nations Technologies Inc. 267 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 268 1: Enables capture/compare 2 interrupts CC1IEN Capture/Compare 1 interrupt enable 0: Disable capture/compare 1 interrupt 1: Enables capture/comparing 1 interrupt Nations Technologies Inc. 268 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 269: Status Registers (Timx_Sts)

    0: No break event occurred 1: An active level has been detected TITF Trigger interrupt flag Nations Technologies Inc. 269 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 270 (See TIMx_SMCTRL Register description) This bit is cleared by software. 0: No update event occurred Nations Technologies Inc. 270 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 271: Event Generation Registers (Timx_Evtgen)

    Capture/Compare 4 generation See TIMx_EVTGEN.CC1GN description. CC3GN Capture/Compare 3 generation See TIMx_EVTGEN.CC1GN description. CC2GN Capture/Compare 2 generation See TIMx_EVTGEN.CC1GN description. Nations Technologies Inc. 271 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 272: Capture/Compare Mode Register 1 (Timx_Ccmod1)

    14:12 OC2MD[2:0] Output Compare 2 mode OC2PEN Output Compare 2 preload enable OC2FEN Output Compare 2 fast enable Nations Technologies Inc. 272 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 273 Note 1: Only when TIMx_CTRL1.ONEPM = 1(In one-pulse mode), PWM mode can be used without verifying the preload register, otherwise no other behavior can be predicted. Nations Technologies Inc. 273 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 274 SAMPLING CK_INT 0010: f , N = 4 SAMPLING CK_INT 0011: f , N = 8 SAMPLING CK_INT Nations Technologies Inc. 274 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 275: Capture/Compare Mode Register 2 (Timx_Ccmod2)

    Output comparison mode: Reserved OC9PEN Reserved OC8PEN Reserved OC7PEN OC4CEN OC4MD[2:0] OC4PEN OC4FEN CC4SEL[1:0] OC3CEN OC3MD[2:0] OC3PEN OC3FEN CC3SEL[1:0] Nations Technologies Inc. 275 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 276 Note: CC3SEL is writable only when the channel is off (TIMx_CCEN.CC3EN = 0). Input capture mode: Bit field Name Description 15:12 IC4F[3:0] Input Capture 4 filter Nations Technologies Inc. 276 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 277: Capture/Compare Enable Registers (Timx_Ccen)

    See TIMx_CCEN.CC1EN description. 19:18 Reserved Reserved, the reset value must be maintained CC5P Capture/Compare 5 output polarity See TIMx_CCEN.CC1P description. Nations Technologies Inc. 277 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 278 1: Enable - Enable output OC1N signal. The level of OC1N depends on the value of these bits TIMx_BKDT.MOEN, TIMx_BKDT.OSSI, TIMx_BKDT.OSSR, TIMx_CTRL2.OI1, TIMx_CTRL2.OI1N and TIMx_CCEN.CC1EN. Nations Technologies Inc. 278 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 279: Table 9-4 Output Control Bits Of Complementary Ocx And Ocxn Channels With Break Function

    Output disabled(not driven by timer) OCx=CCxP,OCx_EN=0 OCxN=CCxNP,OCxN_EN=0 Off-state (Output enabled with inactive OCxREF + polarity, state) OCxN= OCxREF xor CCxNP,OCxN_EN=1 Nations Technologies Inc. 279 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 280: Counters (Timx_Cnt)

    Reset value: 0x0000 Bit field Name Description 15:0 CNT[15:0] Counter value Prescaler (TIMx_PSC) Offset address: 0x28 Reset value: 0x0000 Nations Technologies Inc. 280 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 281: Auto-Reload Register (Timx_Ar)

    Setting the TIMx_EVTGEN.UDGN bit will reload the content of TIMx_REPCNT.REPCNT and generate an update event. Capture/compare register 1 (TIMx_CCDAT1) Offset address: 0x34 Nations Technologies Inc. 281 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 282: Capture/Compare Register 2 (Timx_Ccdat2)

    When configured as output mode, register CCDAT1 and CCDDAT1 are readable and writable. Capture/compare register 2 (TIMx_CCDAT2) Offset address: 0x38 Reset value: 0x0000 0000 Nations Technologies Inc. 282 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 283: Capture/Compare Register 3 (Timx_Ccdat3)

    Otherwise, this preloaded value is transferred to the active register only when an update event occurs. Nations Technologies Inc. 283 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 284: Capture/Compare Register 4 (Timx_Ccdat4)

    When configured as input mode, register CCDAT4 and CCDDAT4 are only readable. When configured as output mode, register CCDAT4 and CCDDAT4 are readable and writable. Nations Technologies Inc. 284 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 285: Break And Dead-Time Registers (Timx_Bkdt)

    CCxNEN = 1. Then, OC/OCN enable output signal = 1 For more details, See Section 9.4.10, capture/compare enablement registers (TIMx_CCEN). Nations Technologies Inc. 285 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 286: Dma Control Register (Timx_Dctrl)

    = (32 + DTGN [4:0]) × (16 × t value see TIMx_CTRL1.CLKD [1:0]. DMA Control register (TIMx_DCTRL) Offset address: 0x48 Nations Technologies Inc. 286 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 287: Dma Transfer Buffer Register (Timx_Daddr)

    (DMA base address + DMA burst length × 4) will be accessed. DMA base address = The address of TIM_CTRL1 + TIMx_DCTRL. DBADDR * 4; Nations Technologies Inc. 287 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 288 Reserved Reserved, the reset value must be maintained Capture/compare register 5 (TIMx_CCDAT5) Offset address: 0x58 Reset value: 0x0000 Nations Technologies Inc. 288 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 289 Capture/compare register 7 (TIMx_CCDAT7) Offset address: 0x60 Reset value: 0x0000 Nations Technologies Inc. 289 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 290 NOTE: This function is only for TIM1 Capture/compare register 9 (TIMx_CCDAT9) Offset address: 0x68 Reset value: 0x0000 Nations Technologies Inc. 290 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 291 Build-in FIFO is 64 bits with maximum index 63 which can only set window size to be 63. Nations Technologies Inc. 291 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 292 Clock prescaler scaling system clock to sample clock. Sample clock decides distance between two sample point. Only value at sample point will take into consideration for valid logic level calculation. Nations Technologies Inc. 292 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 293 Incremental (quadrature) encoder interface: used for tracking motion and resolving rotation direction and position;  Hall sensor interface: used to do three-phase motor control; Nations Technologies Inc. 293 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 294: Time-Base Unit

    The time-base unit mainly includes: prescaler, counter, and auto-reload. When the time base unit is working, the software can read and write the corresponding registers (TIMx_PSC, TIMx_CNT and TIMx_AR) at any time. Nations Technologies Inc. 294 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 295: Figure 10-2 Counter Timing Diagram With Prescaler Division Change From 1 To 4

    DMA requests are generated. This setting is used in scenarios where you want to clear the counter but do not want to generate an update interrupt. Nations Technologies Inc. 295 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 296 The figure below shows some examples of the counter behavior and the update flags for different division factors in the up-counting mode. Nations Technologies Inc. 296 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 297: Figure 10-3 Timing Diagram Of Up-Counting. The Internal Clock Divider Factor = 2/N

    Internal clock CK_PSC divided by N Timer clock = CK_CNT Counter register Counter overflow Update interrupt flag(UDITF) Update event(UEV) Nations Technologies Inc. 297 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 298: Figure 10-4 Timing Diagram Of The Up-Counting, Update Event When Arpen=0/1

    Counter overflow Update event(UEV) Update interrupt flag(UDITF) Auto-reload preload register Write a new value in TIMx_AR Auto-reload shadow register Nations Technologies Inc. 298 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 299: Figure 10-5 Timing Diagram Of The Down-Counting, Internal Clock Divided Factor = 2/N

    Center-aligned mode is valid when the TIMx_CTRL1. CAMSEL bit is not equal to "00". The update events can be generated each time the counter overflows and each time the counter underflows. Nations Technologies Inc. 299 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 300: Figure 10-6 Timing Diagram Of The Center-Aligned, Internal Clock Divided Factor =2/N

    Internal clock divided by N CK_PSC Timer clock = CK_CNT Counter register Counter underflow Update event(UEV) Update interrupt flag(UDITF) Nations Technologies Inc. 300 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 301: Clock Selection

    Write a new value in TIMx_AR Auto-reload active register Clock selection  The internal clock of timers :CK_INT Nations Technologies Inc. 301 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 302: Figure 10-8 Control Circuit In Normal Mode, Internal Clock Divided By 1

    Counter clock = CK_CNT=CK_PSC Counter register 63 64 65 66 00 01 02 03 04 05 06 07 Nations Technologies Inc. 302 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 303: Figure 10-9 Ti2 External Clock Connection Example

    The delay between the rising edge of TI2 and the actual clock of the counter depends on the resynchronization circuit at the input of TI2. Nations Technologies Inc. 303 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 304: Figure 10-10 Control Circuit In External Clock Mode 1

    Select the polarity on ETR pin by setting TIMx_SMCTRL.EXTP equal to ‘0’, The rising edge of ETR is valid  External clock mode 2 is selected by setting TIMx_SMCTRL .EXCEN equal to ‘1’ Nations Technologies Inc. 304 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 305: Figure 10-12 Control Circuit In External Clock Mode 2

    ICx is sent to the capture register after frequency division. The following figure shows a block diagram of a capture/compare channel. Nations Technologies Inc. 305 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 306: Figure 10-13 Capture/Compare Channel (Example: Channel 1 Input Stage)

    The output part generates an intermediate waveform OCxRef (active high) as reference. The polarity acts at the end of the chain. Nations Technologies Inc. 306 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 307: Figure 10-14 Capture/Compare Channel 1 Main Circuit

    Comparator mode Write CCDAT1H Write in progress CNT>CCDAT1 CNT=CCDAT1 Write CCDAT1L CC1SEL[0] CC1SEL[1] TIM1_CCMOD1.OC1PEN From time base unit Nations Technologies Inc. 307 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 308: Figure 10-15 Output Part Of Channelx (X=1/2/3/4. Take Channel 4 As Example

    TIMx_CCMODx.ICxF bits. Example: If the input signal jitters up to 5 internal clock cycles, we must choose a filter duration longer than these 5 clock cycles. When 8 consecutive samples (sampled at f frequency) with Nations Technologies Inc. 308 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 309: Figure 10-16 Slide Filter

    For example, the following configuration flow can be used to know the period and duty cycle of the PWM signal on Nations Technologies Inc. 309 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 310: Figure 10-17 Pwm Input Mode Timing

    OCx get opposite value to CCxP polarity bit. On the other hand, user can set TIMx_CCMODx. Nations Technologies Inc. 310 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 311 Otherwise the TIMx_CCDATx shadow register will be updated at the next update event. Here is an example. Nations Technologies Inc. 311 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 312: Figure 10-18 Output Compare Mode, Toggle On Oc1

    User should not modified TIMx_CTRL1.DIR by software, it is updated by hardware. Examples of center-aligned PWM waveforms is as follow, and the setting of the waveform are: TIMx_AR=8, PWM Nations Technologies Inc. 312 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 313: Figure 10-19 Center-Aligned Pwm Waveform (Ar=8)

    PWM edge-aligned mode There are two kinds of configuration in edge-aligned mode, up-counting and down-counting. Nations Technologies Inc. 313 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 314: Figure 10-20 Edge-Aligned Pwm Waveform (Apr=8)

    PWM cycle is 0. At the moment when the counter is 0 in the next PWM cycle, although the value of the counter = CCDATx shadow register = 0 and OCxREF = '0', no compare event will be generated. Nations Technologies Inc. 314 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 315: Figure 10-21 Example Of One-Pulse Mode

    PULSE 5. Configure TIMx_CTRL1.ONEPM=1 to enable single pulse mode, configure TIMx_CCMOD1.OC1MD = ‘111’ to select PWM2 mode; Nations Technologies Inc. 315 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 316 Here is an example for the case that when ETRF input becomes high, the behavior of OCxREF signal for different value of OCxCEN. Timer is set to be in PWM mode in this case. Nations Technologies Inc. 316 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 317: Debug Mode

    After starting the timer, when TI1 detects a rising edge, the counter resets and restarts counting, and the trigger flag Nations Technologies Inc. 317 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 318: Figure 10-23 Control Circuit In Reset Mode

    The delay between the rising edge on TI2 and the actual start of the counter is due to the resynchronization circuit on TI1 input. Nations Technologies Inc. 318 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 319: Figure 10-24 Control Circuit In Trigger Mode

    The delay between the rising edge on TI1 and the actual stop of the counter is due to the resynchronization circuit on TI1 input. Nations Technologies Inc. 319 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 320: Figure 10-25 Control Circuit In Gated Mode

    When TI1 detects a rising edge, the counter starts counting on the rising edge of ETR, and the trigger flag is set (TIMx_STS.TITF=1); Nations Technologies Inc. 320 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 321: Figure 10-26 Control Circuit In Trigger Mode + External Clock Mode2

    The synchronization function does not support dynamic change of the connection. User should configure and enable the slave timer before enable the master timer’s trigger or clock. Nations Technologies Inc. 321 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 322: Figure 10-27 Block Diagram Of Timer Interconnection

    Setting TIM1_CTRL2.MMSEL=’100’ to use the OC1REF of TIM1 as trigger output.  Configure TIM1_CCMOD1 register to configure the OC1REF output waveform. Nations Technologies Inc. 322 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 323: Figure 10-28 Tim2 Gated By Oc1Ref Of Tim1

    Setting TIM2_CTRL1.CNTEN= ‘1’ to start TIM2.  Setting TIM1_CTRL1.CNTEN= ‘1’ to start TIM1.  Setting TIM1_CTRL1.CNTEN= ‘0’ to stop TIM1. Nations Technologies Inc. 323 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 324: Figure 10-29 Tim2 Gated By Enable Signal Of Tim1

    Setting TIM1_CTRL1.CNTEN=1 to start TIM1. Figure 10-30 Trigger TIM2 with an update of TIM1 TIM1 CK_INT TIM2 CNTEN TITF Clear TITF Nations Technologies Inc. 324 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 325: Figure 10-31 Triggers Timers 1 And 2 Using The Ti1 Input Of Tim1

    TI2FP2. The counting direction is automatically controlled by hardware TIMx_CTRL1.DIR. There are three types of encoder counting modes: 1. The counter only counts on the edge of TI1, TIMx_SMCTRL.SMSEL = ‘001’; Nations Technologies Inc. 325 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 326: Table 10-1 Counting Direction Versus Encoder Signals

    3. The input is valid on both rising and falling edges (TIMx_SMCTRL.SMSEL = ‘011’); 4. Enable counter TIMx_CTRL1.CNTEN= ‘1’; Nations Technologies Inc. 326 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 327: Figure 10-32 Example Of Counter Operation In Encoder Interface Mode

    Figure 10-33 Encoder interface mode example with IC1FP1 polarity inverted forward jitter backward jitter Counter down Nations Technologies Inc. 327 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 328 Interfacing with Hall sensor Please refer to 9.3.20. Nations Technologies Inc. 328 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 329: Register Overview

    TIMx_CCMOD2 Output comparison 01Ch mode Reset Value TIMx_CCMOD2 Input capture mode 01Ch Reset Value TIMx_CCEN 020h Reset Value Nations Technologies Inc. 329 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 330: Control Register 1 (Timx_Ctrl1)

    Reset Value TIMx_DADDR BURST[15:0] 04Ch Reserved Reset Value Control register 1 (TIMx_CTRL1) Offset address: 0x00 Reset value: 0x0000 0000 Nations Technologies Inc. 330 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 331 01: Center-aligned mode 1. The counter counts in center-aligned mode, and the output compare interrupt flag bit is set to 1 when down-counting. Nations Technologies Inc. 331 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 332 Note: external clock, gating mode and encoder mode can only work after TIMx_CTRL1.CNTEN bit is set in the software. Trigger mode can automatically set TIMx_CTRL1.CNTEN bit by hardware. Nations Technologies Inc. 332 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 333 1: When an update event occurs, a DMA request for CCx is sent. Reserved Reserved, the reset value must be maintained Nations Technologies Inc. 333 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 334 , N = 8 SAMPLING CK_INT 0100: f /2, N = 6 SAMPLING 0101: f /2, N = 8 SAMPLING Nations Technologies Inc. 334 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 335 In this mode, the start and stop of the counter are controlled. Nations Technologies Inc. 335 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 336: Dma/Interrupt Enable Registers (Timx_Dinten)

    0: Disable capture/compare 2 DMA request 1: Enable capture/compare 2 DMA request CC1DEN Capture/Compare 1 DMA request enable Nations Technologies Inc. 336 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 337: Status Registers (Timx_Sts)

    Reserved, the reset value must be maintained CC4OCF Capture/Compare 4 overcapture flag See TIMx_STS.CC1OCF description. CC3OCF Capture/Compare 3 overcapture flag See TIMx_STS.CC1OCF description. Nations Technologies Inc. 337 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 338 When TIMx_CTRL1.UPRS = 0, TIMx_CTRL1.UPDIS = 0, and set the TIMx_EVTGEN.UDGN bit by software to reinitialize the CNT. Nations Technologies Inc. 338 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 339: Event Generation Registers (Timx_Evtgen)

    DMA will be generated. If The IMx_STS.CC1ITF is already pulled high, pull TIMx_STS.CC1OCF high. 0: No action 1: Generated a CC1 capture/compare event Nations Technologies Inc. 339 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 340 OC1 and OC1N, and is valid at high levels, while the active levels of OC1 and OC1N depend on the TIMx_CCEN.CC1P and TIMx_CCEN.CC1NP bits. Nations Technologies Inc. 340 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 341 TIMx_SMCTRL.TSEL. Note: CC1SEL is writable only when the channel is off (TIMx_CCEN.CC1EN = 0). Nations Technologies Inc. 341 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 342 01: Capture is done once every 2 events 10: Capture is done once every 4 events 11: Capture is done once every 8 events Nations Technologies Inc. 342 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 343 Output compare 3 clear enable OC3MD[2:0] Output compare 3 mode OC3PEN Output compare 3 preload enable OC3FEN Output compare 3 fast enable Nations Technologies Inc. 343 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 344 Note: CC3SEL is writable only when the channel is off (TIMx_CCEN.CC3EN = 0). Capture/compare enable registers (TIMx_CCEN) Offset address: 0x20 Reset value: 0x0000 Nations Technologies Inc. 344 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 345 At this time, this bit is used to disable/enable the capture function. 0: Disable capture 1: Enable capture Nations Technologies Inc. 345 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 346: Counters (Timx_Cnt)

    Each time an update event occurs, the PSC value is loaded into the active prescaler register. Auto-reload register (TIMx_AR) Offset address: 0x2C Reset values: 0xFFFF Nations Technologies Inc. 346 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 347 CC2 channel is configured as output: CCDAT2 contains the value to be compared to the counter TIMx_CNT, signaling on the OC2 output. Nations Technologies Inc. 347 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 348 When configured as output mode, register CCDAT3 is readable and writable. Capture/compare register 4 (TIMx_CCDAT4) Offset address: 0x40 Reset value: 0x0000 Bit field Name Description Nations Technologies Inc. 348 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 349 And then the second access to the TIMx_DADDR, you will access the address of DMA Base Address + 4” “ 00000: TIMx_CTRL1, 00001: TIMx_CTRL2, 00010: TIMx_SMCTRL, … Nations Technologies Inc. 349 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 350 For the fourth time, DMA access to the TIMx_ DADDR register will be mapped to access TIMx_CCDAT4 register; Channel 1 filter register (TIMx_C1FILT) Offset address: 0x70 Reset value: 0x0000 0000 Nations Technologies Inc. 350 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 351 Reserved, the reset value must be maintained 29:24 THRESH[5:0] Threshold number of sample logic level to be valid, maximum 63: Nations Technologies Inc. 351 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 352 Same rule applies to logic low. If Nations Technologies Inc. 352 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 353 Threshold value should set to more than or equal to half of Window value. Recommend threshold range is: Nations Technologies Inc. 353 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 354 Channel 3 Filter output, read only C2_FILTO Channel 2 Filter output, read only C1_FILTO Channel 1 Filter output, read only Nations Technologies Inc. 354 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 355: Figure 11-1 Block Diagram Of Timx(X = 6

    The counter CK_CNT is valid only when the TIMx_CTRL1.CNTEN bit is set. The counter starts counting one clock cycle after the TIMx_CTRL1.CNTEN bit is set. Nations Technologies Inc. 355 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 356: Figure 11-2 Counter Timing Diagram With Prescaler Division Change From 1 To 4

    • Update auto-reload shadow registers with preload value(TIMx_AR), when TIMx_CTRL1.ARPEN = 1. • The prescaler shadow register is reloaded with the preload value(TIMx_PSC) Nations Technologies Inc. 356 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 357: Figure 11-3 Timing Diagram Of Up-Counting. The Internal Clock Divider Factor = 2/N

    Internal clock CK_PSC divided by N Timer clock = CK_CNT Counter register Counter overflow Update interrupt flag(UDITF) Update event(UEV) Nations Technologies Inc. 357 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 358: Figure 11-4 Timing Diagram Of The Up-Counting, Update Event When Arpen=0/1

    Counter overflow Update event(UEV) Update interrupt flag(UDITF) Auto-reload preload register Write a new value in TIMx_AR Auto-reload shadow register Nations Technologies Inc. 358 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 359: Figure 11-5 Control Circuit In Normal Mode, Internal Clock Divided By 1

    For abbreviations used in registers, see section 1.1 These peripheral registers can be operated as half word (16-bits) or one word (32-bits). Nations Technologies Inc. 359 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 360: Table 11-1 Register Overview

    Offset address: 0x00 Reset value: 0x0000 Bit field Name Description 15:8 Reserved Reserved, the reset value must be maintained Nations Technologies Inc. 360 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 361 0: Disable update DMA request 1: Enable update DMA request Reserved Reserved, the reset value must be maintained Nations Technologies Inc. 361 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 362 1: Timer counter will restart and all shadow register will be updated. It will restart prescaler counter also. Nations Technologies Inc. 362 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 363 These bits define the value that will be loaded into the actual auto-reload register. See 11.3.1 for more details. When the TIMx_AR.AR [15:0] value is null, the counter does not work. Nations Technologies Inc. 363 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 364  Configurable I/O polarity  Encoder mode  Pulse counting mode, support single pulse counting, double pulse counting (orthogonal and non-orthogonal) Nations Technologies Inc. 364 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 365: Figure 12-1 Lptim Diagram

     The LPTIM only use external clock from comparator or external input1. This configuration is suitable for LOW Nations Technologies Inc. 365 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 366: Table 12-1 Pre-Scalar Division Ratios

    The filter sensitivity acts on the number of consecutive equal samples that should be detected on one of the LPTIM inputs to consider a signal level change as a valid transition. Nations Technologies Inc. 366 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 367: Table 12-2 9 Trigger Inputs Corresponding To Lptim_Cfg.trgsel[3:0] Bits

    Note: Any write to the LPTIM_CTRL.SNGMST/ LPTIM_CTRL.TSTCM bit will be discarded if the LPTIM is not enabled. Table 12-2 9 trigger inputs corresponding to LPTIM_CFG.TRGSEL[3:0] bits Corresponding trigger input Control bits Nations Technologies Inc. 367 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 368 If software trigger is used, setting LPTIM_CTRL.TSTCM bit will start the internal counter for continuous mode. Any subsequent external trigger event will be discarded as shown in Figure 12-3. Nations Technologies Inc. 368 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 369: Figure 12-3 Lptim Output Waveform, Continuous Counting Mode Configuration

    (containing a zero value), the timer is restarted for a new count cycle, as shown in Figure 12-4. Nations Technologies Inc. 369 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 370: Figure 12-4 Ptim Output Waveform, Single Counting Mode Configuration

    In case of software start (LPTIM_CFG.TRGEN[1:0] = ‘00’), the LPTIM_CTRL.SNGMST setting will start the counter for one-shot counting. Nations Technologies Inc. 370 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 371 Figure 12-6 below shows the three possible waveforms that can be generated on the LPTIM output. Also, it shows the effect of the polarity change using the LPTIM_CFG.WAVEPOL bit. Nations Technologies Inc. 371 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 372: Figure 12-6 Waveform Generation

    The LPTIM_INTSTS.ARRUPD flag and the LPTIM_INTSTS.CMPUPD flag indicate when the write operation is completed to respectively the LPTIM_ARR register and the LPTIM_COMP register. Nations Technologies Inc. 372 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 373 Input1 and Input2 inputs must not exceed the LPTIM internal clock frequency divided by 4. This is mandatory in order to guarantee a proper operation of the LPTIM. Nations Technologies Inc. 373 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 374: Table 12-3 Encoder Counting Scenarios

    ‘0’. Also, the prescaler division ratio must be equal to its reset value which is 1 (LPTIM_CFG.CLKPRE[2:0] bits must be ‘000’). Nations Technologies Inc. 374 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 375: Figure 12-7 Encoder Mode Counting Sequence

    To activate the Non-Encoder mode the LPTIM_CFG.NENC bit has to be set to ‘1’. The LPTIM must first be configured in Continuous mode. Nations Technologies Inc. 375 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 376: Figure 12-8 Input Waveforms Of Input1 And Input2 When The Decoder Module Is Working Normally

    The waiting time is configured through the timeout value. Nations Technologies Inc. 376 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 377: Table 12-4 Interruption Events

    Direction change – UP flag signals up-counting direction change – DOWN flag signals down-counting direction change. Nations Technologies Inc. 377 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 378: Table 12-5 Lptim Register Overview

    OPT1 020h Reserved Reset Value LPTIM interrupt and status register (LPTIM_INTSTS) Address offset: 0x00 Reset value: 0x0000 0000 Nations Technologies Inc. 378 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 379 Direction change to down Clear Flag Writing 1 to this bit clear the DOWN flag in the LPTIM_INTSTS register Nations Technologies Inc. 379 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 380 External trigger valid edge interrupt enable bit. 0:EXTRIG interrupt disabled 1:EXTRIG interrupt enabled ARRMIE Auto reload match interrupt enable bit. Nations Technologies Inc. 380 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 381 0: The LPTIM output reflects the compare results between LPTIM_ARR and LPTIM_COMP registers 1: The LPTIM output reflects the inverse of the compare results between Nations Technologies Inc. 381 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 382 100: / 16 101: / 32 110: / 64 111: / 128 Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 382 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 383 The CKSEL bit selects which clock source the LPTIM will use: 0: LPTIM is clocked by internal clock source (APB1 clock or any of the embedded oscillators) Nations Technologies Inc. 383 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 384 LPTIM enable The LPTIMEN bit is set and cleared by software. 0: LPTIM is disabled 1: LPTIM is enabled Nations Technologies Inc. 384 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 385 This value must be strictly greater than the LPTIM_COMP.CMPVAL[15:0] value. LPTIM counter register (LPTIM_CNT) Address offset: 0x1C Reset value: 0x0000 0000 Nations Technologies Inc. 385 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 386 01: LPTIM Input 1 is connected to COMP1_OUT 10: LPTIM Input 1 is connected to COMP2_OUT 11: LPTIM Input 1 is connected to COMP3_OUT Nations Technologies Inc. 386 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 387 Reset and low-power wake-up can be matched.  A system reset (if watchdog activated) occurs when the down counter reaches 0x000. Nations Technologies Inc. 387 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 388: Figure 13-1 Functional Block Diagram Of The Independent Watchdog Module

    IWDG_STS.PVU bit and/or IWDG_STS.CRVU bit. The reload operation (IWDG_KEY.KEYV[15:0] configured with value of 0xAAAA) will also cause the registers to Nations Technologies Inc. 388 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 389 Pre-scale register and reload register controls the time that generates reset, as shown in Table 13-1. Nations Technologies Inc. 389 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 390: Table 13-1 Iwdg Counting Maximum And Minimum Reset Time

    IWDG register overview Table 13-2 IWDG register overview Offset Register IWDG_KEY KEYV[15:0] 0x00 Reserved Reset value 0x04 IWDG_PREDIV Reserved PD[2:0] Nations Technologies Inc. 390 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 391 Address offset : 0x04 Reset value : 0x00000000 Bit field Name Description 31:3 Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 391 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 392 IWDG_STS.CRVU bit is ‘0’. IWDG Status Register (IWDG_STS) Address offset : 0x0C Reset value : 0x00000000 Nations Technologies Inc. 392 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 393 Software can only try to change IWDG_PREDIV.PD[2:0] value when IWDG_KEY.KEYV[15:0] bits’ value is 0x5555 and this bit is 0. Nations Technologies Inc. 393 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 394: Figure 14-1 Watchdog Block Diagram

    Therefore, need to set any of higher 8 MSB bit (WWDG_CTRL.T [13:6]) to 1, preventing reset right Nations Technologies Inc. 394 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 395: Figure 14-2 Refresh Window And Interrupt Timing Of Wwdg

    MCU. Counter count down from 0x3FFF to 0x3F using scaled Nations Technologies Inc. 395 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 396: Table 14-1 Maximum And Minimum Counting Time Of Wwdg

    Software operates WWDG_STS. EWINTF[0] bit to clear wake-up interrupt flag; Configure WWDG_CFG. EWINT[16] bit to enable early wake-up interrupt. Nations Technologies Inc. 396 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 397: Table 14-2 Wwdg Register Overview

    ) PCLK1 cycles. A reset is produced when it rolls over from 0x40 to 0x3F (T6 becomes cleared). Nations Technologies Inc. 397 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 398 ‘0’. A write of ‘1’ has no effect. This bit is also set if the interrupt is not enabled. Nations Technologies Inc. 398 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 399 Interrupt generation  At the end of conversion  At the end of injection conversion  Analog watchdog event Nations Technologies Inc. 399 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 400: Table 15-1 Adc Pins

    Signal types Annotations analog power supply and: 2.4V ≤ V ≤ Input, analog power supply Equivalent to V (3.6V) Nations Technologies Inc. 400 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 401 When switching the ADC 1M clock source, you need to ensure that the HSI clock is turned on Nations Technologies Inc. 401 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 402: Figure 15-2 Adc Clock

    Regular sequence consists of multiple conversions, up to a maximum of 16. The ADC_RSEQx registers specify the regular channels and the conversion order of the regular channels. The ADC_RSEQ1.LEN[23:20] bits specified Nations Technologies Inc. 402 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 403: Figure 15-3 Adc Channels And Pin Connections

    Figure 15-3 ADC channels and Pin connections Internal channel  The temperature sensor connects to channel ADC_IN17  VDDA connects to channel ADC_IN18 Nations Technologies Inc. 403 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 404 ADC_CTRL2.ON to 1 again through software. To start the conversion and after 14 cycles, the end of conversion flag bit will be set to 1 after the conversion is completed. Nations Technologies Inc. 404 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 405: Table 15-2 Analog Watchdog Channel Selection

    All regular channels All injection and regular channels A single Injection channel A single Regulars of the channel Nations Technologies Inc. 405 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 406 When using this function, the time interval between Injected channel triggers are fired needs to be greater than the time it takes for the injection sequence to complete the transition. Nations Technologies Inc. 406 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 407: Figure 15-5 Injection Conversion Delay

    (If the last trigger occurs and the Nations Technologies Inc. 407 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 408: Figure 15-6 Calibration Sequence Diagram

    ADC_JOFFSETx register, so the result can be a negative value; for regular sequence , there is no need to subtract offset value. Nations Technologies Inc. 408 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 409: Table 15-3 Right-Align Data

    (10bit resolution) (8bit resolution) (6bit resolution) Table 15-4 Left-aligne data Injection sequence (12bit resolution) (10bit resolution) (8bit resolution) Nations Technologies Inc. 409 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 410: Table 15-5 Adc Is Used For External Triggering Of Regular Channels

    Table 15-5 ADC is used for external triggering of regular channels EXTRSEL[2:0] Trigger source Type TIM1_CC1 event TIM1_CC2 event Internal signal from the on-chip timer TIM1_CC3 event Nations Technologies Inc. 410 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 411: Table 15-6 Adc Is Used For External Triggering Of Injection Channels

    Through testing, it is found that the maximum Nations Technologies Inc. 411 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 412: Figure 15-7 Temperature Sensor And Vrefint Diagram Of The Channel

    ADC is powered on, so in order to shorten the delay, the ADC_CTRL2.TEMPEN and ADC_CTRL2.ON bits should be set at the same time. Nations Technologies Inc. 412 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 413: Table 15-7 Adc Interrupt

    Refer to Section 1. 1 for some abbreviations used in register descriptions. These peripheral registers must be operated in word (32-bit) mode. Nations Technologies Inc. 413 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 414: Table 15-8 Adc Register Overview

    ADC_JDAT4 JDAT4[15:0] 048h Reserved Reset Value ADC_DAT DAT[15:0] 04Ch Reserved Reset Value ADC_DIFSEL DIFSEL[18:0] 050h Reserved Reset Value Nations Technologies Inc. 414 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 415 This bit is set by hardware at the end of all injection sequence channel conversions and cleared by software Nations Technologies Inc. 415 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 416 The software uses these bits to define the number of channels for converting regulars after receiving an external trigger in intermittent mode Nations Technologies Inc. 416 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 417 In scan mode, if the watchdog detects an out-of-range value, the scan is aborted only when that bit is set. 0: Disable simulated watchdog interruption. Nations Technologies Inc. 417 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 418 ADC_CTRL2.EXTRSEL[2:0] bit, which is used to initiate the conversion of a set of regular channels 0: Reset state. 1: Starts converting the regular channel. Nations Technologies Inc. 418 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 419 0: Do not use DMA mode. 1: Use DMA mode. Reserved Reserved, the reset value must be maintained Nations Technologies Inc. 419 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 420 111: 239.5 cycles ADC_SAMPT3.SAMPSEL = 1, the sampling time is set as follows: 000: 1.5 cycles 100: 19.5 cycles Nations Technologies Inc. 420 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 421 111: 601.5 cycles ADC injected channel data offset register x (ADC_JOFFSETx) (x=1…4) Address offset: 0x14-0x20 Reset value: 0x0000 0000 Nations Technologies Inc. 421 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 422 Reserved, the reset value must be maintained 11:0 LTH[11:0] Analog watchdog low threshold These bits define the low thresholds for analog watchdog. Nations Technologies Inc. 422 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 423 These bits are software-defined as the number (0 to 18) of the 12th conversion channel in the conversion sequence. 24:20 SEQ11[4:0] 11th conversion in regular sequence 19:15 SEQ10[4:0] 10th conversion in regular sequence Nations Technologies Inc. 423 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 424 These bits are software-defined as the number of channels in the injected channel conversion sequence. 00: 1 conversion Nations Technologies Inc. 424 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 425 These bits are read-only and contain the conversion results of the injected channel. The data is left- aligned or right-aligned ADC regulars data register (ADC_DAT) Address offset: 0x4C Reset value: 0x0000 0000 Reserved DAT[15:0] Nations Technologies Inc. 425 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 426 This bit can be written by hardware or software After the differential input calibration is complete, the hardware will update it according to the calibration coefficient. Nations Technologies Inc. 426 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 427 This bit is set and cleared by the software to enable/disable regular channel conversion to end the interrupt Nations Technologies Inc. 427 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 428 Address offset: 0x5C Reset value: 0x0000 0000 Bit field Name Description 31:4 Reserved Reserved, the reset value must be maintained Nations Technologies Inc. 428 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 429 011: 7.5 cycles 111: 601.5 cycles SAMP18[2:0] Channel Sample Time The channel sampling time definition is consistent with ADC_SAMPT2 Nations Technologies Inc. 429 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 430: Figure 16-1 Comparator Controller Functional Diagram

    PA15 Polarity TIM1_BKIN Selection TIM1_OCrefClear TIM1_IC1 TIM2_OCrefClear TIM3_OCrefClear TIM4_IC1 TIM4_OCrefClear TIM5_IC1 TIM8_IC1 TIM8_OCrefClear VREF_VC2 TIM8_BKIN TIM1_BKIN +TIM8_BKIN LPTIM_ETR Nations Technologies Inc. 430 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 431 COMP configuration process Complete configuration items are as follows. If the default configuration is used, skip the corresponding configuration items. Nations Technologies Inc. 431 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 432 OUT. The comparator INP pin has the following configuration. INPSEL COMP1 COMP2 COMP3 Nations Technologies Inc. 432 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 433 COMP supports interrupt response, and COMP1, COMP2, and COMP3 each occupy one interrupt entry. There are two cases of interrupt generation as follows. Nations Technologies Inc. 433 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 434: Table 16-1 Comp Register Overview

    020h Reserved Reset Value COMP2_FILC SAMPW [4:0] THRESH[4:0] 024h Reserved Reset Value COMP2_FILP CLKPSC[15:0] 028h Reserved Reset Value Nations Technologies Inc. 434 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 435 Software controlled Interrupt enable of COMP2. 0: Disable 1: Enable CMP1IEN Software controlled Interrupt enable of COMP1. 0: Disable Nations Technologies Inc. 435 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 436 0: Comparators 1 and 2 are not in window mode. 1: Comparators 1 and 2 are in window mode. Nations Technologies Inc. 436 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 437 0: Output is low (non-inverting input below inverting input). 1: Output is high (non-inverting input above inverting input). Nations Technologies Inc. 437 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 438 Note: Depending on the product, when a timer is not available, the corresponding combination is reserved. Reserved Reserved, the reset value must be maintained INPSEL[2:0] Comparator 1 non-inverting input selection. Nations Technologies Inc. 438 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 439 For proper operation, the value of THRESH must be greater than SAMPW / 2. FILEN Filter enable. 0: Disable Nations Technologies Inc. 439 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 440 PWRMODE Power mode of Comparator 2 These bits are set and cleared by software(only if LOCK not set). Nations Technologies Inc. 440 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 441 Reserved, the reset value must be maintained INPSEL[2:0] Comparator 2 non-inverting input selection. 000: Window mode connection (PA1) 001: PA3 Nations Technologies Inc. 441 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 442 For proper operation, the value of THRESH must be greater than SAMPW / 2. FILEN Filter enable. 0: Disable 1: Enable Nations Technologies Inc. 442 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 443 Bit select to choose COPM2 output or the XOR output(comparison of COMP1&2) outputs 0: COMP2 Output 1: XOR(comparison) output between results of COMP1 and COMP2 Nations Technologies Inc. 443 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 444 These bits select which Timer input must be connected with the comparator 3 output. 0000: Reserved. 0001: TIM1_BKIN 0010: TIM1_OCrefclear 0011: TIM1_IC1 0100: TIM2_IC1 Nations Technologies Inc. 444 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 445 0: Comparator disabled 1: Comparator enabled COMP3 filter register (COMP3_FILC) Address offset : 0x34 Reset value : 0x0000 0000 Nations Technologies Inc. 445 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 446 2: Every 3 cycle … COMP reference voltage register (COMP_VREFSCL) Address offset : 0x40 Reset value : 0x0000 0000 Nations Technologies Inc. 446 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 447 Comparator biasing current test enable by software. Once enabled, the biasing current can be measured on comp_ib_test. 0: disable 1: enable Comparator VREF test enable by software: 0: disable 1: enable Nations Technologies Inc. 447 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 448 This bit indicate the interrupt status of COMP2,write 0 to clear. COMP1IS This bit indicate the interrupt status of COMP1,write 0 to clear. Nations Technologies Inc. 448 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 449 It support interrupt mode, users can turn on or disable interrupt according to their needs. Nations Technologies Inc. 449 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 450 The block diagram of I C interface is shown in the figure below. Nations Technologies Inc. 450 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 451: Figure 17-1 Functional Block Diagram Of I 2 C

    This process is generally named Clock Synchronization and Arbitration. I2C module has two key features: Nations Technologies Inc. 451 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 452 The I2C host is responsible for generating the start bit and the end bit in order to start and end a transmission. And is responsible for generating the SCL clock. Nations Technologies Inc. 452 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 453 I2C_STS1.TXDATE bit is set after the second last byte is sent until the stop end bit is detected. Nations Technologies Inc. 453 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 454: Figure 17-3 Transfer Sequence Diagram Slave Transmitter

    3. When the first byte is received, the I2C_STS1.RXDATNE bit (the received data is not empty) is set to 1 by hardware. If the I2C_CTRL2.EVTINTEN and I2C_CTRL2.BUFINTEN bits are set, an interrupt is generated. Nations Technologies Inc. 454 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 455: Figure 17-4 Transfer Sequence Diagram Of Slave Receiver

    I2C timing. When these two steps are completed, I2C runs in the slave mode by default, waiting for receiving the start bit and address. Nations Technologies Inc. 455 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 456 The software sets the I2C_CTRL1.STOPGEN bit at this time to generate a stop condition, and then the I2C interface will automatically return to the slave mode (I2C_STS2.MSMODE bit is cleared). Nations Technologies Inc. 456 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 457: Figure 17-5 Master Transmitter Transmission Sequence Diagram

    (I2C_STS2.MSMODE bit is set to 1). Once the start condition is issued, the I2C hardware sets I2C_STS1.STARTBF(start bit flag) and enters the host Nations Technologies Inc. 457 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 458 Since I2C_CTRL1.ACKEN has been cleared to 0 in the previous step, I2C no longer sends ACK for the last Nations Technologies Inc. 458 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 459: Figure 17-6 Master Receiver Transmission Sequence Diagram

    I2C errors mainly include bus error, acknowledge error, arbitration loss, overload\ underload error. These errors may cause communication failure. Nations Technologies Inc. 459 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 460 Before transfer current byte at the end DMA requests must be answered. If set the DMA channel transfer data is done, DMA will send EOT(End Of Transmission) to I2C, and ocurrs a interrupt when enable interrupt bit. Nations Technologies Inc. 460 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 461 In DMA_CHCFGx register clear DIR to configure when ocurrs a interrupt request whether received half data or all data is received. In the DMA_CHCFGx register set CHEN bit to activate the channle. Nations Technologies Inc. 461 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 462 SMBus base on I2C commincate standard. SMBus have a control bus for system and power management Nations Technologies Inc. 462 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 463: Table 17-1 Comparison Between Smbus And I2C

    SMBus specification v2.0(http://smbus.org/specs/). User’s software can device what protocols are implemented. : Note SMBus does not support Quick command protocol Nations Technologies Inc. 463 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 464 The communication process on SMBus is similar to that on I2C.To use the SMBus mode, you need to configure Nations Technologies Inc. 464 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 465: Table 17-2 I 2 C Interrupt Request

    OR. 2. BUSERR, ARLOST, ACKFAIL, OVERRUN, PECERR, TIMEOUT and SMBALERT are merged into the error Nations Technologies Inc. 465 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 466: Table 17-3 I2C Register Overview

    Reserved Reset Value I2C_TMRISE SCLDFW[3:0] SDADFW[3:0] TMRISE[5:0] 020h Reserved Reset Value Control register 1 (I2C_CTRL1) Address offset: 0x00 Nations Technologies Inc. 466 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 467 It can be set or cleared by software. Or when I2C_CTRL1.EN equals to 0, it will be cleared by ACKEN hardware. 0:No acknowledge send; 1:Send an acknowledge after receiving a byte STOPGEN Stop generation Nations Technologies Inc. 467 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 468 Reserved, the reset value must be maintained. SMBus mode SMBMODE 0:I2C mode; 1:SMBus mode. I2C Peripheral enable 0:Disable I2C module; 1:Enable I2C module Nations Technologies Inc. 468 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 469 I2C_STS1.RXDATNE = 1 if I2C_CTRL2.BUFINTEN = 1 ERRINTEN Error interrupt enable 0:Disable error interrupt; 1:Enable error interrupt. This interrupt is generated when: Nations Technologies Inc. 469 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 470 7~1 bits of the address. ADDR0 Interface address 0 bit of the address. Note: don't care these bits in 7-bit address mode Nations Technologies Inc. 470 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 471 Status register 1 (I2C_STS1) Address offset: 0x14 Reset value: 0x0000 Nations Technologies Inc. 471 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 472 Writing ‘0’ to this bit by software can clear it, or it is cleared by hardware when I2C_CTRL1.EN=0. 0: No acknowledge failed; 1: Acknowledge failed. ARLOST Arbitration lost (master mode) Nations Technologies Inc. 472 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 473 After a ACK, the hardware sets this bit to' 1' when the slave device detects a stop condition on the bus. Nations Technologies Inc. 473 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 474 1: Start condition has been sent. This bit is set to' 1' when the start condition is sent. Nations Technologies Inc. 474 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 475 At the end of the whole address transmission stage, this bit is set according to the R/W bit of the address byte. BUSY Bus busy Hardware clears this bit when a stop condition is detected. Nations Technologies Inc. 475 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 476 If duty cycle = Tlow/Thigh = 2/1: CLKCTRL = f (Hz)/100000/3 PCLK1 Tlow = 2 × CLKCTRL× T PCLK1 Thigh = CLKCTRL× T PCLK1 Nations Technologies Inc. 476 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 477 01: 15ns 10: 25ns 11: 35ns Note: analog filter has a wide range of variance with different PVT Nations Technologies Inc. 477 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 478 If the result is not an integer, write the integer part to TMRISE[5:0] to ensure the t parameter. HIGH Nations Technologies Inc. 478 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 479 LIN break frame detection, noise flag/overflow error/frame error in multi-buffer communication Nations Technologies Inc. 479 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 480: Figure 18-1 Usart Block Diagram

    TX pin is pulled high. When the transmitter is inactive, the TX pin reverts to the I/O port configuration. RX is an input pin for serial data reception, data is recovered by oversampling technique. Nations Technologies Inc. 480 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 481 A break frame means that all bits in one frame period receive '0'. At the end of the break frame, the transmitter inserts 1 or 2 more stop bits ('1') to acknowledge the start bit. Nations Technologies Inc. 481 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 482: Figure 18-2 Word Length = 8 Setting

    USART_CTRL1.TXEN is reset during a data transfer, it will cause the baud rate counter to stop counting and the data being transferred will be corrupted. Nations Technologies Inc. 482 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 483: Table 18-1 Stop Bit Configuration

    9-bit data, the break frame consists of 11 bits of low level, followed by a stop bit. Nations Technologies Inc. 483 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 484 When a frame containing data is sent and USART_STS.TXDE=1, the USART_STS.TXC bit is set to '1' by hardware. Nations Technologies Inc. 484 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 485: Figure 18-5 Txc/Txde Changes During Transmission

    10th bits have two '0' points, then it is confirmed that the start bit is received, but it will be set bit NEF noise flag. Nations Technologies Inc. 485 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 486: Figure 18-6 Start Bit Detection

    USART_STS.RXDNE at the end of the 1.5th stop bit. The 1.5 stop bits were sampled at points 16, 17 and 18. Nations Technologies Inc. 486 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 487 The frame error flag(USART_STS.FEF) is set by hardware when the receiver detects a break frame. It can be cleared by a software sequence (read USART_STS register first, then write USART_DAT register). Nations Technologies Inc. 487 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 488: Table 18-2 Data Sampling For Noise Detection

    NE status Received bits Data validity Effective be invalid be invalid be invalid be invalid be invalid be invalid Nations Technologies Inc. 488 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 489 So USART_BRCF = 0x150 Example 3: If USART_BRCF = 0x19B: DIV_Integer = 0x19 = 25 DIV_Decimal = 0x0B = 11 Nations Technologies Inc. 489 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 490: Table 18-3 Error Calculation When Setting Baud Rate

    The tolerance of the USART receiver is equal to the maximum tolerable variation. Nations Technologies Inc. 490 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 491: Table 18-4 When Div_Fraction = 0. Tolerance Of Usart Receiver

    Make the number of '1' in the transmitted data (including parity bit ) be an odd number. That is: if Data=11000101, Nations Technologies Inc. 491 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 492 5. Start the channel. 6. After the data transfer is completed, the transfer complete flag (DMA_INTSTS.TXCFx) is set to 1. Nations Technologies Inc. 492 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 493: Figure 18-7 Transmission Using Dma

    5. Start the channel. Nations Technologies Inc. 493 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 494: Figure 18-8 Reception Using Dma

    Figure 18-9 hardware flow control between two USART DEVICE 1 DEVICE 2 TX control RX control RX control TX control Nations Technologies Inc. 494 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 495: Figure 18-10 Rts Flow Control

    If the USART_CTRL3.CTSEN bit is set, the USART_STS.CTSF bit will be set high by hardware when the nCTS input changes state. An interrupt will be generated if USART_CTRL3.CTSIEN is enabled. Nations Technologies Inc. 495 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 496: Figure 18-11 Cts Flow Controls

    As shown in the Figure 18-12 below, when an idle frame is detected, USART is woken up, and then Nations Technologies Inc. 496 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 497: Figure 18-12 Mute Mode Using Idle Line Detection

    USART_CTRL1.RCVWU is cleared. The USART_STS.RXDNE bit will be set when this matching address is received. Data can then be transmitted normally. Nations Technologies Inc. 497 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 498: Figure 18-13 Mute Mode Detected Using Address Mark

    USART_DAT register. The USART_CTRL2.LBCLK bit controls whether to output the clock pulse corresponding to the last data byte (MSB) Nations Technologies Inc. 498 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 499: Figure 18-14 Usart Synchronous Transmission Example

    But setup time and hold time (depending on baud rate, 1/16 bit time) must be considered. Figure 18-14 USART synchronous transmission example Nations Technologies Inc. 499 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 500: Figure 18-15 Usart Data Clock Timing Example (Wl=0)

    Clock(CLKPOL=0,CLKPHA=0) Clock(CLKPOL=0,CLKPHA=1) Clock(CLKPOL=1,CLKPHA=0) Clock(CLKPOL=1,CLKPHA=1) Data on TX (from master) MSB Stop Start LSB Data on RX (from slave) Nations Technologies Inc. 500 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 501: Figure 18-16 Usart Data Clock Timing Example (Wl=1)

    Single-wire half-duplex mode USART supports single-wire half-duplex communication, allowing data to be transmitted in both directions, but only Nations Technologies Inc. 501 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 502 IrDA receive line. If the USART is receiving data sent from the SIR receiver decoder, the data sent by the USART to the IrDA transmitter encoder will not be encoded. Nations Technologies Inc. 502 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 503: Figure 18-18 Irdasirendec-Block Diagram

    Figure 18-19 IrDA data Modulation (3/16)-normal mode Start TX normal Stop frame TX pin frame 3/16 RX pin frame Start RX normal Stop frame Nations Technologies Inc. 503 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 504 If a '1' is sampled before the 10th or 11th sample point, the current detection is canceled and the start bit is searched again. Nations Technologies Inc. 504 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 505: Figure 18-20 Break Detection In Lin Mode (11-Bit Break Length-The Linbdl Bit Is Set)

    Idle Bit0 Bit1 Bit2 Bit6 Bit7 Bit8 Bit9 Bit10 Bit3 Bit4 Bit5 wait delimiter Sample Sample data LINBDF Nations Technologies Inc. 505 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 506: Figure 18-21 Break Detection And Framing Error Detection In Lin Mode

    When a parity error is detected by receiver, the transmit data line is pulled low for one baud clock cycle at the end of Nations Technologies Inc. 506 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 507: Figure 18-22 Iso7816-3 Asynchronous Protocol

    (USART_GTP.GTV[7:0]). The clearing of the USART_STS.TXC flag is not affected by the smart card mode. The following figure details how USART samples NACK signals. Nations Technologies Inc. 507 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 508: Table 18-7 Usart Interrupt Request

    RXDNEIEN Data overrun error detected. ORERR IDLEF Idle line detected IDLEIEN Parity error PEIEN Disconnect flag LINBDF LINBDIEN Nations Technologies Inc. 508 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 509: Table 18-9 Usart Register Overview

    000h Reserved Reset Value USART_DAT DATV[8:0] 004h Reserved Reset Value DIV_Decimal USART_BRCF DIV_Integer[11:0] [3:0] 008h Reserved Reset Value Nations Technologies Inc. 509 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 510 ADDR[3:0] [1:0] 010h Reserved Reset Value USART_CTRL3 014h Reserved Reset Value USART_GTP GTV[7:0] PSCV[7:0] 018h Reserved Reset Value Nations Technologies Inc. 510 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 511 Setting USART_CTRL1.TXCIEN bit will generate an interrupt. This bit is cleared by software. 0: Transmitting did not complete. Nations Technologies Inc. 511 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 512 1: A framing error or a Break Character is detected. Note: this bit will not generate an interrupt because it appears with Nations Technologies Inc. 512 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 513 Reset value : 0x0000 0000 Note: The baud counter stops counting if USART_CTRL1.TXEN or USART_CTRL1.RXEN are disabled respectively. Nations Technologies Inc. 513 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 514 Parity control enable 0: Verification control is disabled. 1: Verification control is enabled. PSEL Parity selection. 0: even check. Nations Technologies Inc. 514 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 515 This bit is cleared by hardware during stop bit of the break frame transmission. 0: No break character was sent. 1: Send a break character. Nations Technologies Inc. 515 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 516 (MSB) is output on CK pin in synchronous mode. 0: The clock pulse of the last bit of data is not output from CK. Nations Technologies Inc. 516 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 517 If this bit is set to 1, an interrupt will be generated when USART_STS.CTSF bit is set. 0:CTS interrupt is disabled. 1:CTS interrupt is enabled. Nations Technologies Inc. 517 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 518 When DMA receive mode (USART_CTRL3.DMARXEN=1) is enabled, an interrupt will be generated when USART_STS.FEF, USART_STS. OREF or USART_STS. NEF Nations Technologies Inc. 518 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 519 0000: reserved-do not write this value. 0001: Divide the source clock by 2. 0010: Divide the source clock by 4. Nations Technologies Inc. 519 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 520 1111: Divide the source clock by 62. In Smartcard mode, PSCV[7:5] is reserved. Note: This bit is invalid for UART3/4. Nations Technologies Inc. 520 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 521  Steady state clock polarity programmable.  The data direction is always MSB first.  Supports DMA functionality. Nations Technologies Inc. 521 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 522: Figure 19-1 Spi Block Diagram

    I/O pin of the master device to control the NSS pin of the slave device. Software NSS mode Nations Technologies Inc. 522 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 523: Figure 19-2 Selective Management Of Hardware/Software

    Figure 19-2 Selective management of hardware/software The following figure is an example of the interconnection of single master and single slave devices Nations Technologies Inc. 523 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 524: Figure 19-3 Master And Slave Applications

    Figure 19-4 is the combination timing of four CLKPHA and CLKPOL bits transmitted by SPI when the SPI_CTRL1.LSBFF=0. Nations Technologies Inc. 524 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 525: Figure 19-4 Data Clock Timing Diagram

    MOSI pin. At the same time, the data received on the MISO pin is serially shifted into the shift register in the same order and then loaded into the SPI_DAT register in parallel. The software operation process is as follows: Nations Technologies Inc. 525 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 526: Figure 19-5 Schematic Diagram Of The Change Of Te/Rne/Busy When The Host Is Continuously Transmitting In Full Duplex Mode

    Wait for SPI_STS.TE bit to be set to '1', and write the second data to be sent into SPI_DAT. Repeat this operation to send subsequent data; Nations Technologies Inc. 526 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 527: Figure 19-6 Schematic Diagram Of Te/Busy Change When The Host Transmits Continuously In One-Way Only Mode

    The process of data receiving can also be implemented in the interrupt handler generated by the rising edge of the RNE flag(SPI_STS.RNE). Figure 19-7 Schematic diagram of RNE change when continuous transmission occurs in receive-only mode (BIDIRMODE=0 Nations Technologies Inc. 527 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 528 The data transfer process begins when the slave device receives the first clock edge. Before the master starts data transfer, software must ensure that the data to be send is written to the SPI_DAT register. Nations Technologies Inc. 528 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 529: Figure 19-8 Schematic Diagram Of The Change Of Te/Rne/Busy When The Slave Is Continuously Transmitting In

    The data receiving process begins when the slave device receives the clock signal and the first data bit from the Nations Technologies Inc. 529 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 530 In master mode, the sending process starts when data is written to the send buffer. If the next data has been written Nations Technologies Inc. 530 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 531: Figure 19-10 Schematic Diagram Of Te/Busy Change When Bidirmode = 0 And Ronly = 0 Are Transmitted

    When the send buffer is empty, the TE flag(SPI_STS.TE) is set to 1, which means that new data can be written into Nations Technologies Inc. 531 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 532 1. Wait for the penultimate RNE(SPI_STS.RNE) to be set to 1; 2. Before closing the SPI module (SPI_CTRL1.SPIEN=0), wait for 1 SPI clock cycle (using software delay); Nations Technologies Inc. 532 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 533 1, and wait for the BUSY flag(SPI_STS.BUSY) bit to be set to 0. Nations Technologies Inc. 533 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 534: Figure 19-11 Transmission Using Dma

    8-bit data frame format adopts CRC8, and the 16-bit data frame format adopts CRC16. The polynomial used in Nations Technologies Inc. 534 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 535 At this time, the overflow flag SPI_STS.OVER bit is set to 1. An interrupt is generated if the user enables the corresponding interrupt(SPI_CTRL2.ERRINTEN=1). All received data is lost, and the SPI_DAT register retains only previously unread data. Nations Technologies Inc. 535 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 536: Table 19-1 Spi Interrupt Request

    Receive buffer non empty flag RNEINTEN Master mode failure event MODERR Overflow error OVER ERRINTEN CRC error flag CRCERR Nations Technologies Inc. 536 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 537: Figure 19-13 I S Block Diagram

     MCLK: master clock (independent mapping, optional), output 256 × Fs clock signal to ensure better Nations Technologies Inc. 537 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 538 (MSB) is sent and will change on the falling edge of the clock signal. Nations Technologies Inc. 538 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 539: Figure 19-14 I S Philips Protocol Waveform (16/32-Bit Full Precision, Clkpol = 0)

    CPU will first read the SPI_DAT register to get 0x95AA, and then read the SPI_DAT register to get 0x6600 (only the upper 8-bit data is valid, and the lower 8-bit data is always 0). Nations Technologies Inc. 539 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 540 (MSB) are generated simultaneously. The standard data receiving and sending processing mode is the same as I S Philips standard. Nations Technologies Inc. 540 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 541: Figure 19-17 The Msb Is Aligned With 16-Bit Or 32-Bit Full Precision, Clkpol = 0

    Figure 19-18 MSB aligns 24-bit data, CLKPOL = 0 Send Receive 8-bit remaining 0 forced 24-bit data Right channel Left channel 32-bit Nations Technologies Inc. 541 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 542: Figure 19-19 Msb-Aligned 16-Bit Data Is Extended To 32-Bit Packet Frame, Clkpol = 0

    Figure 19-20 LSB alignment 16-bit or 32-bit full precision, CLKPOL = 0 Send Receive Left channel (16-bit or 32-bit) Right channel Nations Technologies Inc. 542 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 543: Figure 19-21 Lsb Aligns 24-Bit Data, Clkpol = 0

    RNE(SPI_STS.RNE) event will be generated. In this way, there is more time between 2 reads and writes, which can prevent underflow or overflow from happening. PCM standard Nations Technologies Inc. 543 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 544: Figure 19-23 Pcm Standard Waveform (16 Bits)

    In the master mode, the linear divider needs to be set correctly in order to obtain the desired audio frequency. Nations Technologies Inc. 544 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 545: Figure 19-25 I S Clock Generator Structure

    �� The exact audio frequency can be obtained by referring to the clock configuration in the table below. Nations Technologies Inc. 545 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 546: Table 19-2 Use The Standard 8Mhz Hse Clock To Get Accurate Audio Frequency

    When I2S works in master mode, the CLK pin outputs the serial clock, the WS pin generates the channel selection Nations Technologies Inc. 546 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 547 When I S function is turned off, different audio standards, data length and channel length adopt different operation steps: Nations Technologies Inc. 547 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 548 0 by hardware (software operation is invalid). In master receiving mode (SPI_I2SCFG.MODCFG=11), the BUSY flag(SPI_STS.BUSY) is set to 0 during receiving. Nations Technologies Inc. 548 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 549: Table 19-3 I 2 S Interrupt Request

    Working in I2S mode, it does not need data transmission protection function, so it does not need to support CRC, other DMA functions are the same as SPI mode. Nations Technologies Inc. 549 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 550: Table 19-4 Spi Register Overview

    BIDIRMODE Bidirectional data mode enable 0: Select the "two-wire one-way" mode. 1: Select the "one-wire bidirectional " mode. Nations Technologies Inc. 550 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 551 0: Disable software slave device management. 1: Enable software slave device management. Note: Not used in I S mode. Nations Technologies Inc. 551 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 552 1: Data is sampled on the second clock edge. Note: This bit cannot be changed during communication. Note: Not used in I S mode. Nations Technologies Inc. 552 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 553 0: Disable receive buffer DMA. 1: Enable receive buffer DMA. SPI status register (SPI_STS) Address: 0x08 Reset value: 0x0002 Nations Technologies Inc. 553 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 554 Receive buffer is not empty 0: The receive buffer is empty. 1: The receive buffer is not empty. Nations Technologies Inc. 554 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 555 SPI RX CRC register (SPI_CRCRDAT) (not used in I S mode) Address offset: 0x14 Reset value: 0x0000 Nations Technologies Inc. 555 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 556 Note: not used in I s mode. SPI_ I S configuration register(SPI_I2SCFG) Address offset: 0x1c Reset value: 0x0000 Nations Technologies Inc. 556 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 557 Note: For correct operation, this bit can only be set when I S is turned off. Note: not used in SPI mode. Nations Technologies Inc. 557 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 558 Note: For correct operation, this bit can only be set when I S is turned off. Use this bit only in S master mode. Not used in SPI mode. Nations Technologies Inc. 558 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 559 RTC provides a variety of ways to wakeup from all low-power modes (RUN mode, SLEEP mode, STOP0 mode, STOP2 mode and STANDBY mode. Nations Technologies Inc. 559 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 560: Table 20-1 Rtc Feature Support

    The Tamper event also causes an erase of Back up registers when enabled. It is also a Tamper source of hardware trigger to LP Timer. Nations Technologies Inc. 560 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 561: Figure 20-1 Rtc Block Diagram

    Tamper Detection RTC_TAMP3 TAM3F Erase RTC_BKP(1~20) RTC includes the following functions:  Alarm A and Alarm B event/interrupt Nations Technologies Inc. 561 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 562 RTC_WRP register. During or before and after the unlocking process, the write operation to other registers does not affect the unlocking result. Nations Technologies Inc. 562 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 563 ), and APB1 clock frequency lower than RTC clock frequency is not allowed in any RTCCLK case. System reset will reset shadow registers. Nations Technologies Inc. 563 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 564 Nations Technologies Inc. 564 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 565 When RTC_CTRL.OUTSEL[1:0] !=0, RTC_ALARM alternate function output is enable. There are Alarm A output, Alarm B output and Wakeup output to choose by the value of RTC_CTRL.OUTSEL[1:0] bits. Nations Technologies Inc. 565 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 566 Timestamp can be enabled by setting RTC_CTRL.TSEN bit to 1. When a timestamp event is detected on the RTC_TS Nations Technologies Inc. 566 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 567 RTC_BKP(1~20) will not occur at the same time. It is recommended to start the tamper detection function after writing RTC_BKP(1~20). Filtered level detection of RTC_TAMPx input Nations Technologies Inc. 567 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 568 ) can be calculated by using the formula given below: ������_����������.����∗512−������_����������.����[8:0] = �� ∗ (1 + ������������ + ������_����������.����[8:0] – ������_����������.���� ∗ 512 Nations Technologies Inc. 568 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 569 The new calibration settings will take effect within 3 ck_apre cycles after a data write to the RTC_CALIB. RTC low power mode The working state of RTC in low power mode. Nations Technologies Inc. 569 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 570: Table 20-2 Rtc Register Overview

    MIU[3:0] SET[2:0] SEU[3:0] 020h Reset Value RTC_WRP PKEY[7:0] 024h Reserved Reset Value RTC_SUBS SS[15:0] 028h Reserved Reset Value Nations Technologies Inc. 570 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 571 Describes the hour tens value in BCD format 19:16 HOU[3:0] Describes the hour units value in BCD format Nations Technologies Inc. 571 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 572 Describes the date units value in BCD format RTC Control Register (RTC_CTRL) Address offset: 0x08 Reset value: 0x0000 0000 Nations Technologies Inc. 572 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 573 1: Adds 1 hour to the current time. TSIEN Time-stamp interrupt enable 0: Disable time-stamp interrupt. 1: Enable time-stamp interrupt. Nations Technologies Inc. 573 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 574 TSE need to be reset when TEDGE is changed to avoid unwanted RTC_INITSTS.TISF setting. WKUPSEL[2:0] Wakeup clock selection 000: RTC clock is divided by 16 Nations Technologies Inc. 574 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 575 TISOVF only after clearing the TISF bit. Otherwise, an overflow might not be noticed if a timestamp event occurs immediately before the TISF bit is being cleared. Nations Technologies Inc. 575 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 576 RTC_SCTRL register. It is cleared by hardware when the corresponding shift operation has been completed, note that writing to the SHOPF bit has no effect. Nations Technologies Inc. 576 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 577 Synchronous prescaler factor /(DIVS[14:0]+1) ck_spre ck_apre RTC Wakeup Timer Register (RTC_WKUPT) Address offset: 0x14 Reset value: 0x0000 FFFF Nations Technologies Inc. 577 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 578 Describes the date units value in BCD format MASK3 Alarm hours mask 0: Hours match 1: Hours not match AM/PM notation Nations Technologies Inc. 578 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 579 0: Hours match 1: Hours not match AM/PM notation 0: AM or 24 hours format 1: PM format Nations Technologies Inc. 579 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 580 For detail on how to unlock RTC register write protection, see chapter RTC write protection register. RTC Sub-second Register (RTC_SUBS) Address offset: 0x28 Reset value: 0x0000 0000 Nations Technologies Inc. 580 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 581 When RTC_INITSTS.RSYF=1, the shadow registers have been updated with the shifted time. RTC Timestamp Time Register (RTC_TST) Address offset: 0x30 Reset value: 0x0000 0000 Nations Technologies Inc. 581 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 582 Describes the month tens value in BCD format 11:8 MOU[3:0] Describes the month units value in BCD format Nations Technologies Inc. 582 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 583 This feature is intended to be used along with CM[8:0]. When RTCCLK frequency is 32768 Hz, the number of RTCCLK pulses added during a 32-second window is ((512 Nations Technologies Inc. 583 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 584 0: Disable tamper 3 interrupt when TPINTEN = 0. 1: Enabled tamper 3 interrupt TP2MF Tamper 2 mask flag 0: Not mask tamper 2 event. Nations Technologies Inc. 584 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 585 0x4: Sampling once every 2048 RTCCLK. 0x5: Sampling once every 1024 RTCCLK. 0x6: Sampling once every 512 RTCCLK. Nations Technologies Inc. 585 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 586 1: Falling edge trigger a tamper detection event TP1EN Tamper 1 detection enable 0: Disable tamper detection 1: Enable tamper detection Nations Technologies Inc. 586 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 587 Address offset: 0x48 Reset value: 0x0000 0000 Bit field Name Description 31:28 Reserved Reserved, the reset value must be maintained Nations Technologies Inc. 587 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 588 0: Open-drain output 1: Push-pull output RTC Backup registers (RTC_ BKP(1~20)) Address offset: 0x50 to 0x9C Reset value: 0x0000 0000 Nations Technologies Inc. 588 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 589 If RTC_TMPCFG.TPxNOE=0, these registers are reset when tamper x event detection happens. Nations Technologies Inc. 589 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 590: Table 21-1 Max And Min Frequency Supported By Beeper And Corresponding Configure

    4 MHz output. Then by setting BEEPER_CTRL.BEEPDIV dumber of 250 we can get 8 KHz signal and with BEEPER_CTRL.BEEPDIV = 500 we can get 4 KHz signal. Nations Technologies Inc. 590 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 591: Table 21-2 Beeper Register Overview

    Beeper Control Register (BEEPER_CTRL) Address offset: 0x00 Reset value: 0x0000 0000 Reserved BYPASS Reserved BEEPDIV CLKSEL INVEN BEEPEN Nations Technologies Inc. 591 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 592 1: Both outputs are turned on, and the outputs are complementary BEEPEN Beeper enable 1: Beeper enable 0: Beeper disable Nations Technologies Inc. 592 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 593 CAN network. With increase number of CAN nodes, messages in CAN network also increase dramatically which will occupides lots of CPU resource. In this CAN controller, receive FIFOs and filter mechanism Nations Technologies Inc. 593 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 594: Figure 22-1 Topology Of Can Network

    CANTX pin is disabled. CAN is in normal mode when CAN_MSTS.INIAK and CAN_MSTS.SLPAK bits are both '0', and it must Nations Technologies Inc. 594 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 595 CAN bus activity is detected, regardless of whether the hardware is enabled to automatically wake up CAN. Nations Technologies Inc. 595 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 596: Figure 22-2 Can Working Mode

    CAN has two receiving FIFOs, each of which can store three complete messages. No application program is needed to manage it, and it is managed by hardware. Nations Technologies Inc. 596 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 597: Figure 22-3 Single Can Block Diagram

    To enter loopback mode, the CAN_BTIM.SLM bit should be cleared and the CAN_BTIM.LBM bit should be set. Nations Technologies Inc. 597 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 598: Figure 22-4 Loopback Mode

    CAN bus, without affecting the bus because dominant bits is not actually sent to the bus. To enter silent mode, the CAN_BTIM.SLM bit should be set and the CAN_BTIM.LBM bit should be cleared. Nations Technologies Inc. 598 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 599: Figure 22-5 Silent Mode

    To enter loopback silence mode, both the CAN_BTIM.SLM bit and the CAN_BTIM.LBM bit should be set. Figure 22-6 loopback silent mode CAN-CTRL transceiver CAN_Bus Nations Technologies Inc. 599 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 600 When more than one sending mailbox is registered, the sending order is determined by the identifier of the message in the mailbox. Nations Technologies Inc. 600 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 601 CAN_TSTS.RQCPM bit. At the same time, the transmission result can query the CAN_TSTS.TXOKM, CAN_TSTS.ALSTM and CAN_TSTS.TERRM bits. Nations Technologies Inc. 601 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 602: Figure 22-7 Send Mailbox Status

    Please refer to 22.4.5 Section: identifier filtering. Nations Technologies Inc. 602 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 603: Figure 22-8 Receive Fifo Status

    When the FIFO overrun, the FFOVR bit will be set . If the FIFO overrun interrupt is currently enabled (the Nations Technologies Inc. 603 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 604 And the filter group should be set to work in identifier list mode in order to filter out an identifier. Nations Technologies Inc. 604 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 605: Figure 22-9 Filter Bit Width Setting-Register Organization

    The filter ID is used to store the identifier format, and the filter MASK is used to indicate which bits must be checked and which bits can be ignored. Identifier list mode Nations Technologies Inc. 605 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 606: Table 22-1 Examples Of Filter Numbers

    32 bit list mode 16 bit list mode 2/3/4/5 FIFO1 32 bit mask mode 16 bit mask mode Nations Technologies Inc. 606 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 607: Figure 22-10 Examples Of Filter Mechanisms

    Message should be written into an empty sending mailbox by software before enable the sending request. You can query the CAN_TSTS register for the sending status. Nations Technologies Inc. 607 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 608: Table 22-2 Send Mailbox Register List

    In the above description, RSJW(the resynchronization hop width) defines the upper limit of how many time units can Nations Technologies Inc. 608 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 609: Figure 22-11 Bit Sequence

    (CAN_BTIM.TBS1[3:0] + 1), x (CAN_BTIM.TBS2[2:0] + 1), One-bit time = 1 x t BaudRate = One-bit time Nations Technologies Inc. 609 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 610: Figure 22-12 Various Can Frames

    13. send pause: applies to error passive nodes only. End Of Frame or Inter-Frame Space Error Delimiter or Overload Frame or Overload Frame Overload Delimiter Nations Technologies Inc. 610 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 611: Figure 22-13 Event Flag And Interrupt Generation

    When FIFO1 becomes full, the CAN_RFF1.FFULL1 bit is set. When FIFO1 overruns, and the CAN_ RFF1.FFOVR1 bit is set.  Send interrupts(CAN_TX_IRQn): Nations Technologies Inc. 611 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 612: Figure 22-14 Can Error State Diagram

    CAN configuration flow can divided into serval phases. Nations Technologies Inc. 612 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 613 For Reception: User can also change a filter value (CAN_FiRx) when the corresponding filter is deactivated. To deactivate Nations Technologies Inc. 613 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 614 In addition, only when the whole filter is set to the initialization mode (that is, CAN_FMC.FINITM=1), the settings of the filter can be modified, that is, the CAN_FM1,CAN_FS1 and CAN_FFA1 registers can be modified. Nations Technologies Inc. 614 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 615: Table 22-4 Can Register Overview

    Reset Value CAN_TMDL0 DATA3[7:0] DATA2[7:0] DATA1[7:0] DATA0[7:0] 188h Reset Value CAN_TMDH0 DATA7[7:0] DATA6[7:0] DATA5[7:0] DATA4[7:0] 18Ch Reset Value Nations Technologies Inc. 615 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 616 STDID[10:0]/EXTID[28:18] EXTID[17:0] 1C0h Reset Value CAN_RMDT1 MTIM[15:0] FMI[7:0] DLC[3:0] 1C4h Reset Value 1C8h CAN_RMDL1 DATA3[7:0] DATA2[7:0] DATA1[7:0] DATA0[7:0] Nations Technologies Inc. 616 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 617 240h Reset Value CAN_F0B2 FBC[31:0] 244h Reset Value CAN_F1B1 FBC[31:0] 248h Reset Value CAN_F1B2 FBC[31:0] 24Ch Reset Value Nations Technologies Inc. 617 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 618 Offset Register CAN_F13B1 FBC[31:0] 2A8h Reset Value CAN_F13B2 FBC[31:0] 2ACh Reset Value Nations Technologies Inc. 618 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 619 Notes: For more information about bus-off status, please refer to 22.5.1: Error management. Nations Technologies Inc. 619 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 620 CAN activity (sending or receiving) is over, the hardware sets the CAN_MSTS.INIAK bit and CAN enters initialization mode. Nations Technologies Inc. 620 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 621 If the CAN_INTE.ERRITE bit is set, a state change interrupt is generated. This bit is cleared by software. SLPAK Sleep acknowledge Nations Technologies Inc. 621 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 622 Transmit mailbox 2 empty When there is no message waiting to be sent in mailbox 2, hardware sets this bit. Nations Technologies Inc. 622 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 623 When the mailbox 1 fails to send due to the loss of arbitration, set this bit TXOKM1 Transmission OK of mailbox 1 Nations Technologies Inc. 623 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 624 CAN_TSTS.ALSTM0 and CAN_TSTS.TERRM0 bits) of mailbox 0 are also cleared. CAN receive FIFO 0 register (CAN_RFF0) Address offset: 0x0c Reset value: 0x0000 0000 Nations Technologies Inc. 624 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 625 Release FIFO 1 output mailbox. The software releases the output mailbox of the receive FIFO by setting this bit. If Nations Technologies Inc. 625 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 626 0: When there is an error registration in the CAN_ESTS register, no interrupt is generated; 1: When there is an error registration in the CAN_ESTS register, an interrupt is generated. Nations Technologies Inc. 626 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 627 Notes: Please refer to 22.5 Section CAN interrupt. CAN error status register (CAN_ESTS) Address offset: 0x18 Reset value: 0x0000 0000 Nations Technologies Inc. 627 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 628 (The value of the receiving error counter or the sending error counter is > 127). Nations Technologies Inc. 628 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 629 Baud rate prescaler This bit field defines the time length of the time unit (tq) =(BRTP[9:0]+1) x t PCLK Nations Technologies Inc. 629 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 630 When the mailbox is not empty, all bits in this register are write-protected. Address offset: 0x184, 0x194, 0x1A4 Reset value: undefined Nations Technologies Inc. 630 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 631 Name Describe 31:24 DATA3[7:0] Data byte 3 Data byte 3 of the message. 23:16 DATA2[7:0] Data byte 2 Nations Technologies Inc. 631 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 632 Receive FIFO mailbox identifier register (CAN_RMIx) (x=0..1) Address offset: 0x1B0, 0x1C0 Reset value: undefined Notes: All receiving mailbox registers are read-only. Nations Technologies Inc. 632 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 633 DLC is always 0. Receive FIFO mailbox low byte data register(CAN_RMDLx)( x=0..1) Address offset: 0x1B8, 0x1C8 Reset value: undefined Nations Technologies Inc. 633 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 634 Data byte 5 Data byte 5 of the message. DATA4[7:0] Data byte 4 Data byte 4 of the message. Nations Technologies Inc. 634 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 635 1: Two 32-bit registers of CAN_FiRx work in identifier list mode. CAN filter scale register (CAN_FS1) Address offset: 0x20C Nations Technologies Inc. 635 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 636 1: the filter is associated to FIFO1. CAN filter activation register (CAN_FA1) Address offset: 0x21C Reset value: 0x0000 0000 Nations Technologies Inc. 636 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 637 Notes: According to the different settings of filter bit width and mode, the functions of the two registers in the filter Nations Technologies Inc. 637 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 638 Mask/identifier register in mask mode has the same definition as register bit in identifier list mode. See for the address of the filter bank register Table 22-4. Nations Technologies Inc. 638 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 639: Figure 23-1 N32G430 Level And Cortex®-M4 Level Debugging Block Diagram

    -M4F core hardware debugging module can provide the following debugging functions:  SWJ-DP: serial /JTAG debug port  AHP-AP:AHB access port  ITM: execution tracking unit Nations Technologies Inc. 639 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 640 See the following Table for the pin allocation of JTAG debugging interface and SW debugging interface (SWDIO is multiplexed with JTMS, SWCLK is multiplexed with JTCK): Nations Technologies Inc. 640 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 641: Table 23-1 Debug Port Pin

    Timer peripheral: the timer counter stops and debugs;  I2C peripheral: the SMBUS of I2C keeps the state and carries out debugging; Nations Technologies Inc. 641 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 642: Table 23-2 Dbg Register Overview

    See the description of DEV_NUM_L[3:0]. 11:8 DEV_NUM_M[3:0] The middle 4 bits of device. See the description of DEV_NUM_L[3:0]. Nations Technologies Inc. 642 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 643 1: Window watchdog counter stops working. IWDG_STOP The watchdog stops working when the kernel enters the debugging state. Set or cleared by software. Nations Technologies Inc. 643 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 644 1:(FCLK ON, HCLK ON) In sleep mode, both the FCLK and HCLK clocks are provided by the previously configured system clock. Nations Technologies Inc. 644 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 645 UID register Start address: 0x1FFF_F7F0, 96 bits in length. UCID register Start address: 0x1FFF_F7C0, 128 bits in length. Nations Technologies Inc. 645 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 646 Version history Date Version Remark 2022.5.10 V1.0 Initial release Nations Technologies Inc. 646 / 647 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 647 It is the responsibility of the user of this document to properly design, program, and test the functionality and safety of any application made of this information and any resulting product. In no event shall NATIONS be liable for any direct, indirect, incidental, special, exemplary, or consequential damages arising in any way out of the use of this document or the Product.

Table of Contents