Nations N32L43 Series User Manual

32-bit arm cortex-m4f microcontroller
Table of Contents

Advertisement

Quick Links

N32L43x series
®
®
32-bit ARM
Cortex
-M4F microcontroller
User manual V2.2

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Summary of Contents for Nations N32L43 Series

  • Page 1 N32L43x series ® ® 32-bit ARM Cortex -M4F microcontroller User manual V2.2...
  • Page 2: Table Of Contents

    Clock security system (CLKSS) ........................57 LSE Clock security system (LSECSS) ......................58 RTC clock ................................ 58 Watchdog clock ............................... 58 Nations Technologies Inc. Tel:+86-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 Nested vector interrupt register ..........................124 SysTick calibration value register........................124 Interrupt and exception vectors ........................124 External interrupt/event controller (EXTI) ......................127 Introduction ..............................127 Nations Technologies Inc. Tel:+86-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 CRC cyclic redundancy check code register (CRC_CRC16D) ............... 157 LRC result register (CRC_LRC) ........................158 9 Cryptographic algorithm hardware acceleration engine (SAC) ................159 Nations Technologies Inc. Tel:+86-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 Main features of General-purpose timers ......................... 226 General-purpose timers description ......................... 227 Time-base unit ............................... 227 Counter mode ..............................228 Clock selection .............................. 234 Nations Technologies Inc. Tel:+86-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 13 Low Power Timer (LPTIM) ............................291 Introduction ................................291 Main Features ............................... 291 Block diagram ..............................292 Function description ............................. 292 Nations Technologies Inc. Tel:+86-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 RTC Prescaler Register (RTC_PRE) ......................332 RTC Wakeup Timer Register (RTC_WKUPT) ....................333 RTC Alarm A Register (RTC_ALARMA)..................... 333 RTC Alarm B Register (RTC_ALARMB)..................... 334 Nations Technologies Inc. Tel:+86-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 Timing diagram ............................. 363 Analog watchdog ............................364 Scanning mode .............................. 365 Injection channel management ........................365 Discontinuous mode ............................ 366 VIII Nations Technologies Inc. Tel:+86-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 COMP features ..............................400 COMP configuration process ..........................400 COMP working mode ............................401 Window mode ..............................401 Independent comparator ..........................401 Nations Technologies Inc. Tel:+86-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 LPRCNT sensor channel 0 threshold register(LPRCNT_CH0CFG0)............435 LPRCNT sensor channel 0 time control register (LPRCNT_CH0CFG1) ............. 435 LPRCNT sensor channel 1 threshold register (LPRCNT_CH1CFG0) ............436 Nations Technologies Inc. Tel:+86-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 I2C Clock control register (I2C_CLKCTRL) ....................495 I2C Rise time register (I2C_TMRISE) ......................496 24 Universal synchronous asynchronous receiver transmitter (USART) ..............498 Nations Technologies Inc. Tel:+86-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 LPUART wake up data register (LPUART_WUDAT) .................. 553 26 Serial peripheral interface/Inter-IC Sound (SPI/I2S) ..................... 555 Introduction ................................555 Main features ................................ 555 SPI features ..............................555 Nations Technologies Inc. Tel:+86-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 CAN Registers ..............................615 Register Description ............................615 CAN register overview ..........................616 CAN control and status register ........................619 XIII Nations Technologies Inc. Tel:+86-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 30 Unique device serial number (UID) .......................... 672 Introduction ................................672 UID register ................................672 UCID register ............................... 672 31 Version history ................................673 32 Notice ..................................674 Nations Technologies Inc. Tel:+86-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 Table 5-22 I2C2 alternate function remapping ......................104 Table 5-23 SPI1 alternate function remapping ......................104 Table 5-24 SPI2/I2S2 alternate function remapping ....................105 Nations Technologies Inc. Tel:+86-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 Table 11-2 TIMx register overview ........................... 257 Table 11-3 TIMx internal trigger connection ......................264 Table 11-4 Output control bits of standard OCx channel ..................274 Nations Technologies Inc. Tel:+86-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 24-4 When DIV_Decimal = 0. Tolerance of USART receiver ..............508 Table 24-5 When DIV_Decimal != 0. Tolerance of USART receiver ..............508 XVII Nations Technologies Inc. Tel:+86-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 28-8 Endpoint packet receive buffer size definition ..................664 Table 29-1 Debug port pin ............................668 Table 29-2 DBG register overview .......................... 669 XVIII Nations Technologies Inc. Tel:+86-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 Figure 10-15 Control circuit in external clock mode 2 .................... 173 Figure 10-16 Capture/compare channel (example: channel 1 input stage) .............. 174 Figure 10-17 Capture/compare channel 1 main circuit .................... 175 Nations Technologies Inc. Tel:+86-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 Figure 11-18 Center-aligned PWM waveform (AR=8) ................... 246 Figure 11-19 Edge-aligned PWM waveform (APR=8) ................... 247 Figure 11-20 Example of One-pulse mode ......................248 Nations Technologies Inc. Tel:+86-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 18-2 Data register of single DAC channel mode ..................390 Figure 18-3 Time diagram of transitions with trigger disable ................. 391 Figure 18-4 LFSR algorithm for DAC ........................392 Nations Technologies Inc. Tel:+86-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 24-6 Start bit detection ..........................504 Figure 24-7 Transmission using DMA ........................510 Figure 24-8 Reception using DMA .......................... 511 XXII Nations Technologies Inc. Tel:+86-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 26-10 Schematic diagram of TE/BUSY change when BIDIRMODE = 0 and RONLY = 0 are transmitted discontinuously ................................ 565 XXIII Nations Technologies Inc. Tel:+86-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 28-4 Double buffered bulk endpoint example ....................645 Figure 28-5 Control transfer ............................ 649 Figure 29-1 N32L43x level and Cortex -M4F level debugging block diagram ........... 666 XXIV Nations Technologies Inc. Tel:+86-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: Abbreviations In The Text

    For all models of N32L43x microcontroller series, the existence and number of a peripheral, please refer to the data sheet of the corresponding model. 1 / 674 Nations Technologies Inc. Tel:+86-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: Memory And Bus Architecture

    ICode bus: Connect the ICode bus of Cortex™-M4FP core with the flash instruction interface. Instruction prefetching is completed on this bus. 2 / 674 Nations Technologies Inc. Tel:+86-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: 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: 3 / 674 Nations Technologies Inc. Tel:+86-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: Table 2-1 List Of Peripheral Register Addresses

    0x4002_2000 – 0x4002_23FF FLASH 0x4002_1400 – 0x4002_1FFF Reserved 0x4002_1000 – 0x4002_13FF 0x4002_0C00 – 0x4002_0FFF Reserved 0x4002_0800 – 0x4002_0BFF 4 / 674 Nations Technologies Inc. Tel:+86-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 0x4000_3400 – 0x4000_37FF Reserved 0x4000_3000 – 0x4000_33FF IWDG 0x4000_2C00 – 0x4000_2FFF WWDG 0x4000_2800 – 0x4000_2BFF 0x4000_2400 – 0x4000_27FF COMP 5 / 674 Nations Technologies Inc. Tel:+86-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: Bit Banding

    During system startup, you can select the BOOT mode after the reset through the BOOT0 pin and the user option 6 / 674 Nations Technologies Inc. Tel:+86-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: Boot Configuration

    0x2000 0000 Main Flash start 0x1FFF_0000 0x0800_0000 0x1000 0000 System Memory 0x0000_0000 0x2000 0000 0x08000000 Start 0x1FFF_0000 0x1000 0000 7 / 674 Nations Technologies Inc. Tel:+86-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: Embedded Boot Loader

    Table 2-3 Flash bus address list Memory area Page name Address range Size 0x0800_0000 – 0x0800_07FF Main memory area Page 0 8 / 674 Nations Technologies Inc. Tel:+86-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 The internal RC oscillator (HSI) must be turned on when the flash memory is programmed (written or erased). Note: In the low power consumption mode, all flash memory operations are suspended. 9 / 674 Nations Technologies Inc. Tel:+86-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  Set the FLASH_CTRL.START bit to' 1';  Wait for the FLASH_ STS.BUSY bit to change to' 0'; 10 / 674 Nations Technologies Inc. Tel:+86-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 Unlock the FLASH_CTRL.OPTWE bit;  Set the FLASH_CTRL.OPTER bit to '1';  Set the FLASH_CTRL.START bit to '1'; 11 / 674 Nations Technologies Inc. Tel:+86-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: Option Byte

    0xFF. When the option byte and its complement are both 0xFF (the state after erasing), the above 12 / 674 Nations Technologies Inc. Tel:+86-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: Table 2-4 Option Byte List

     WRP1: write protection on pages 16-31, bit [0] corresponds to Page16 / 17,., bit [7] corresponds to Page30 / 31; 13 / 674 Nations Technologies Inc. Tel:+86-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: Write Protect

    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 14 / 674 Nations Technologies Inc. Tel:+86-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: Table 2-5 Read Protection Configuration List

     When the system is reset (such as software reset, etc.), the option byte block (including the new 15 / 674 Nations Technologies Inc. Tel:+86-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-6 Flash Read-Write-Erase (1) Permission Control Table

    Erase the main memory area is automatically erased. Flash main memory Allow Allow Allow Allow area mass erase 16 / 674 Nations Technologies Inc. Tel:+86-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 Allow Allow Allow Allow area mass erase Read-write- Read-write- Read-write- Flash option byte area Read-write-erase erase erase erase 17 / 674 Nations Technologies Inc. Tel:+86-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 L2 protection level, cannot boot from SRAM level Flash option byte area JTAG/SWD is banned. Flash system memory area SRAM (All) 18 / 674 Nations Technologies Inc. Tel:+86-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 Before 4KB of flash JTAG/SWD No modification Read-only Read-only Read-only level main memory area allowed interface is 19 / 674 Nations Technologies Inc. Tel:+86-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: Icache

    When all the ways are locked, the new data will not be written into the cache. After the software resets the cache, the lock state is automatically cleared. 20 / 674 Nations Technologies Inc. Tel:+86-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 Attention: 1. when the channel is latched, the register operation must follow a fixed process -First set FLASH_CAHR.LOCKSTRT then set FLASH_CAHR.LOCKSTOP; 21 / 674 Nations Technologies Inc. Tel:+86-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: Sram

    008h Reset Value FLASH_STS 00Ch Reserved Reset Value FLASH_CTRL 010h Reserved Reset Value FLASH_ADD FADD 014h Reset Value 22 / 674 Nations Technologies Inc. Tel:+86-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 1:FLASH working in sleep mode. LVMEN FLASH low-voltage working mode enable 0: Turn off FLASH low-voltage working mode; 23 / 674 Nations Technologies Inc. Tel:+86-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 Address offset: 0x04 Reset value: 0xXXXX XXXX Bit field Name Description 31:0 FKEY Used to unlock the FLASH_CTRL.LOCK bit. 24 / 674 Nations Technologies Inc. Tel:+86-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 '1', and writing '1' can clear this state. PGERR Programming error When trying to program an address whose content is not '0xFFFF_FFFF', the 25 / 674 Nations Technologies Inc. Tel:+86-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_STS.PGERR/ FLASH_STS.WRPERR is set to '1'). 0: interrupt generation is prohibited; 1: interrupt generation is allowed. OPTWE Allow write option byte 26 / 674 Nations Technologies Inc. Tel:+86-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 Note: Please refer to section 2.2.1.4 for programming and erasing. 2.2.4.2.6 The FLASH address register (FLASH_ADD) Address offset: 0x14 27 / 674 Nations Technologies Inc. Tel:+86-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 BOR reset level 000:1.64V 001:2.10V 010:2.30V 011:2.60V 100:2.90V Other: reserved Reserved Reserved, the reset value must be maintained. 28 / 674 Nations Technologies Inc. Tel:+86-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 Option byte error When this bit is '1', it means that the option byte does not match its complement. 29 / 674 Nations Technologies Inc. Tel:+86-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 After writing a word to a 32-bit Flash address, the corresponding lower 6-bit ECC value. 2.2.4.2.11 CAHR register (FLASH_CAHR) Address offset: 0x30 Reset value: 0x0000 0000 30 / 674 Nations Technologies Inc. Tel:+86-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 (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 31 / 674 Nations Technologies Inc. Tel:+86-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: Power Control (Pwr)

    The PWR module consists of a main regulator (MR) and a low power regulator (LPR). Two embedded linear regulators power all digital circuits. The regulator is always enabled after reset. 32 / 674 Nations Technologies Inc. Tel:+86-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: Power Supply Supervisor

    Power-on reset (POR) and brown-out reset (BOR) circuits are integrated inside the chip. BOR is active in all power 33 / 674 Nations Technologies Inc. Tel:+86-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: Figure 3-2 Brown-Out Reset (Bor) Waveform

    PVD can also be configured to monitor the external analog voltage PVD_IN (PB7) (compared to the internal VREFINT (about 1.2V)). 34 / 674 Nations Technologies Inc. Tel:+86-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 Modes

    STOP2 System reset and all EXTI 2)PWR_CTRL1.LPMSEL = user chooses to keep do “000/010” not need to be 35 / 674 Nations Technologies Inc. Tel:+86-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: Table 3-2 Blocks Running State

    Table 3-2 Blocks running state Stop2 Standby Main Blocks FLASH SRAM1 SRAM2 CSS for HSE CSS for LSE Tamper IWDG EXTI 36 / 674 Nations Technologies Inc. Tel:+86-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: Run Mode

    FLASH into sleep mode to reduce power consumption, and the FLASH_AC.SLMEN bit can also restore the current state of the FLASH. 37 / 674 Nations Technologies Inc. Tel:+86-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: Sleep Mode

    SLEEP-NOW: If SCB_SCR.SLEEPONEXIT = 0, then WFI or WFE instruction is executed immediately, and the system enters sleep mode immediately. 38 / 674 Nations Technologies Inc. Tel:+86-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: Exit Sleep Mode

    CPU access to SRAM and prevent SRAM timing problems. Additional steps can be taken to further reduce power consumption: 39 / 674 Nations Technologies Inc. Tel:+86-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: Low Power Sleep Mode

    SRAM1/2 can be configured to be retained in STOP2 mode via PWR_CTRL3.RAM1RET and 40 / 674 Nations Technologies Inc. Tel:+86-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: Standby Mode

    If the access to the APB area is in progress, the time to enter the STANDBY mode will be delayed until the APB 41 / 674 Nations Technologies Inc. Tel:+86-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: Exit Standby Mode

    To wake up from STANDBY mode using RTC alarm event, EXTI 18 does not need to be configured. PWR_CTRL3.IWKUPLEN needs to be configured. 42 / 674 Nations Technologies Inc. Tel:+86-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

    Reset value: 0x0000 0700 (reset by wakeup from STANDBY mode) Bit field Name Description 31:15 Reserved Reserved, the reset value must be maintained. 43 / 674 Nations Technologies Inc. Tel:+86-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: Power Control Register 2 (Pwr_Ctrl2)

    PVD filter enable bit. 0: Disable PVD filtering 1: Enable PVD filtering PLS[2:0] PVD threshold. PLS[2:0] Voltage 2.1v 2.25v 44 / 674 Nations Technologies Inc. Tel:+86-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 Register 3 (Pwr_Ctrl3)

    1: Duty on mode PBDTLPR PVDBOR state bit in LP RUN mode. 0: Normal mode 1: Duty on mode 45 / 674 Nations Technologies Inc. Tel:+86-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 Reserved, the reset value must be maintained. WKUP2EN Enable WKUP2 pin. Software can set and clear this bit. 46 / 674 Nations Technologies Inc. Tel:+86-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 Status Register 1 (Pwr_Sts1)

    Reserved, the reset value must be maintained. WKUPF2 WKUP2 pin wakeup flag. This bit is set by hardware. Can be cleared by software setting 47 / 674 Nations Technologies Inc. Tel:+86-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: Power Status Register 1 (Pwr_Sts1)

    This bit must be polled before increasing the frequency. 0: MCU is in LOW POWER RUN mode 1: MCU is in RUN mode 48 / 674 Nations Technologies Inc. Tel:+86-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: Power Status Clear Register (Pwr_Stsclr)

    Clear WKUP0 wakeup flag. This bit always reads as 0. 0: No effect. 1: Clear wakeup flag PWR_STS1.WKUPF0. 49 / 674 Nations Technologies Inc. Tel:+86-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: Reset And Clock Control (Rcc)

    The reset source can be identified by checking the reset flags in the Control/Status Register (RCC_CTRLSTS) and Low Power Domain Control Register(RCC_LDCTRL). 50 / 674 Nations Technologies Inc. Tel:+86-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: Software Reset

    VDD power up/down will cause a low power domain reset. Clock control unit Four different clock sources can be used to drive the system clock (SYSCLK): 51 / 674 Nations Technologies Inc. Tel:+86-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 FCLK is the free-running clock of Cortex™-M4F. For more details, refer to the ARM Cortex™-M4 technical reference manual. 52 / 674 Nations Technologies Inc. Tel:+86-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: Clock Tree Diagram

    When PLL is selected as system clock source, PLL minimum clock output is 32MHz. HSE clock The high-speed external clock signal (HSE) can be generated from the following two clock sources: 53 / 674 Nations Technologies Inc. Tel:+86-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: External Crystal/Ceramic Resonator (Hse Crystal)

    1 or 2). The HSI RC oscillator can provide a clock source without any external devices. It also has a shorter startup 54 / 674 Nations Technologies Inc. Tel:+86-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: Msi Clock

    After selecting HSI or HSE (both can be divided by 1 or 2) as the clock source, you can continue to select the frequency divided by 1 or 2 as the final PLL input clock, see Figure 4-4 55 / 674 Nations Technologies Inc. Tel:+86-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: Lse Clock

    The RCC_CTRLSTS.LSIRD bit flag indicates if the LSI clock is stable. At startup, the clock is not released until this 56 / 674 Nations Technologies Inc. Tel:+86-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: System Clock (Sysclk) Selection

    If the HSE oscillator is directly or indirectly used as the system clock (indirectly means: it is used as the PLL input 57 / 674 Nations Technologies Inc. Tel:+86-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: Lse Clock Security System (Lsecss)

    The corresponding GPIO port register must be configured for the corresponding function.The following 7 clock signals can be selected as the MCO clock:  SYSCLK 58 / 674 Nations Technologies Inc. Tel:+86-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: Rcc Registers

    Reserved Reset Value RCC_APB2PRST 00Ch Reserved Reserved Reset Value RCC_APB1PRST 010h Reset Value RCC_AHBPCLKEN 014h Reserved Reset Value 59 / 674 Nations Technologies Inc. Tel:+86-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 Control Register (Rcc_Ctrl)

    RCC_PLLHSIPRE 040h Reserved Reset Value SRAM_PARITY _CTRLSTS 044h Reserved Reset Value Clock Control Register (RCC_CTRL) Address offset: 0x00 60 / 674 Nations Technologies Inc. Tel:+86-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 This bit cannot be cleared when HSE is used directly or indirectly as the system clock. 0: Disable HSE oscillator 1: Enable HSE oscillator 15:7 HSICAL[8:0] Internal high-speed clock calibration value 61 / 674 Nations Technologies Inc. Tel:+86-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: Clock Configuration Register (Rcc_Cfg)

    0110: MCO clock divided by 7, duty cycle 1/(frequency division factor * 2) 0111: MCO clock divided by 8, duty cycle 1/(frequency division factor * 2) 62 / 674 Nations Technologies Inc. Tel:+86-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 00010: PLL input clock × 4 00011: PLL input clock × 5 00100: PLL input clock × 6 63 / 674 Nations Technologies Inc. Tel:+86-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 configure the division factor of APB2 clock (PCLK2). Make sure that PCLK2 does not exceed 54MHz. 64 / 674 Nations Technologies Inc. Tel:+86-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 01: Select HSI as system clock 10: Select HSE as system clock 11: Select PLL output as system clock 65 / 674 Nations Technologies Inc. Tel:+86-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: Clock Interrupt Register (Rcc_Clkint)

    1: Clear the PLLRDIF flag HSERDICLR HSE ready interrupt clear Set by the software to clear the HSERDIF flag. 66 / 674 Nations Technologies Inc. Tel:+86-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 1: Enable HSI ready interrupt LSERDIEN LSE ready interrupt enable Set and cleared by software to enable and disable LSE ready interrupt. 67 / 674 Nations Technologies Inc. Tel:+86-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 This bit is cleared by the software by setting the LSERDICLR bit. 0: No clock ready interrupt caused by LSE oscillator 1: Clock ready interrupt caused by LSE oscillator 68 / 674 Nations Technologies Inc. Tel:+86-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: Apb2 Peripheral Reset Register (Rcc_Apb2Prst)

    1: Reset USART1 TIM8RST TIM8 timer reset Set and cleared by software. 0: Clear the reset 1: Reset TIM8 timer 69 / 674 Nations Technologies Inc. Tel:+86-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: Apb1 Peripheral Reset Register (Rcc_Apb1Prst)

    UCDRRST USBRST I2C2RST I2C1RST Reserved Reserved WWDG Reserved Reserved TIM9RST Reserved COMPRST TIM7RST TIM6RST TIM5RST TIM4RST TIM3RST TIM2RST 70 / 674 Nations Technologies Inc. Tel:+86-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 Set or cleared by software. 0: clear the reset 1: Reset USART3 USART2RST USART2 reset Set and cleared by software. 71 / 674 Nations Technologies Inc. Tel:+86-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 1: Reset TIM3 timer TIM2RST TIM2 timer reset Set and cleared by software. 0: Clear the reset 1: Reset TIM2 timer 72 / 674 Nations Technologies Inc. Tel:+86-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: Ahb Peripheral Clock Enable Register (Rcc_Ahbpclken)

    Set and cleared by software to disable/enable SRAM interface clock during Sleep mode. 0: SRAM interface clock disabled during Sleep mode. 1: SRAM interface clock enabled during Sleep mode 73 / 674 Nations Technologies Inc. Tel:+86-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: Apb2 Peripheral Clock Enable Register (Rcc_Apb2Pclken)

    TIM8 Timer clock enable Set and cleared by software. 0: TIM8 timer clock disabled 1: TIM8 timer clock enabled 74 / 674 Nations Technologies Inc. Tel:+86-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: Apb1 Peripheral Clock Enable Register (Rcc_Apb1Pclken)

    I2C2EN I2C1EN Reserved Reserved WWDG COMP Reserved Reserved TIM9EN Reserved COMPEN TIM7EN TIM6EN TIM5EN TIM4EN TIM3EN TIM2EN FILTEN 75 / 674 Nations Technologies Inc. Tel:+86-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 Set and cleared by software. 0: USART2 clock disabled 1: USART2 clock enabled 16:12 Reserved Reserved, the reset value must be maintained. 76 / 674 Nations Technologies Inc. Tel:+86-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 0: TIM3 clock disabled 1: TIM3 clock enabled TIM2EN TIM2 timer clock enable Set and cleared by software. 77 / 674 Nations Technologies Inc. Tel:+86-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: Low Power Domain Control Register (Rcc_Ldctrl)

    These bits can be reset by setting the LDSFTRST bit. 78 / 674 Nations Technologies Inc. Tel:+86-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: Clock Control/Status Register (Rcc_Ctrlsts)

    PWR_CTRL1.DRBP bit is set. These bits can only be cleared by a low-power domain reset. Any internal or external reset will not affect these bits. Clock Control/Status Register (RCC_CTRLSTS) Address offset: 0x24 Reset value: 0x0C00246C 79 / 674 Nations Technologies Inc. Tel:+86-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 Cleared by software by writing to the RMRSTF bit. 0: No MMU reset occurred 1: MMU reset occurred 80 / 674 Nations Technologies Inc. Tel:+86-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 0: Internal 40KHz RC oscillator clock not ready 1: Internal 40KHz RC oscillator clock ready 81 / 674 Nations Technologies Inc. Tel:+86-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: Ahb Peripheral Reset Register (Rcc_Ahbprst)

    Reserved, the reset value must be maintained. Clock Configuration Register 2 (RCC_CFG2) Address offset: 0x2c Reset value: 0x0000 7000 82 / 674 Nations Technologies Inc. Tel:+86-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 Set and cleared by software to configure the division factor from the PLL clock to the ADC. 0xxxx: ADC PLL clock is disabled 83 / 674 Nations Technologies Inc. Tel:+86-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: Clock Configuration Register 3 (Rcc_Cfg3)

    Reserved, the reset value must be maintained. TRNG1MEN TRNG analog interface clock enable. Set or cleared by software. 84 / 674 Nations Technologies Inc. Tel:+86-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: Retention Domain Control Register (Rcc_Rdctrl)

    Reserved, the reset value must be maintained. Retention Domain Control Register (RCC_RDCTRL) Address offset: 0x34 Reset value: 0x0000 0000 85 / 674 Nations Technologies Inc. Tel:+86-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 10: Select HSI (16MHz) as input clock 11: Select LSE as input clock LPTIMSEL LPTIM clock source selection. 86 / 674 Nations Technologies Inc. Tel:+86-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: Pll And Hsi Configuration Register (Rcc_Pllhsipre)

    0: HSI clock not divided 1: HSI clock divided by 2 SRAM Control/Status Register (RCC_SRAM_CTRLSTS) Address offset: 0x44 Reset value: 0x0000 0000 87 / 674 Nations Technologies Inc. Tel:+86-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 0: Trigger an interrupt when a parity error is detected 1: Not trigger an interrupt when a parity error is detected 88 / 674 Nations Technologies Inc. Tel:+86-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: Gpio And Afio

    8-bit byte access is not allowed). The figure below shows the basic structure of an I/O port. 89 / 674 Nations Technologies Inc. Tel:+86-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: I/O Function Description

    Reserved Alternate function push-pull Alternate function push-pull pull-up Alternate function push-pull pull-down Reserved Alternate function open-drain 90 / 674 Nations Technologies Inc. Tel:+86-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-2 Input And Output Characteristics Of Different Configurations

    Input data register (I/O status) Readable Readable Reads out 0 Readable Output data register(Output value) Invalid Readable and writable Invalid Readable 91 / 674 Nations Technologies Inc. Tel:+86-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: Figure 5-2 Input Floating/Pull-Up/Pull-Down Configuration

    ◆ Push-pull mode: '0' on the output data register activates N-MOS, and the pin outputs low level. '1' on the output data register activates P-MOS, and the pin outputs high level. 92 / 674 Nations Technologies Inc. Tel:+86-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: Figure 5-3 Output Mode Configuration

    The data appearing on the I/O pin is sampled into the input data register  Read access to input data register for I/O status 93 / 674 Nations Technologies Inc. Tel:+86-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: Analog Mode

    Pull-up and pull-down resistors are disabled  When reading the input data register, the value is '0'  Output buffer is disabled 94 / 674 Nations Technologies Inc. Tel:+86-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: Status After Reset

     PC13~15 are three IOs in the LPR domain, and the default is analog mode when powered on for the first time Note 1:Start Debug mode,PB3 outputs high level by default. 95 / 674 Nations Technologies Inc. Tel:+86-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: Individual Bit Setting And Bit Clearing

    The crystal oscillator is configured as user external clock mode, the pin remains as clock input, and OSC_OUT or OSC32_OUT can still be used as normal GPIO. 96 / 674 Nations Technologies Inc. Tel:+86-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: Jtag/Swd Alternate Function Remapping

    Table 5-4 ADC external trigger injection conversion alternate function remapping Alternate function ADC_ETRI = 0 ADC_ETRI = 1 97 / 674 Nations Technologies Inc. Tel:+86-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-5 Adc External Trigger Regular Conversion Alternate Function Remapping

    Table 5-7 TIM2 alternate function remapping Alternate function Remap TIM2_ETR PA15 TIM2_CH1 PA15 TIM2_CH2 TIM2_CH3 PB10 TIM2_CH4 PB11 98 / 674 Nations Technologies Inc. Tel:+86-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-8 Tim3 Alternate Function Remapping

    5.2.5.6.6 TIM8 alternate function remapping Table 5-11 TIM8 alternate function remapping Alternate function Remap TIM8_ETR TIM8_CH1 TIM8_CH2 TIM8_CH3 TIM8_CH4 TIM8_BKIN 99 / 674 Nations Technologies Inc. Tel:+86-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: Table 5-12 Tim9 Alternate Function Remapping

    CAN signals can be mapped to port A and port B as shown in the table below. Table 5-14 CAN alternate function remapping Alternate function Remap PA11 CAN_RX PA12 CAN_TX 100 / 674 Nations Technologies Inc. Tel:+86-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-15 Usart1 Alternate Function Remapping

    Table 5-17 USART3 alternate function remapping Alternate function Remap USART3_CTS PB13 USART3_RTS PB14 PB10 USART3_TX PC10 USART3_RX PB11 101 / 674 Nations Technologies Inc. Tel:+86-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: Table 5-18 Uart4 Alternate Function Remapping

    LPUART alternate function remapping Table 5-20 LPUART alternate function remapping Alternate function Remap LPUART_CTS PB13 PB12 LPUART_RTS PB14 LPUART_TX 102 / 674 Nations Technologies Inc. Tel:+86-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: Table 5-21 I2C1 Alternate Function Remapping

    5.2.5.12.1 I2C1 alternate function remapping Table 5-21 I2C1 alternate function remapping Alternate function Remap PA15 I2C1_SCL PD13 PA14 I2C1_SDA PD12 I2C1_SMBA 103 / 674 Nations Technologies Inc. Tel:+86-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: Table 5-22 I2C2 Alternate Function Remapping

    5.2.5.13.1 SPI1 alternate function remapping Table 5-23 SPI1 alternate function remapping Alternate function Remap SPI1_I2S1_NSS_WS PA10 SPI1_I2S1_SCK_CK SPI1_I2S1_MISO_MCK SPI1_I2S1_MOSI_SD 104 / 674 Nations Technologies Inc. Tel:+86-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: Table 5-24 Spi2/I2S2 Alternate Function Remapping

    COMP1_OUT 5.2.5.14.2 COMP2 alternate function remapping Table 5-26 COMP2 alternate function remapping Alternate function Remap COMP2_OUT PA12 PA14 105 / 674 Nations Technologies Inc. Tel:+86-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: Table 5-27 Eventout Alternate Function Remapping

    AF10 SEG5~SEG6 PB0~PB1 AF10 SEG7~SEG9 PB3~PB5 AF10 SEG10~SEG15 PB10~PB15 AF10 SEG16 AF10 SEG17 PA15 AF10 SEG18~SEG27 PC0~PC9 AF10 106 / 674 Nations Technologies Inc. Tel:+86-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: I/O Configuration Of Peripherals

    SEG42 PC12 SEG43 I/O configuration of peripherals Table 5-31 ADC/DAC ADC/DAC pin GPIO configuration Analog mode Analog mode 107 / 674 Nations Technologies Inc. Tel:+86-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: Table 5-32 Tim1/Tim8

    Input floating or input pull-up UARTx_RX Half duplex synchronous mode Unused, can be used as general I/O. 108 / 674 Nations Technologies Inc. Tel:+86-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: Table 5-38 Lpuart

    Push-pull alternate output + pull-up Table 5-43 Other Alternate function GPIO configuration EVENT_OUT EVENT OUT Push-pull alternate output 109 / 674 Nations Technologies Inc. Tel:+86-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 Locking Mechanism

    GPIO register overview GPIOA base address: 0x40010800 GPIOB base address: 0x40010C00 GPIOC base address: 0x40011000 GPIOD base address: 0x40011400 110 / 674 Nations Technologies Inc. Tel:+86-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: Table 5-44 Gpio Register Overview

    AFSEL14[3:0] AFSEL13[3:0] AFSEL12[3:0] AFSEL11[3:0] AFSEL10[3:0] AFSEL9[3:0] AFSEL8[3:0] 024h Reset Value x= B,C,D 1 GPIOx_PBC 028h Reserved Reset Value 111 / 674 Nations Technologies Inc. Tel:+86-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 Mode Description Register (Gpiox_Pmode)

    11: Analog function mode (state after reset) 21:20 19:18 17:16 15:14 13:12 11:10 GPIO type definition (GPIOx_POTYPE) Address: 0x04 Reset value: 0x0000 0000(x= A,B,C,D) 112 / 674 Nations Technologies Inc. Tel:+86-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 Slew Rate Configuration Register (Gpiox_Sr)

    1:Slow slew rate GPIO pull-up/pull-down description register (GPIOx_PUPD) Address: 0x0C Reset value: 0x6400 0000(x=A) ;0x0000 0100(x=B) ;0x0000 0000(x=C) ;0x0000 0002(x=D) 113 / 674 Nations Technologies Inc. Tel:+86-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 Input Data Register (Gpiox_Pid)

    I/O port. GPIO output data register (GPIOx_POD) Address: 0x14 Reset value: 0x0000 0000(x=A,B,C,D) 114 / 674 Nations Technologies Inc. Tel:+86-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 Bit Set/Clear Register (Gpiox_Pbsc)

    1: Set the corresponding PODy bit to 1 GPIO configuration lock register (GPIOx_PLOCK) Address: 0x1C Reset value: 0x0000 0000(x=A,B,C,D) 115 / 674 Nations Technologies Inc. Tel:+86-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)

    Alternate function configuration bits y for port GPIOx (y = 0…7) 31:28 AFSELy[3:0] 27:24 0000:AF0 23:20 0001:AF1 19:16 0010:AF2 15:12 0011:AF3 116 / 674 Nations Technologies Inc. Tel:+86-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 Alternate Function High Register (Gpiox_Afh)

    15:12 0011:AF3 11:8 0100:AF4 0101:AF5 0110:AF6 0111:AF7 1000:AF8 1001:AF9 1010:AF10 1011:AF11 1100:AF12 1101:AF13 1110:AF14 1111:AF15 (No alternate function) 117 / 674 Nations Technologies Inc. Tel:+86-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: Gpio Bit Clear Register (Gpiox_Pbc)

    Port GPIOx drive capability configuration bits y (y = 0…15) 31:30 DSy[1:0] 29:28 00:2mA 27:26 01:8mA 25:24 10:4mA 23:22 11:12mA 21:20 19:18 17:16 15:14 13:12 11:10 118 / 674 Nations Technologies Inc. Tel:+86-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 Register

    Reset Value AFIO_EXTI_CFG4 010h Reserved Reset Value AFIO mapping configuration control register (AFIO_RMP_CFG) Address: 0x00 Reset value: 0x0000 0000 119 / 674 Nations Technologies Inc. Tel:+86-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: Afio External Interrupt Configuration Register 1(Afio_Exti_Cfg1)

    Bit field Name Description 31:14 Reserved Reserved, the reset value must be maintained. 13:12 EXTI3[1:0] 00:PA3 pin 01:PB3 pin 120 / 674 Nations Technologies Inc. Tel:+86-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: Afio External Interrupt Configuration Register 2(Afio_Exti_Cfg2)

    Reserved, the reset value must be maintained. EXTI6[1:0] 00:PA6 pin 01:PB6 pin 10:PC6 pin 11:PD6 pin Reserved Reserved, the reset value must be maintained. 121 / 674 Nations Technologies Inc. Tel:+86-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: Afio External Interrupt Configuration Register 3(Afio_Exti_Cfg3)

    10:PC9 pin 11:PD9 pin Reserved Reserved, the reset value must be maintained EXTI8[1:0] 00:PA8 pin 01:PB8 pin 10:PC8 pin 122 / 674 Nations Technologies Inc. Tel:+86-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: Afio External Interrupt Configuration Register 4(Afio_Exti_Cfg4)

    11:PD13 pin Reserved Reserved, the reset value must be maintained. EXTI12[1:0] 00:PA12 pin 01:PB12 pin 10:PC12 pin 11:PD12 pin 123 / 674 Nations Technologies Inc. Tel:+86-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: Interrupts And Events

    0x0000_0018 0x0000_001C Reserved ~0x0000_002B System services invoked by SWI Settable SVCall 0x0000_002C directives Settable DebugMonitor Debug monitor 0x0000_0030 124 / 674 Nations Technologies Inc. Tel:+86-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 Settable TIM2 TIM2 global interrupt 0x0000_00B0 Settable TIM3 TIM3 global interrupt 0x0000_00B4 Settable TIM4 TIM4 global interrupt 0x0000_00B8 125 / 674 Nations Technologies Inc. Tel:+86-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 SAC global interrupt 0x0000_013C Settable MMU golbal interrupt 0x0000_0140 Settable Reserved Reserved 0x0000_0144 Settable RAMC_PERR RAM verification error interrupt 0x0000_0148 126 / 674 Nations Technologies Inc. Tel:+86-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/Event Controller (Exti)

    3 trigger events are supported: rising edge, falling edge, and double edge.  Can wake up to exit low power mode. 127 / 674 Nations Technologies Inc. Tel:+86-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: Functional Description

    In addition, interrupt/event requests can also be generated by software by writing a '1' in the software interrupt/event register. 128 / 674 Nations Technologies Inc. Tel:+86-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: Exti Line Maping

    EXTI line 16 is connected to the PVD output  EXTI line 17 is connected to the USB wake up event 129 / 674 Nations Technologies Inc. Tel:+86-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: Exti Registers

    EXTI line 25 is Reserved  EXTI line 26 is connected to the LCD global interrupt EXTI registers EXTI base address: 0x40010400 130 / 674 Nations Technologies Inc. Tel:+86-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: Exti Register Overview

    Bit Field Name Description 31:27 Reserved Reserved,the reset value must be maintained. IMASK26 Interrupt mask on line 26 131 / 674 Nations Technologies Inc. Tel:+86-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: Exti Event Mask Register (Exti_Emask)

    The rising edge on line 26 triggers the configuration bit 0: Disable rising edge triggering (interrupts and events) on input line 26. 132 / 674 Nations Technologies Inc. Tel:+86-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: Exti Falling Edge Trigger Configuration Register (Exti_Ft_Cfg)

    When the bit is' 0 ', writing '1' sets the corresponding pending bit in EXTI_PEND. If this interrupt is allowed in EXTI_IMASK and EXTI_EMASK, an interrupt will be 133 / 674 Nations Technologies Inc. Tel:+86-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: Exti Pending Register (Exti_Pend)

    It can be cleared by writing '1' to the bit, or by changing the polarity of the edge detection. EXTI timestamp trigger source selection register (EXTI_TS_SEL) Address offset: 0x18 Reset value: 0x0000 0000 134 / 674 Nations Technologies Inc. Tel:+86-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 0001: Select EXTI1 as the trigger source of the timestamp event. 1111: Select EXTI15 as the trigger source for the timestamp event. 135 / 674 Nations Technologies Inc. Tel:+86-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: Dma Controller

     Access totally 5 AHB slaves: Flash, SRAM, ADC, APB1 and APB2.  Configurable data transmit number (0~65535). 136 / 674 Nations Technologies Inc. Tel:+86-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: Block Diagram

    After one operation, the controller calculates the number of remaining transfers and updates the source address and the destination address 137 / 674 Nations Technologies Inc. Tel:+86-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: Channel Priority And Arbitration

    When DMA_CHCFGx.PSIZE and DMA_CHCFGx.MSIZE are different, the DMA module aligns the data according to the Table 7-1 below. 138 / 674 Nations Technologies Inc. Tel:+86-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: Table 7-1 Programmable Data Width And Endian Operation (When Pinc = Minc = 1)

    0x8 / BBBAB9B8 0xC / BFBEBDBC 4: R BFBEBDBC [31:0] @0xC, W BFBEBDBC [31:0] @0xC 0xC / BFBEBDBC Notice: 139 / 674 Nations Technologies Inc. Tel:+86-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: Peripheral/Memory Address Incrementation

    Configure channel peripheral address and memory address and transfer direction. Configure channel priority, 0: lowest, 3: highest. Configure peripheral and memory address increment. 140 / 674 Nations Technologies Inc. Tel:+86-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: Flow Control

    Peripheral AHB read to AHB write, single transfer Peripheral Memory APB read to AHB write, single transfer Peripheral 141 / 674 Nations Technologies Inc. Tel:+86-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: Circular Mode

    Totally there are 63 DMA requests from all the peripherals. To have better support with full flexibility, register bits 142 / 674 Nations Technologies Inc. Tel:+86-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: Table 7-4 Dma Request Mapping

    Sel = 31 TIM2_CH3 Sel = 32 TIM2_CH4 Sel = 33 TIM2_UP Sel = 34 TIM3_CH1 Sel = 35 TIM3_CH3 143 / 674 Nations Technologies Inc. Tel:+86-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: Dma Registers

    Table 7-5 DMA register overview Offset Register DMA_INTSTS 000h Reset Value DMA_INTCLR 004h Reset Value 008h DMA_CHCFG1 Reserved 144 / 674 Nations Technologies Inc. Tel:+86-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 ADDR[31:0] 074h Reset Value DMA_MADDR6 ADDR[31:0] 078h Reset Value DMA_CHSEL6 CH_SEL[5:0] 07Ch Reserved Reset Value 080h DMA_CHCFG7 Reserved 145 / 674 Nations Technologies Inc. Tel:+86-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: Dma Interrupt Status Register (Dma_Intsts)

    Global flag for channel x (x=1…8). 28/24/20/16/12/8/4/0 GLBFx Hardware sets this bit when any interrupt events happen in this channel. This bit is 146 / 674 Nations Technologies Inc. Tel:+86-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: Dma Interrupt Flag Clear Register (Dma_Intclr)

    DMA channel x configuration register (DMA_CHCFGx) Note:The x is channel number, x = 1…8 Address offset: 0x08+20 * (x–1) Reset value: 0x0000 0000 147 / 674 Nations Technologies Inc. Tel:+86-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 1: Peripheral address increase with each transfer. CIRC Circular mode. Software can set/clear this bit. 0: Channel will stop after one round of transfer. 148 / 674 Nations Technologies Inc. Tel:+86-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: Dma Channel X Transfer Number Register (Dma_Txnumx)

    DMA channel will decrease this register by 1. If circular mode is enable, it will automatically reload pre-set value when it reach zero. 149 / 674 Nations Technologies Inc. Tel:+86-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: Dma Channel X Peripheral Address Register (Dma_Paddrx)

    Increment of address will be decided by DMA_CHCFGx.MSIZE. With DMA_CHCFGx.MSIZE equal to 01, DMA ignores bit 0 of MADDR and if 150 / 674 Nations Technologies Inc. Tel:+86-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: Dma Channel X Channel Request Select Register (Dma_Chselx)

    0x06:USART3_RX 0x07:UART4_TX 0x08:UART4_RX 0x09:UART5_TX 0x0A:UART5_RX 0x0B:LPUART_TX 0x0C:LPUART_RX 0x0D:SPI1_TX 0x0E:SPI1_RX 0x0F:SPI2_TX 0x10:SPI2_RX 0x11:I2C1_TX 0x12:I2C1_RX 0x13:I2C2_TX 0x14:I2C2_RX 0x15:DAC 0x16:TIM1_CH1 0x17:TIM1_CH2 151 / 674 Nations Technologies Inc. Tel:+86-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 0x2D:TIM5_CH3 0x2E:TIM5_CH4 0x2F:TIM5_UP 0x30:TIM5_TRIG 0x31:TIM6 0x32:TIM7 0x33:TIM8_CH1 0x34:TIM8_CH2 0x35:TIM8_CH3 0x36:TIM8_CH4 0x37:TIM8_COM 0x38:TIM8_UP 0x39:TIM8_TRIG 0x3A:TIM9_CH1 0x3B:TIM9_TRIG 0x3C:TIM9_CH3 0x3D:TIM9_CH4 0x3E:TIM9_UP 152 / 674 Nations Technologies Inc. Tel:+86-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: 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. 153 / 674 Nations Technologies Inc. Tel:+86-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: Crc Function Description

    If the initial value needs to be set, the LRC register should be configured first. 154 / 674 Nations Technologies Inc. Tel:+86-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: 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 155 / 674 Nations Technologies Inc. Tel:+86-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: Crc32 Control Register (Crc_Crc32Ctrl)

    It can reset CRC32 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 156 / 674 Nations Technologies Inc. Tel:+86-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: 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. 157 / 674 Nations Technologies Inc. Tel:+86-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: Lrc Result Register (Crc_Lrc)

    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. 158 / 674 Nations Technologies Inc. Tel:+86-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: Cryptographic Algorithm Hardware Acceleration Engine (Sac)

    Support MD5 digest algorithm  Support symmetric national cryptographic SM1, SM4, SM7 algorithm and SM3 hash algorithm Note: For the performance and use of the cryptographic algorithm, please contact Nations Technologies sales staff 159 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com...
  • Page 184: 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; 160 / 674 Nations Technologies Inc. Tel:+86-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: 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 161 / 674 Nations Technologies Inc. Tel:+86-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: Prescaler Description

    Depending on the update request source is configured in the TIMx_CTRL1.UPRS, When an update event occurs, the TIMx_STS.UDITF is set, all registers are updated:  The repetition counter reloads the contents of the TIMx_REPCNT 162 / 674 Nations Technologies Inc. Tel:+86-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: 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) 163 / 674 Nations Technologies Inc. Tel:+86-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 Counter overflow Update event(UEV) Update interrupt flag(UDITF) Auto-reload preload register Write a new value in TIMx_AR Auto-reload shadow register 164 / 674 Nations Technologies Inc. Tel:+86-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: Down-Counting Mode

    In this mode, the TIMx_CTRL1.DIR direction bits have no effect and the count direction is updated and specified by hardware. Center-aligned mode is valid when the TIMx_CTRL1. CAMSEL bit is not equal to "00". 165 / 674 Nations Technologies Inc. Tel:+86-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: 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) 166 / 674 Nations Technologies Inc. Tel:+86-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: Figure 10-7 A Center-Aligned Sequence Diagram That Includes Counter Overflows And Underflows (Arpen = 1)

    (UEV) is actually only generated when the repeat counter reaches zero, which is valuable for generating PWM signals. 167 / 674 Nations Technologies Inc. Tel:+86-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: Figure 10-8 Repeat Count Sequence Diagram In Down-Counting Mode

    36 35 register Underflow Overflow TIMx_REPCNT = 0x0 UDITF TIMx_REPCNT = 0x1 UDITF TIMx_REPCNT = 0x2 UDITF Software clear 168 / 674 Nations Technologies Inc. Tel:+86-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: Figure 10-9 Repeat Count Sequence Diagram In Up-Counting Mode

    35 34 register Underflow Overflow TIMx_REPCNT = 0x0 UDITF TIMx_REPCNT = 0x1 UDITF TIMx_REPCNT = 0x2 UDITF Software clear 169 / 674 Nations Technologies Inc. Tel:+86-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: Clock Selection

    Counter clock = CK_CNT=CK_PSC Counter register 63 64 65 66 00 01 02 03 04 05 06 07 170 / 674 Nations Technologies Inc. Tel:+86-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: Figure 10-12 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. 171 / 674 Nations Technologies Inc. Tel:+86-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: Figure 10-13 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 172 / 674 Nations Technologies Inc. Tel:+86-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: Capture/Compare Channels

    ICx is sent to the capture register after frequency division. The following figure shows a block diagram of a capture/compare channel. 173 / 674 Nations Technologies Inc. Tel:+86-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: Figure 10-16 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. 174 / 674 Nations Technologies Inc. Tel:+86-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: Figure 10-17 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 175 / 674 Nations Technologies Inc. Tel:+86-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: 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 176 / 674 Nations Technologies Inc. Tel:+86-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: 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. 177 / 674 Nations Technologies Inc. Tel:+86-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: Forced Output Mode

    OCxREF. And the flag still can be set. Therefore, the interrupt and DMA requests still can be sent. 178 / 674 Nations Technologies Inc. Tel:+86-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: Output Compare Mode

    Otherwise the TIMx_CCDATx shadow register will be updated at the next update event. Here is an example. 179 / 674 Nations Technologies Inc. Tel:+86-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: Pwm Mode

    180 / 674 Nations Technologies Inc. Tel:+86-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: Figure 10-22 Center-Aligned Pwm Waveform (Ar=8)

     If the value written into the counter is greater than the value of auto-reload, the direction will not be updated. 181 / 674 Nations Technologies Inc. Tel:+86-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: Figure 10-23 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 compare value in TIMx_CCDATx is greater than the auto-reload value, the OCxREF will remains 1. 182 / 674 Nations Technologies Inc. Tel:+86-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: One-Pulse Mode

    4. TIMx_CCDAT1 writes the count value to be delayed (t ), TIMx_AR - TIMx_CCDAT1 is the count value of DELAY 183 / 674 Nations Technologies Inc. Tel:+86-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: 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. 184 / 674 Nations Technologies Inc. Tel:+86-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: 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. 185 / 674 Nations Technologies Inc. Tel:+86-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: Figure 10-25 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 186 / 674 Nations Technologies Inc. Tel:+86-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: Break Function

     The dead-time generator will reactivated if the timer clock is still provided, and drive the outputs according to the value of TIMx_CTRL2.OIx and TIMx_CTRL2.OIxN after the dead-time when (CCxP ^ OIx) ^ 187 / 674 Nations Technologies Inc. Tel:+86-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 TIMx_BKDT.LCKCFG. However, the TIMx_BKDT.LCKCFG can only be written once after an MCU reset. An example for output behavior in response to a break is as follow 188 / 674 Nations Technologies Inc. Tel:+86-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: Figure 10-26 Output Behavior In Response To A Break

    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. Start counter (TIMx_CTRL1.CNTEN = 1) 189 / 674 Nations Technologies Inc. Tel:+86-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: Slave Mode: Trigger 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. 190 / 674 Nations Technologies Inc. Tel:+86-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: Slave Mode: Gated 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. 191 / 674 Nations Technologies Inc. Tel:+86-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: Figure 10-29 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); 192 / 674 Nations Technologies Inc. Tel:+86-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: Timer Synchronization

    The following figure shows the output timing diagram of OCx and OCxN when a COM commutation event occurs in three different configurations: 193 / 674 Nations Technologies Inc. Tel:+86-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: Encoder Interface Mode

    The relationship between the counting direction and the encoder signal is shown in Table 10-1 Counting direction versus encoder signals: 194 / 674 Nations Technologies Inc. Tel:+86-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: Table 10-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) 195 / 674 Nations Technologies Inc. Tel:+86-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: 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. 196 / 674 Nations Technologies Inc. Tel:+86-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: Advanced-Control

    Interfacing timer Counter(CNT) (CCDAT2) CCDAT1 TRGO=OC2REF Advanced-control timers(TIM1&TIM8) OC1N OC2N OC3N Write CCxEN、CCxNEN and OCxMD for next step 197 / 674 Nations Technologies Inc. Tel:+86-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: Timx Registers(X=1, 8)

    Reset Value TIMx_CCMOD1 Reset Value 018h TIMx_CCMOD1 Reset Value TIMx_CCMOD2 01Ch Reset Value TIMx_CCMOD2 01Ch Reset Value 020h TIMx_CCEN 198 / 674 Nations Technologies Inc. Tel:+86-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: Control Register 1 (Timx_Ctrl1)

    Reset Value TIMx_CCDAT6 CCDAT6[15:0] 058h Reserved Reset Value Control register 1 (TIMx_CTRL1) Offset address: 0x00 Reset value: 0x0000 0000 199 / 674 Nations Technologies Inc. Tel:+86-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 Note: Switching from edge-aligned mode to center-aligned mode is not allowed when the counter is still enabled (TIMx_CTRL1.CNTEN = 1). Direction 0: Up-counting 1: Down-counting 200 / 674 Nations Technologies Inc. Tel:+86-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: Control Register 2 (Timx_Ctrl2)

    TIMx_CTRL1.CNTEN bit is set in the software. Trigger mode can automatically set TIMx_CTRL1.CNTEN bit by hardware. Control register 2 (TIMx_CTRL2) Offset address: 0x04 Reset value: 0x0000 0000 201 / 674 Nations Technologies Inc. Tel:+86-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 010: Update - The update event is selected as the trigger output (TRGO). For example, a master timer clock can be used as a slave timer prescaler. 202 / 674 Nations Technologies Inc. Tel:+86-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: Slave Mode Control Register (Timx_Smctrl)

    ETRF signal in this mode. 0: External clock mode 2 disable. 1: External clock mode 2 enable. 203 / 674 Nations Technologies Inc. Tel:+86-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 (via TRGO) and its slaves. This is useful when several timers are required to be synchronized to a single external event. TSEL[2:0] Trigger selection 204 / 674 Nations Technologies Inc. Tel:+86-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: Dma/Interrupt Enable Registers (Timx_Dinten)

    TIM2 TIM3 TIM4 TIM1 TIM2 TIM4 TIM5 TIM8 DMA/Interrupt enable registers (TIMx_DINTEN) Offset address: 0x0C Reset value: 0x0000 205 / 674 Nations Technologies Inc. Tel:+86-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 Capture/Compare 3 interrupt enable 0: Disable capture/compare 3 interrupt 1: Enable capture/compare 3 interrupts CC2IEN Capture/Compare 2 interrupt enable 206 / 674 Nations Technologies Inc. Tel:+86-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: Status Registers (Timx_Sts)

    1: TIMx_STS.CC1ITF was already set when the value of the counter has been captured in the TIMx_CCDAT1 register. Reserved Reserved, the reset value must be maintained BITF Break interrupt flag 207 / 674 Nations Technologies Inc. Tel:+86-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 Update interrupt flag This bit is set by hardware when an update event occurs under the following conditions: 208 / 674 Nations Technologies Inc. Tel:+86-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: Event Generation Registers (Timx_Evtgen)

    1: Generated a COM event Note: This bit is only valid for channels with complementary outputs. CC4GN Capture/Compare 4 generation 209 / 674 Nations Technologies Inc. Tel:+86-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: Capture/Compare Mode Register 1 (Timx_Ccmod1)

    Output compare mode: Bit field Name Description OC2CEN Output Compare 2 clear enable 210 / 674 Nations Technologies Inc. Tel:+86-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 1: Enable preload function of TIMx_CCDAT1 register. Only read and write operations to preload registers. When an update event occurs, the value of TIMx_CCDAT1 is loaded into 211 / 674 Nations Technologies Inc. Tel:+86-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 N events are recorded. 0000: No filter, sampling at f frequency 0001: f , N = 2 SAMPLING CK_INT 212 / 674 Nations Technologies Inc. Tel:+86-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: Capture/Compare Mode Register 2 (Timx_Ccmod2)

    Capture/compare mode register 2 (TIMx_CCMOD2) Offset address: 0x1C Reset value: 0x0000 See the description of the CCMOD1 register above Output comparison mode: 213 / 674 Nations Technologies Inc. Tel:+86-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 Note: CC4SEL is writable only when the channel is off (TIMx_CCEN.CC4EN = 0). IC3F[3:0] Input Capture 3 filter 214 / 674 Nations Technologies Inc. Tel:+86-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: Capture/Compare Enable Registers (Timx_Ccen)

    CC3NP Capture/Compare 3 Complementary output polarity See TIMx_CCEN.CC1NP description. CC3NEN Capture/Compare 3 complementary output enable See TIMx_CCEN.CC1NEN description. 215 / 674 Nations Technologies Inc. Tel:+86-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 1: Enable - Enable output OC1 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.CC1NEN. 216 / 674 Nations Technologies Inc. Tel:+86-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: Table 10-4 Output Control Bits Of Complementary Ocx And Ocxn Channels With Break Function

    Note: The status of external I/O pins connected to complementary OCx and OCxN channels depends on the OCx and OCxN channel states and GPIO and AFIO registers. 217 / 674 Nations Technologies Inc. Tel:+86-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: Counters (Timx_Cnt)

    When the TIMx_AR.AR [15:0] value is null, the counter does not work. Repeat count registers (TIMx_REPCNT) Offset address: 0x30 Reset value: 0x0000 218 / 674 Nations Technologies Inc. Tel:+86-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: Capture/Compare Register 1 (Timx_Ccdat1)

    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 219 / 674 Nations Technologies Inc. Tel:+86-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: Capture/Compare Register 3 (Timx_Ccdat3)

    When configured as output mode, register CCDAT3 and CCDDAT3 are readable and writable. Capture/compare register 4 (TIMx_CCDAT4) Offset address: 0x40 Reset value: 0x0000 Bit field Name Description 220 / 674 Nations Technologies Inc. Tel:+86-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 And Dead-Time Registers (Timx_Bkdt)

    1: Enable brake input (BRK and CCS clock failure events) Note: Any write to this bit requires an APB clock delay to take effect. 221 / 674 Nations Technologies Inc. Tel:+86-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 DTGN[7:5] = 0xx: dead time = DTGN[7:0] × (t DTGN[7:5] = 10x: dead time =(64+DTGN[5:0]) × (2 × t DTGN[7:5]=110: 222 / 674 Nations Technologies Inc. Tel:+86-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: Dma Control Register (Timx_Dctrl)

    00001: TIMx_CTRL2, 00010: TIMx_SMCTRL, … 10001:TIMx_BKDT, 10010:TIMx_DCTRL DMA transfer buffer register (TIMx_DADDR) Offset address: 0x4C Reset value: 0x0000 223 / 674 Nations Technologies Inc. Tel:+86-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: Capture/Compare Mode Registers 3(Timx_Ccmod3)

    Output compare 5 Preload enable OC5FEN Output compare 5 fast enable 1:0 Reserved Reserved, the reset value must be maintained 224 / 674 Nations Technologies Inc. Tel:+86-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: Capture/Compare Register 5 (Timx_Ccdat5)

    TIM1_CC6 is used to switch the input channel of OPAMP1 and OPAMP2; TIM8_CC6 can switch the input channel of OPAMP2 225 / 674 Nations Technologies Inc. Tel:+86-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: General-Purpose Timers (Tim2, Tim3, Tim4, Tim5 And Tim9)

     Supports capture of internal comparator output signal. TIM9 supports capture of internal HSE, LSI, and LSE signal 226 / 674 Nations Technologies Inc. Tel:+86-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: General-Purpose Timers Description

    UEV. An update event is generated 227 / 674 Nations Technologies Inc. Tel:+86-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: Counter Mode

    Depending on the update request source is configured in the TIMx_CTRL1.UPRS. When an update event occurs, 228 / 674 Nations Technologies Inc. Tel:+86-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 The figure below shows some examples of the counter behavior and the update flags for different division factors in the up-counting mode. 229 / 674 Nations Technologies Inc. Tel:+86-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 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) 230 / 674 Nations Technologies Inc. Tel:+86-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: 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 231 / 674 Nations Technologies Inc. Tel:+86-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 11-5 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 hardware. Center-aligned mode is valid when the TIMx_CTRL1. CAMSEL bit is not equal to "00". 232 / 674 Nations Technologies Inc. Tel:+86-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: Figure 11-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) 233 / 674 Nations Technologies Inc. Tel:+86-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: Clock Selection

    Auto-reload active register Clock selection  The internal clock of timers: CK_INT  Two kinds of external clock mode : 234 / 674 Nations Technologies Inc. Tel:+86-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: Figure 11-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 235 / 674 Nations Technologies Inc. Tel:+86-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: Figure 11-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. 236 / 674 Nations Technologies Inc. Tel:+86-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: Figure 11-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’ 237 / 674 Nations Technologies Inc. Tel:+86-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: Capture/Compare Channels

    ICx is sent to the capture register after frequency division. The following figure shows a block diagram of a capture/compare channel. 238 / 674 Nations Technologies Inc. Tel:+86-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: Figure 11-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. 239 / 674 Nations Technologies Inc. Tel:+86-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: Figure 11-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 240 / 674 Nations Technologies Inc. Tel:+86-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: Input Capture Mode

    Configure TIMx_CCMOD1.CC1SEL to ‘01’. At this time, the input is the CC1 channel, and IC1 is mapped to TI1.  Program the desired input filter duration: 241 / 674 Nations Technologies Inc. Tel:+86-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: Pwm Input Mode

    Configure TIMx_SMCTRL.SMSEL=100 to configure the slave mode controller to reset mode.  Configure TIMx_CCEN. CC1EN=1 and TIMx_CCEN.CC2EN=1 to enable capture. 242 / 674 Nations Technologies Inc. Tel:+86-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: Forced Output Mode

    When the capture/compare register and the counter have the same value, the output compare function’s operations are as follow:  TIMx_CCMODx.OCxMD is for output compare mode, and TIMx_CCEN.CCxP is for output polarity. When 243 / 674 Nations Technologies Inc. Tel:+86-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 Otherwise the TIMx_CCDATx shadow register will be updated at the next update event. Here is an example. 244 / 674 Nations Technologies Inc. Tel:+86-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: Pwm Mode

    User should not modified TIMx_CTRL1.DIR by software, it is updated by hardware. 245 / 674 Nations Technologies Inc. Tel:+86-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: Figure 11-18 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 246 / 674 Nations Technologies Inc. Tel:+86-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: Figure 11-19 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 compare value in TIMx_CCDATx is greater than the auto-reload value, the OCxREF will remains 1. 247 / 674 Nations Technologies Inc. Tel:+86-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: One-Pulse Mode

    4. TIMx_CCDAT1 writes the count value to be delayed (t ), TIMx_AR - TIMx_CCDAT1 is the count value of DELAY 248 / 674 Nations Technologies Inc. Tel:+86-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: 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. 249 / 674 Nations Technologies Inc. Tel:+86-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: Debug Mode

    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. 250 / 674 Nations Technologies Inc. Tel:+86-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: Figure 11-22 Block Diagram Of Timer Interconnection

    Configure TIM1_CCMOD1 register to configure the OC1REF output waveform.  Setting TIM2_SMCTRL.TSEL = ‘000’ to connect TIM1 trigger output to TIM2. 251 / 674 Nations Technologies Inc. Tel:+86-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: Figure 11-23 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. 252 / 674 Nations Technologies Inc. Tel:+86-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: Figure 11-24 Tim2 Gated By Enable Signal Of Tim1

     Setting TIM2_SMCTRL. SMSEL = ‘110’ to set TIM2 to trigger mode.  Setting TIM1_CTRL1.CNTEN=1 to start TIM1. 253 / 674 Nations Technologies Inc. Tel:+86-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: Figure 11-25 Trigger Tim2 With An Update Of Tim1

    TITF flags are set simultaneously. The following figure shows a delay between CNTEN and CK_PSC of TIM1 in master/slave mode. 254 / 674 Nations Technologies Inc. Tel:+86-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: Encoder Interface Mode

    Note: Encoder mode and external clock mode 2 are not compatible and must not be selected together. The relationship between the counting direction and the encoder signal is shown in Table 11-1: 255 / 674 Nations Technologies Inc. Tel:+86-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: Table 11-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) 256 / 674 Nations Technologies Inc. Tel:+86-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: Interfacing With Hall Sensor

    Table 11-2 TIMx register overview Offset Register TIMx_CTRL1 000h Reset Value TIMx_CTRL2 004h Reset Value TIMx_SMCTRL 008h Reset Value 257 / 674 Nations Technologies Inc. Tel:+86-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 040h Reserved Reset Value 044h Reserved TIMx_DCTRL DBLEN[4:0] DBADDR[4:0] 048h Reset Value TIMx_DADDR BURST[15:0] 04Ch Reserved Reset Value 258 / 674 Nations Technologies Inc. Tel:+86-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: Control Register 1 (Timx_Ctrl1)

    11: Reserved, do not use this configuration ARPEN ARPEN: Auto-reload preload enable 0: Shadow register disable for TIMx_AR register 259 / 674 Nations Technologies Inc. Tel:+86-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 CNTEN Counter Enable 0: Disable counter 260 / 674 Nations Technologies Inc. Tel:+86-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: Control Register 2 (Timx_Ctrl2)

    TIMx_STS.CC1ITF is to be set (even if it is already high), when a capture or a comparison succeeds. 100: Compare - OC1REF signal is used as the trigger output (TRGO). 261 / 674 Nations Technologies Inc. Tel:+86-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: Slave Mode Control Register (Timx_Smctrl)

    01: ETRP frequency divided by 2 10: ETRP frequency divided by 4 11: ETRP frequency divided by 8 262 / 674 Nations Technologies Inc. Tel:+86-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 (see input control register and control register description) 000: Disable slave mode. If TIMx_CTRL1.CNTEN = 1, the prescaler is driven directly by the internal clock. 263 / 674 Nations Technologies Inc. Tel:+86-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: Dma/Interrupt Enable Registers (Timx_Dinten)

    0: Disable trigger DMA request 1: Enable trigger DMA request Reserved Reserved, the reset value must be maintained 264 / 674 Nations Technologies Inc. Tel:+86-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: Status Registers (Timx_Sts)

    Update interrupt enable 0: Disable update interrupt 1: Enables update interrupt Status registers (TIMx_STS) Offset address: 0x10 Reset value: 0x0000 265 / 674 Nations Technologies Inc. Tel:+86-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 TIMx_STS.CC1ITF bit will go high if the counter overflows (in up-counting and up/down- counting modes) and underflows in down-counting mode. When the corresponding channel of CC1 is in input mode: 266 / 674 Nations Technologies Inc. Tel:+86-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: Event Generation Registers (Timx_Evtgen)

    Capture/Compare 1 generation This bit can generate a capture/compare event when set by software. This bit is automatically 267 / 674 Nations Technologies Inc. Tel:+86-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: Capture/Compare Mode Register 1 (Timx_Ccmod1)

    00: CC2 channel is configured as output 01: CC2 channel is configured as input, IC2 is mapped on TI2 268 / 674 Nations Technologies Inc. Tel:+86-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 0: CC1 behaves normally depending on the counter and CCDAT1 values, even if the trigger is ON. The minimum delay for activating CC1 output when an edge occurs on the trigger input 269 / 674 Nations Technologies Inc. Tel:+86-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 /4, N = 6 SAMPLING 0111: f /4, N = 8 SAMPLING 1000: f /8, N = 6 SAMPLING 270 / 674 Nations Technologies Inc. Tel:+86-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: Capture/Compare Mode Register 2 (Timx_Ccmod2)

    These bits are used to select the input/output and input mapping of the channel 00: CC4 channel is configured as output 271 / 674 Nations Technologies Inc. Tel:+86-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 11: CC3 channel is configured as input, IC3 is mapped to TRC. This mode is only active when 272 / 674 Nations Technologies Inc. Tel:+86-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: Capture/Compare Enable Registers (Timx_Ccen)

    IC1 is inverted. Note: If TIMx_BKDT.LCKCFG = 3 or 2, these bits cannot be modified. CC1EN Capture/Compare 1 output enable 273 / 674 Nations Technologies Inc. Tel:+86-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: 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 274 / 674 Nations Technologies Inc. Tel:+86-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: Capture/Compare Register 1 (Timx_Ccdat1)

    Reset value: 0x0000 Bit field Name Description 15:0 CCDAT2[15:0] Capture/Compare 2 values  CC2 channel is configured as output: 275 / 674 Nations Technologies Inc. Tel:+86-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: Capture/Compare Register 3 (Timx_Ccdat3)

    Reset value: 0x0000 Bit field Name Description 15:0 CCDAT4[15:0] Capture/Compare 4 value  CC4 channel is configured as output: 276 / 674 Nations Technologies Inc. Tel:+86-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: Dma Control Register (Timx_Dctrl)

    “DMA Base Address + 4” 00000: TIMx_CTRL1, 00001: TIMx_CTRL2, 00010: TIMx_SMCTRL, … 01011:TIMx_AR, 01100:Reserved, 01101:TIMx_CCDAT1, … 10000:TIMx_CCDAT4, 10001:Reserved, 277 / 674 Nations Technologies Inc. Tel:+86-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: Dma Transfer Buffer Register (Timx_Daddr)

    For the fourth time, DMA access to the TIMx_ DADDR register will be mapped to access TIMx_CCDAT4 register; 278 / 674 Nations Technologies Inc. Tel:+86-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: Basic Timers (Tim6 And Tim7)

    CK_CNT Controller Stop, clear or up Update event Update event auto-reload register The event Interrupt and DMA 279 / 674 Nations Technologies Inc. Tel:+86-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: Basic Timers Description

    89 8A 8B 8C Update event(UEV) Prescaler controller register Write a new value in TIMx_PSC Prescaler counter Prescaler buffer 280 / 674 Nations Technologies Inc. Tel:+86-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: Counter Mode

    The figure below shows some examples of the counter behavior and the update flags for different division factors in the up-counting mode. 281 / 674 Nations Technologies Inc. Tel:+86-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 12-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) 282 / 674 Nations Technologies Inc. Tel:+86-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 12-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 283 / 674 Nations Technologies Inc. Tel:+86-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: Clock Selection

    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). 284 / 674 Nations Technologies Inc. Tel:+86-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: Timx Register Overview

    Reset Value TIMx_AR AR[15:0] 02Ch Reserved Reset Value Control Register 1 (TIMx_CTRL1) Offset address: 0x00 Reset value: 0x0000 285 / 674 Nations Technologies Inc. Tel:+86-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 If the TIMx_EVTGEN.UDGN bit is set, the counter and prescaler are reinitialized. CNTEN Counter Enable 0: Disable counter 1: Enable counter 286 / 674 Nations Technologies Inc. Tel:+86-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: Control Register 2 (Timx_Ctrl2)

    Offset address: 0x0C Reset value: 0x0000 Bit field Name Description 15:9 Reserved Reserved, the reset value must be maintained 287 / 674 Nations Technologies Inc. Tel:+86-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: Status Registers (Timx_Sts)

    0: No update event occurred 1: Update interrupt occurred Event Generation registers (TIMx_EVTGEN) Offset address: 0x14 Reset values: 0 x0000 288 / 674 Nations Technologies Inc. Tel:+86-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: Counters (Timx_Cnt)

    Prescaler value PSC register value will be updated to prescaler register at update event. Counter clock frequency is 289 / 674 Nations Technologies Inc. Tel:+86-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: Automatic Reload Register (Timx_Ar)

    These bits define the value that will be loaded into the actual auto-reload register. See 12.3.1 for more details. When the TIMx_AR.AR [15:0] value is null, the counter does not work. 290 / 674 Nations Technologies Inc. Tel:+86-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: Low Power Timer (Lptim)

     Encoder mode, Encoder mode Pulse counting mode, support single pulse counting, double pulse counting (orthogonal and non-orthogonal) 291 / 674 Nations Technologies Inc. Tel:+86-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: Block Diagram

    The LPTIM can use an internal clock source or an external clock source. The internal clock source can be selected between APB, LSI, LSE, HSI or Comparator 1, 2 by configuring the RCC_RDCTRL.LPTIMSEL[2:0] bits. The 292 / 674 Nations Technologies Inc. Tel:+86-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: Prescaler

    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. 293 / 674 Nations Technologies Inc. Tel:+86-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: Timer Enable

    Note: Any write to the LPTIM_CTRL.SNGMST/ LPTIM_CTRL.TSTCM bit will be discarded if the LPTIM is not enabled. Table 13-2 9 trigger inputs corresponding to LPTIM_CFG.TRGSEL[2:0] bits Corresponding trigger input Control bits 294 / 674 Nations Technologies Inc. Tel:+86-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: Operating Mode

    LPTIM_CTRL. LPTIMEN bit is set to ‘1’). It is possible to switch from one-shot mode to continuous mode. Setting LPTIM_CTRL.SNGMST bit will switch the 295 / 674 Nations Technologies Inc. Tel:+86-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 13-4 Ptim Output Waveform, Single Counting Mode Configuration

    Figure 13-5. 296 / 674 Nations Technologies Inc. Tel:+86-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: Waveform Generation

    The LPTIM output waveform can be configured through the LPTIM_CFG.WAVE bit as follow:  Clearing the LPTIM_CFG.WAVE bit will force the LPTIM to generate a PWM waveform or a single-pulse 297 / 674 Nations Technologies Inc. Tel:+86-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: Register Update

    The LPTIM_ARR register and LPTIM_COMP register can be updated immediately after a software write operation. If the LPTIM is started, the LPTIM_ARR register and LPTIM_COMP register can be updated when counter overflow. 298 / 674 Nations Technologies Inc. Tel:+86-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: Counter Mode

    Since the signal injected on the LPTIM external Input1 is also used to clock the LPTIM kernel logic, there 299 / 674 Nations Technologies Inc. Tel:+86-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: Encoder Mode

    ‘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’). 300 / 674 Nations Technologies Inc. Tel:+86-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: Non-Orthogonal Encoder Mode

    Continuous mode. When Non-Encoder mode is active, the LPTIM counter is modified automatically following the speed and the 301 / 674 Nations Technologies Inc. Tel:+86-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: Timeout Function

    The waiting time is configured through the timeout value. 302 / 674 Nations Technologies Inc. Tel:+86-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: Lptim Interrupts

    LPTIM register overview Table 13-5 LPTIM register overview Offset Register LPTIM_INTSTS 000h Reserved Reset Value LPTIM_INTCLR 004h Reserved Reset Value 303 / 674 Nations Technologies Inc. Tel:+86-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: Lptim Interrupt And Status Register (Lptim_Intsts)

    In Encoder mode, hardware will set DOWN bit to inform the application the counter direction. Change counter direction up. 304 / 674 Nations Technologies Inc. Tel:+86-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: Lptim Interrupt Clear Register (Lptim_Intclr)

    Compare register update OK Clear Flag Writing 1 to this bit clears the CMPUPD flag in the LPTIM_INTSTS register 305 / 674 Nations Technologies Inc. Tel:+86-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: Lptim Interrupt Enable Register (Lptim_Inten)

    0: ARRM interrupt disabled 1: ARRM interrupt enabled CMPMIE Compare match interrupt enable bit. 0: CMPM interrupt disabled 306 / 674 Nations Technologies Inc. Tel:+86-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: Lptim Configuration Register (Lptim_Cfg)

    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 307 / 674 Nations Technologies Inc. Tel:+86-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 100: / 16 101: / 32 110: / 64 111: / 128 Reserved Reserved, the reset value must be maintained. 308 / 674 Nations Technologies Inc. Tel:+86-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 The CLKSEL bit selects which clock source the LPTIM will use: 0: LPTIM is clocked by internal clock source (APB1 clock or any of the embedded 309 / 674 Nations Technologies Inc. Tel:+86-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: Lptim Control Register (Lptim_Ctrl)

    LPTIM enable The LPTIMEN bit is set and cleared by software. 0: LPTIM is disabled 1: LPTIM is enabled 310 / 674 Nations Technologies Inc. Tel:+86-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: Lptim Compare Register (Lptim_Comp)

    ARRVAL - 1. LPTIM counter register (LPTIM_CNT) Address offset: 0x1C Reset value: 0x0000 0000 311 / 674 Nations Technologies Inc. Tel:+86-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 If identical, the reading is reliable. 312 / 674 Nations Technologies Inc. Tel:+86-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: Real Time Clock (Rtc)

    APB will be reset Reset The following registers will be cleared when the system is reset 313 / 674 Nations Technologies Inc. Tel:+86-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 The Tamper event also causes an erase of Back up Tamper registers when enabled. It is also a source of hardware trigger to LP Timer. 314 / 674 Nations Technologies Inc. Tel:+86-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 Alternatively a tamper event could be a source of Time-stamp event. Alarm A/Alarm B interrupt/event Wakeup interrupt/event Interrupts/events Timestamp interrupt/event Tamper interrupt/event Backup registers 20 independent backup registers 315 / 674 Nations Technologies Inc. Tel:+86-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: Function Description

     256 Hz or 1Hz clock output (LSE frequency is 32.768 kHz).  Alarm clock output (polarity configurable), Alarm A and Alarm B are optional. 316 / 674 Nations Technologies Inc. Tel:+86-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: Gpio Controlled By Rtc

    HSE/32 clock For the purpose of reduction of power consumption, the prescaler is divided into 2 programmable prescalers, they 317 / 674 Nations Technologies Inc. Tel:+86-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: Rtc Calendar

    Set RTC_PRE.DIVS[14:0] and RTC_PRE.DIVA[6:0] value.  Write the initial calendar values include time and date into the shadow registers (RTC_TSH and RTC_DATE) 318 / 674 Nations Technologies Inc. Tel:+86-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: Calendar Reading

    319 / 674 Nations Technologies Inc. Tel:+86-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: Calibration Clock Output

    RTC_CTRL.OPOL bit control the polarity of the Alarm A, Alarm B or Wakeup output. RTC_OPT.TYPE bit control the RTC_ALARM pin to output open drain or output pull-up. 320 / 674 Nations Technologies Inc. Tel:+86-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: Periodic Automatic Wakeup

    RTC_INITSTS.TISF has been set to 1 already, the hardware sets RTC_INITSTS.TISOVF flag to 1, and the timestamp registers (RTC_TST and RTC_TSD) will continue to hold the 321 / 674 Nations Technologies Inc. Tel:+86-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: Tamper Detection

    When RTC_TMPCFG.TPFLT[1:0] bits set to 1/2/3, tamper detection is set to level detection. The value of RTC_TMPCFG.TPFLT[1:0] determines the number of samples. 322 / 674 Nations Technologies Inc. Tel:+86-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: Daylight Saving Time Configuration

    When the input frequency is 32768 Hz, calibration period can be configured as 2 RTCCLK cycles or 32/16/8 323 / 674 Nations Technologies Inc. Tel:+86-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 Using an accurate 16-second period to measure the 1Hz calibration output can ensure that the measurement error is within 0.954ppm (0.5 RTCCLK cycles within 16 seconds).  The calibration period is 8 seconds. 324 / 674 Nations Technologies Inc. Tel:+86-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: Rtc Low Power Mode

    Reserved Reset Value RTC_CTRL 008h Reserved Reset Value RTC_INITSTS 00Ch Reserved Reset Value 010h RTC_PRE Reserved DIVA[6:0] DIVS[14:0] 325 / 674 Nations Technologies Inc. Tel:+86-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: Rtc Calendar Time Register (Rtc_Tsh)

    050h RTC_BKPx BF[31:0] 09Ch Reset Value RTC Calendar Time Register (RTC_TSH) Address offset: 0x00 Reset value: 0x0000 0000 326 / 674 Nations Technologies Inc. Tel:+86-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: Rtc Calendar Date Register (Rtc_Date)

    Describes the month tens value in BCD format 11:8 MOU[3:0] Describes the month units value in BCD format 327 / 674 Nations Technologies Inc. Tel:+86-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: Rtc Control Register (Rtc_Ctrl)

    0: Not record daylight saving time 1: Record daylight saving time SU1H Subtract 1 hour (winter time change) 328 / 674 Nations Technologies Inc. Tel:+86-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 1: Calendar values are copied directly from the calendar counters. Note: If the frequency of the APB1 clock falls below seven times the frequency of 329 / 674 Nations Technologies Inc. Tel:+86-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: Rtc Initial Status Register (Rtc_Initsts)

    This flag is set to ‘1’ by hardware when a tamper event is detected on the RTC_TAMP2 input pin. 330 / 674 Nations Technologies Inc. Tel:+86-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 , or when in bypass shadow register mode operation is pending (SHOPF = 1) (RTC_CTRL.BYPS = 1). This bit can also be cleared by software. 331 / 674 Nations Technologies Inc. Tel:+86-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: Rtc Prescaler Register (Rtc_Pre)

    Address offset: 0x10 Reset value: 0x007F 00FF Bit field Name Description 31:23 Reserved Reserved, the reset value must be maintained 332 / 674 Nations Technologies Inc. Tel:+86-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: Rtc Wakeup Timer Register (Rtc_Wkupt)

    RTC Alarm A Register (RTC_ALARMA) Address offset: 0x1C Reset value: 0x0000 0000 333 / 674 Nations Technologies Inc. Tel:+86-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: Rtc Alarm B Register (Rtc_Alarmb)

    Address offset: 0x20 Reset value: 0x0000 0000 Bit field Name Description MASK4 Alarm date mask 0: Date/day match 334 / 674 Nations Technologies Inc. Tel:+86-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: Rtc Write Protection Register (Rtc_Wrp)

    Reading this byte always returns 0x00. For detail on how to unlock RTC register write protection, see chapter RTC register 335 / 674 Nations Technologies Inc. Tel:+86-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: Rtc Sub-Second Register (Rtc_Subs)

    This bit can only be written and read as zero. Writing to this bit does not have an impact when RTC_INITSTS.SHOPF=1. 30:15 Reserved Reserved, the reset value must be maintained 336 / 674 Nations Technologies Inc. Tel:+86-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: Rtc Timestamp Time Register (Rtc_Tst)

    Describes the second units value in BCD format RTC Timestamp Date Register (RTC_TSD) Address offset: 0x34 Reset value: 0x0000 0000 337 / 674 Nations Technologies Inc. Tel:+86-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: Rtc Timestamp Sub-Second Register (Rtc_Tsss)

    Note: SSE[15:0] can be larger than RTC_PRE.DIVS[14:0] only after a shift operation. In that case, the correct time/date is one second less than as indicated by RTC_TSH/RTC_DATE. 338 / 674 Nations Technologies Inc. Tel:+86-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: Rtc Calibration Register (Rtc_Calib)

    0.9537 ppm. RTC Tamper Configuration Register (RTC_TMPCFG) Address offset: 0x40 Reset value: 0x0000 0000 339 / 674 Nations Technologies Inc. Tel:+86-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 0: Enable precharge RTC_TAMPx pins before each sampling. 1: Disable precharge RTC_TAMPx pins 14:13 TPPRCH[1:0] RTC_TAMPx Precharge duration. 340 / 674 Nations Technologies Inc. Tel:+86-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 TPFLT = 00, tamper detection is in edge mode: 0: Rising edge trigger a tamper detection event. 341 / 674 Nations Technologies Inc. Tel:+86-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: Rtc Alarm A Sub-Second Register (Rtc_Alrmass)

    0x2: Only SSV[1:0] are compared and other bits are not compared. 0x3: Only SSV[2:0] are compared and other bits are not compared. 342 / 674 Nations Technologies Inc. Tel:+86-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: Rtc Alarm B Sub-Second Register (Rtc_Alrmbss)

    This value is compared with the synchronous prescaler counter RTC_SUBS.SS[14:0], and bit number of compared is controlled by MASKSSB[3:0]. 343 / 674 Nations Technologies Inc. Tel:+86-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: Rtc Option Register (Rtc_Opt)

    If RTC_TMPCFG.TPxNOE=0, these registers are reset when tamper x event detection happens. 344 / 674 Nations Technologies Inc. Tel:+86-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: Independent Watchdog (Iwdg)

    Reset and low-power wake-up can be matched.  A system reset occurs when the down counter reaches 0x0000 (if watchdog activated). 345 / 674 Nations Technologies Inc. Tel:+86-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: Function Description

    The reload operation (IWDG_KEY.KEYV[15:0] configured with value of 0xAAAA) will also cause the registers to become write protected again. 346 / 674 Nations Technologies Inc. Tel:+86-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: Debugging Mode

    Table 15-1 IWDG counting maximum and minimum reset time Minimum(ms) Maximum(ms) Pre-scale factor PD[2:0] RL[11:0]=0 RL[11:0]=0xFFF 409.6 819.2 1638.4 347 / 674 Nations Technologies Inc. Tel:+86-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: Iwdg Configuration Flow

    Reset value IWDG_PREDIV PD[2:0] 0x04 Reserved Reset value IWDG_RELV REL[11:0] 0x08 Reserved Reset value IWDG_STS 0x0C Reserved Reset value 348 / 674 Nations Technologies Inc. Tel:+86-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: Iwdg Key Register (Iwdg_Key)

    Address offset: 0x04 Reset value: 0x00000000 Bit field Name Description 31:3 Reserved Reserved, the reset value must be maintained. 349 / 674 Nations Technologies Inc. Tel:+86-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: Iwdg Reload Register (Iwdg_Relv)

    Therefore, the read value is valid only when the IWDG_STS.CRVU bit is ‘0’. IWDG status register (IWDG_STS) Address offset: 0x0C 350 / 674 Nations Technologies Inc. Tel:+86-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 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. 351 / 674 Nations Technologies Inc. Tel:+86-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: Window Watchdog (Wwdg)

    Therefore, before enabling the watchdog, you need to set WWDG_CTRL.T [6] bit to 1, preventing reset right 352 / 674 Nations Technologies Inc. Tel:+86-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: Timing For Refresh Watchdog And Interrupt Generation

    MCU. Counter count down from 0x7F to 0x3F using scaled APB1 353 / 674 Nations Technologies Inc. Tel:+86-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: Debug Mode

    Setting WWDG_CTRL.ACTB[7] bit to enable WWDG; Software operates WWDG_STS.EWINTF[0] bit to clear wake-up interrupt flag; Configure WWDG_CFG.EWINT[9] bit to enable early wake-up interrupt. 354 / 674 Nations Technologies Inc. Tel:+86-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: Wwdg Registers

    A reset is produced when it rolls over from 0x40 to 0x3F (T6 becomes cleared). WWDG config register (WWDG_CFG) Address offset: 0x04 Reset value : 0x0000007F 355 / 674 Nations Technologies Inc. Tel:+86-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: Wwdg Status Register (Wwdg_Sts)

    ‘0’. A write of ‘1’ has no effect. This bit is also set if the interrupt is not enabled. 356 / 674 Nations Technologies Inc. Tel:+86-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: Analog To Digital Conversion (Adc)

    Support single conversion mode  Support continuous conversion mode  Support discontinuous mode  Support self-calibration  Support DMA 357 / 674 Nations Technologies Inc. Tel:+86-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: Function Description

    Supports internal reference voltage (2.048V), please refer to the data sheet for specific parameters Function Description Figure 17-1 is a functional block diagram of an ADC. 358 / 674 Nations Technologies Inc. Tel:+86-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: Adc Clock

    ADC clock An ADC requires three clocks, HCLK, ADC_CLK and ADC_1MCLK.  HCLK is used for the register access. 359 / 674 Nations Technologies Inc. Tel:+86-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: Adc Switch Control

    The conversion can be stopped by clearing the ADC_CTRL2.ON bit and placing the ADC in power-off mode. In this 360 / 674 Nations Technologies Inc. Tel:+86-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: Channel Selection

    Note: During conversion, changes to the ADC_RSEQx or ADC_JSEQ registers are prohibited; the ADC_RSEQx or ADC_JSEQ registers can only be changed when the ADC is idle. 361 / 674 Nations Technologies Inc. Tel:+86-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: Figure 17-3 Adc Channels And Pin Connections

    [15] [16] Slow Channel ADC_IN16 [16] VREF- [17] Slow Channel [17] VREF- Slow Channel [18] VREFBUFF [18] VREF- 362 / 674 Nations Technologies Inc. Tel:+86-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: Internal Channel

    ADC starts to convert, and the conversion end flag will be set to 1 after the conversion is completed. 363 / 674 Nations Technologies Inc. Tel:+86-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: Analog Watchdog

    There is none Any value All injection channels All regular channels All injection and regular channels A single injection channel 364 / 674 Nations Technologies Inc. Tel:+86-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: Scanning Mode

    When using this function, the time interval between the injection channel triggers needs to be greater than the time required for the injection sequence to complete the conversion. 365 / 674 Nations Technologies Inc. Tel:+86-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: Discontinuous Mode

    1. When the conversion of all channels in the conversion sequence is completed, when the next trigger 366 / 674 Nations Technologies Inc. Tel:+86-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: Calibration

    ADC_JOFFSETx register, so the result can be a negative value; for regular sequence , there is no need to subtract offset value. 367 / 674 Nations Technologies Inc. Tel:+86-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: Programmable Channel Sampling Time

    If you select EXTI line 0~15 or TIM8_TRGO as the external trigger source, you can set the AFIO_RMP_CFG.ADC_ETRR and AFIO_RMP_CFG.EXTI_ETRR[3:0] bits to implement; 368 / 674 Nations Technologies Inc. Tel:+86-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: Dma Requests

    ADC regular channel conversion ends, a DMA request is generated. After the DMA receives the request, it will transfer the converted data from the ADC_DAT register to the destination address specified by the user. 369 / 674 Nations Technologies Inc. Tel:+86-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: Temperature Sensor

    Read the temperature data in the ADC data register, and calculate the temperature value by the following formula: 370 / 674 Nations Technologies Inc. Tel:+86-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: Adc Interrupt

    Table 17-8 ADC register overview Offset Register ADC_STS 000h Reserved Reset Value ADC_CTRL1 DCTU[2:0] AWDGCH[4:0] 004h Reserved Reset Value 008h ADC_CTRL2 Reserved 371 / 674 Nations Technologies Inc. Tel:+86-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: Adc Status Register (Adc_Sts)

    Reset Value ADC_SAMPT3 05Ch Reserved Reset Value ADC status register (ADC_STS) Address offset: 0x00 Reset value: 0x0000 0000 372 / 674 Nations Technologies Inc. Tel:+86-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 ADC_LTR and ADC_HTR registers 0: Analog watchdog event not occurs; 1: Analog watchdog event occurs. 373 / 674 Nations Technologies Inc. Tel:+86-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: Adc Control Register 1 (Adc_Ctrl1)

    This bit is set and cleared by the software to enable or disable automatic injection sequence channel conversion after regular sequence channel conversion is complete 374 / 674 Nations Technologies Inc. Tel:+86-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 10000: ADC analog input channel 16 10001: ADC analog input channel 17 10010: ADC analog input channel 18 375 / 674 Nations Technologies Inc. Tel:+86-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: Adc Control Register 2 (Adc_Ctrl2)

    These bits select external events to start the regular sequence conversion The triggering configuration of ADC is as follows 376 / 674 Nations Technologies Inc. Tel:+86-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 STAB 377 / 674 Nations Technologies Inc. Tel:+86-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: Adc Sampling Time Register 1 (Adc_Sampt1)

    011: 7.5 cycles 111: 601.5 cycles ADC sampling time register 2 (ADC_SAMPT2) Address offset: 0x10 Reset value: 0x0000 0000 378 / 674 Nations Technologies Inc. Tel:+86-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: Adc Injected Channel Data Offset Register X (Adc_Joffsetx) (X=1

    The result of the conversion can be read in the ADC_JDATx register. ADC watchdog high threshold register (ADC_WDGHIGH) Address offset: 0x24 Reset value: 0x0000 0FFF 379 / 674 Nations Technologies Inc. Tel:+86-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 Watchdog Low Threshold Register (Adc_Wdglow)

    These bits are software-defined as the number (0 to 18) of the 16th conversion channel in the conversion sequence. 14:10 SEQ15[4:0] 15th conversion in regular sequence 380 / 674 Nations Technologies Inc. Tel:+86-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: Adc Regular Sequence Register 2 (Adc_Rseq2)

    These bits are software-defined as the number (0 to 18) of the 6th transition channel in the conversion sequence. 24:20 SEQ5[4:0] 5th conversion in regular sequence 19:15 SEQ4[4:0] 4th conversion in regular sequence 381 / 674 Nations Technologies Inc. Tel:+86-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: Adc Injection Sequence Register (Adc_Jseq)

    1st conversion in injected sequence ADC injection data register x (ADC_JDATx) (x= 1…4) Address offset: 0x3C - 0x48 Reset value: 0x0000 0000 382 / 674 Nations Technologies Inc. Tel:+86-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: Adc Regulars Data Register (Adc_Dat)

    Reset value: 0x0000 0000 Reserved DIFSEL[17:0] DIFSEL[17:0] Reserved Bit field Name Description 31:19 Reserved Reserved, the reset value must be maintained 383 / 674 Nations Technologies Inc. Tel:+86-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: Adc Calibration Factor (Adc_Calfact)

    ADC_STS.JSTR =0 (ADC does not process conversion or start conversion) ADC control register 3 (ADC_CTRL3) Address offset: 0x58 Reset value: 0x0000 0043 384 / 674 Nations Technologies Inc. Tel:+86-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 Differential mode for calibration This bit is set and cleared by software to configure the calibrated single-ended or differential input mode 385 / 674 Nations Technologies Inc. Tel:+86-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: Adc Sampling Time Register 3 (Adc_Sampt3)

    011: 7.5 cycles 111: 601.5 cycles SAMP18[2:0] Channel Sample Time The channel sampling time definition is consistent with ADC_SAMPT2 386 / 674 Nations Technologies Inc. Tel:+86-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: Digital To Analog Conversion (Dac)

    Input reference voltage VREF+  External event triggers the conversion DAC block diagram and pins are shown below. 387 / 674 Nations Technologies Inc. Tel:+86-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: Table 18-1 Dac Pins

    Note: When the DAC is enabled, PA4 needs to be configured as analog input mode. PA4 will automatically connect 388 / 674 Nations Technologies Inc. Tel:+86-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: Dac Function Description And Operation Description

    8-bit data is right-aligned. (Actually stored in the register DACCHD[11:4] bits, DACCHD is the internal data storage register) 389 / 674 Nations Technologies Inc. Tel:+86-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: Dac Trigger

    DAC_DATO register. Note: 1. Do not change the DAC_CTRL.TSEL[2:0] bit when the DAC is enabled. 390 / 674 Nations Technologies Inc. Tel:+86-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: Dac Conversion

    Note: DMA requests for DAC have no accumulative function, and when the second external trigger occurs before the 391 / 674 Nations Technologies Inc. Tel:+86-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 Noise

    (overflow bits are discarded). The initial value of LFSR is 0xAAA, and the value of LFSR is updated after 3 APB1 cycles after the trigger event occurs. Figure 18-4 LFSR algorithm for DAC 392 / 674 Nations Technologies Inc. Tel:+86-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: Triangular Wave Generation

    3 APB1 cycles after the trigger event occurs, the triangular wave counter will accumulate to the maximum amplitude value set, and then decrement to 0, and so on. 393 / 674 Nations Technologies Inc. Tel:+86-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: Dac Register

    DAC registers overview Table 18-3 DAC registers overvie Offset Register DAC_CTRL 000h Reserved Reset Value 004h DAC_SOTTR Reserved 394 / 674 Nations Technologies Inc. Tel:+86-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: Dac Control Register (Dac_Ctrl)

    ≥1011: unmasked LFSR bit [11:0] / triangular amplitude is equal to 4095 WEN[1:0] DAC noise/triangle wave function selection. The bits are set to 1 and cleared by the software. 395 / 674 Nations Technologies Inc. Tel:+86-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: Dac Software Trigger Register (Dac_Sottr)

    Reset value: 0x0000 0000 Bit field Name Description 31:1 Reserved Reserved, the reset value must be maintained. TREN DAC software trigger 396 / 674 Nations Technologies Inc. Tel:+86-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: Bit Right Aligned Data Hold Register For Dac (Dac_Dr12Ch)

    Reserved, the reset value must be maintained. 8-bit right-aligned data hold register for DAC (DAC_DR8CH) Offset address: 0x10 397 / 674 Nations Technologies Inc. Tel:+86-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: Dac Data Output Register (Dac_Dato)

    11:0 DACCHDO[11:0] DAC data output. These bits are read-only and represent the output data of the DAC channel 398 / 674 Nations Technologies Inc. Tel:+86-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: Comparator (Comp)

    4. The second character in the 8-bit code of the last line of the chip printed in the factory setting is "B" 399 / 674 Nations Technologies Inc. Tel:+86-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: Comp Features

    COMPx_FILC.SAMPW[4:0]/2) Configure the filter sampling frequency (for timer applications, sampling frequency should be greater than 5MHz) 400 / 674 Nations Technologies Inc. Tel:+86-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: Comp Working Mode

    Note 2: The selection of the comparator's PA1/DAC1 is done by configuring COMP1_CTRL.INPDAC The comparator INM pins have the following configuration. 401 / 674 Nations Technologies Inc. Tel:+86-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: Interrupt

    The polarity of COMPx_CTRL.POL is reversed, and the interrupt is enabled. When INPSEL < INMSEL, the comparator interrupt is generated when COMPx_CTRL.OUT is set to 1 by hardware. 402 / 674 Nations Technologies Inc. Tel:+86-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: Comp Register

    01Ch Reserved COMP2_CTRL 020h Reserved Reset Value COMP2_FILC 024h Reserved Reset Value COMP2_FILP CLKPSC[15:0] 028h Reserved Reset Value 403 / 674 Nations Technologies Inc. Tel:+86-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: Comp Interrupt Enable Register (Comp_Inten)

    Software controlled Interrupt enable of COMP1. 0: Disable 1: Enable COMP low power select register (COMP_LPCKSEL) Address offset : 0x04 404 / 674 Nations Technologies Inc. Tel:+86-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: Comp Window Mode Register (Comp_Winmode)

    1: Comparators 1 and 2 are in window mode. COMP lock register (COMP_LOCK) Address offset : 0x0C Reset value : 0x0000 0000 405 / 674 Nations Technologies Inc. Tel:+86-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: Comp1 Control Register (Comp1_Ctrl)

    010: TIM8 OC5 selected as blanking source Other configurations: reserved 15:14 HYST[1:0] These bits control the hysteresis level. 00: No hysteresis 406 / 674 Nations Technologies Inc. Tel:+86-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 These bits allows to select the source connected to the inverting input of the comparator 1. 000:floating; 001:DAC1; 407 / 674 Nations Technologies Inc. Tel:+86-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: Comp1 Filter Register (Comp1_Filc)

    0: Disable 1: Enable COMP1 filter frequency division register (COMP1_FILP) Address offset : 0x18 Reset value : 0x0000 0000 408 / 674 Nations Technologies Inc. Tel:+86-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: Comp2 Control Register (Comp2_Ctrl)

    OUTTRG[3:0] These bits select which Timer input must be connected with the comparator 2 output. 0000:Reserved.; 0001:TIM1_BKIN; 0010:TIM1_OCrefclear; 409 / 674 Nations Technologies Inc. Tel:+86-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: Comp2 Filter Register (Comp2_Filc)

    0: Comparator disabled 1: Comparator enabled COMP2 filter register (COMP2_FILC) Address offset : 0x24 Reset value : 0x0000 0000 410 / 674 Nations Technologies Inc. Tel:+86-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: Comp2 Filter Frequency Division Register (Comp2_Filp)

    2: Every 3 cycle … COMP2 output select register (COMP2_OSEL) Address offset : 0x2C Reset value : 0x0000 0000 411 / 674 Nations Technologies Inc. Tel:+86-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: Comp Reference Voltage Register (Comp_Vrefscl)

    VREF1(DAC1) voltage scaler: 0: disable; 1: enable. COMP test register(COMP_TEST) Address offset : 0x34 Reset value : 0x0000 0000 412 / 674 Nations Technologies Inc. Tel:+86-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: Comp Interrupt Status Register (Comp_Intsts)

    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. 413 / 674 Nations Technologies Inc. Tel:+86-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: Operational Amplifier (Opamp)

    The output of OPAMP1 is connected to the analog input channel 3 of the ADC The output of OPAMP2 is connected to the analog input channel 7 of the ADC 414 / 674 Nations Technologies Inc. Tel:+86-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: Opamp Working Mode

    OPAMP are connected to the external port. , the amplification factor is determined by the external RC network. 415 / 674 Nations Technologies Inc. Tel:+86-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: Opamp Follow Mode

    OPAMPx_CS. VMSSEL or OPAMPx_CS. VMSEL is connected to the output port from the chip interior. A VM pin that is not occupied can be used as another GPIO. 416 / 674 Nations Technologies Inc. Tel:+86-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: Opamp Internal Gain (Pga) Mode

    OPAMPx_CS. PGAGAN to gain selection.The output of an OPAMP can be input to another OPAMP or a resistive network. OPAMP's VM input pin can be used as a normal GPIO. 417 / 674 Nations Technologies Inc. Tel:+86-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: Opamp With Filtered Internal Gain Mode

    OPAMAPx_CS.VPSEL is set to be connected to the external pin, and the negative of OPAMP can be connected to components such as capacitors. Figure 20-5 Internal gain mode with filtering 418 / 674 Nations Technologies Inc. Tel:+86-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: Opamp Calibration

    OPAMP register overview Table 20-1 OPAMP register overview Offset Register OPAMP_CS1 000h Reserved Reset Value OPAMP_CS2 010h Reserved Reset Value 419 / 674 Nations Technologies Inc. Tel:+86-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: Opamp Control Status Register (Opamp1_Cs)

    When this signal switches, the offset during calibration mode is calibrated. TSTREF Reserved, the reset value must be maintained. 420 / 674 Nations Technologies Inc. Tel:+86-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: Opamp Control Status Register (Opamp2_Cs)

    Operational amplifier Enable 0: disable; 1: enable. OPAMP Control Status Register (OPAMP2_CS) Offset address: 0x10 Reset value: 0x0000 0000 421 / 674 Nations Technologies Inc. Tel:+86-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 010: VP2 (PB14); 011: VP3 (PD13); Others :(NC). VMSEL[1:0] OPAMP inverted input selection 00: VM0 (PC5); 01: VM1 (PB0); 422 / 674 Nations Technologies Inc. Tel:+86-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: Opamp Lock Register (Opamp_Lock)

    After the reset, this bit can be written only once 0: OPAMP2 register can read and write; 1: The OPAMP2 register is read-only. OPAMP1LK With OPAMP2LK. 423 / 674 Nations Technologies Inc. Tel:+86-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: Low Power Rotation Counter (Lprcnt)

    Programmable excitation time, discharge time, and damped oscillation time  Sensor falling off alarm  Support cumulative error correction 424 / 674 Nations Technologies Inc. Tel:+86-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: Functional Description

    As shown below: 425 / 674 Nations Technologies Inc. Tel:+86-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: State Machine Judgment And Rotation Position

    0, then the metal area is 1. As shown in Figure 21-2 below, the state machine composed of sensors is "10". 426 / 674 Nations Technologies Inc. Tel:+86-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: Calibration Mode And Normal Mode

    When the set number of turns is reached, an overflow interrupt will be generated, and the MCU will be woken up to exit the STOP2 mode. 427 / 674 Nations Technologies Inc. Tel:+86-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: Lprcnt Comparator Filtering

    2, 4, and 8 frequency division factors, which can be configured through the LPRCNT_CTRL.CLKDIV bit. LSX mainly provides the time base for sensor scanning. 428 / 674 Nations Technologies Inc. Tel:+86-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 N times. If you want to see the time signal value, you need to enter the calibration mode. 429 / 674 Nations Technologies Inc. Tel:+86-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: Lprcnt Module Operation In Calibration Mode

    LPRCNT module for parameter adjustment. Proceed as follows: ■ LPRCNT_SCTRL configures the sampling period of the detection channel, LPRCNT_CTRL.ALMPRD[1:0] 430 / 674 Nations Technologies Inc. Tel:+86-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: Lprcnt Normal Working Mode Operation

    Fast cutting and slow speed must ensure that more than half a circle does not move. LPRCNT registers LPRCNT register overview 431 / 674 Nations Technologies Inc. Tel:+86-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: Lprcnt Control Register (Lprcnt_Ctrl)

    03Ch Reserved Reserved Reset Value 1 0 0 LPRCNT control register (LPRCNT_CTRL) Address offset: 0x00 Reset value: 0x3ba60400 432 / 674 Nations Technologies Inc. Tel:+86-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 Automatically calculate the average data of multiple excitations and samples in 1 round of sampling, N is mapped to 2^N, (data smoothing algorithm: bit shift for 433 / 674 Nations Technologies Inc. Tel:+86-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: Lprcnt Interrupt Status Register

    Low speed mode sensor processing period,unit:T(LSX_CLK)*32,default value:333 15:8 SWT[7:0] Time from sensor state machine unchanged to switching to low-speed sampling mode, 434 / 674 Nations Technologies Inc. Tel:+86-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: Lprcnt Sensor Channel 0 Threshold Register(Lprcnt_Ch0Cfg0)

    The discharge duration, unit: T(MSI_CLK_DIV)*1, default value:3 Reserved Reserved,the reset value must be maintained. CHGDUR[5:0] The charge duration, unit:T(MSI_CLK_DIV)*1,default value:2 435 / 674 Nations Technologies Inc. Tel:+86-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: Lprcnt Sensor Channel 1 Threshold Register (Lprcnt_Ch1Cfg0)

    The charge duration, unit:T(MSI_CLK_DIV)*1,default value:2 LPRCNT sensor channel 2 threshold register (LPRCNT_CH2CFG0) Address offset: 0x1C Reset value: 0x0021 2C24 436 / 674 Nations Technologies Inc. Tel:+86-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: Lprcnt Sensor Channel 2 Time Control Register (Lprcnt_Ch2Cfg1)

    Reserved,the reset value must be maintained. CHGDUR[5:0] The charge duration, unit:T(MSI_CLK_DIV)*1,default value:2 LPRCNT command register (LPRCNT_CMD) Address offset: 0x24 Reset value: 0x0000 0000 437 / 674 Nations Technologies Inc. Tel:+86-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: Lprcnt Calibration Register 0 (Lprcnt_Cal0)

    Channel 0 comparator valid square wave count value LPRCNT calibration register 1(LPRCNT_CAL1) Address offset : 0x34 Reset value: 0x0000 0000 438 / 674 Nations Technologies Inc. Tel:+86-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: Lprcnt Calibration Register 2(Lprcnt_Cal2)

    DAC excitation voltage setup time LPRCNT calibration register 3 (LPRCNT_CAL3) Address offset : 0x3C Reset value: 0x9088 E400 439 / 674 Nations Technologies Inc. Tel:+86-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 001:DAC1 010:PA0 011:PA5 100:PB5 101:PD4 110:VREF_VC1 111:VREF_VC2 11:10 CMP_HYSEL[1:0] Comparator hysteresis selection 00: no hysteresis 01: low hysteresis 440 / 674 Nations Technologies Inc. Tel:+86-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 This bit needs to be used in conjunction with the LPRCNT_CTRL.CMPAUT bit 0: Ends after 4 cycles 1: Ends after 8 cycles Reserved Reserved,the reset value must be maintained. 441 / 674 Nations Technologies Inc. Tel:+86-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: Liquid Crystal Display Controller (Lcd)

    Support blink function: 1, 2, 3, 4, 8 or all pixels can blink at the specified frequency (0.5Hz, 1Hz, 2Hz or 4Hz)  Pins used for SEG and COM functions should be configured with the appropriate AFIO. 442 / 674 Nations Technologies Inc. Tel:+86-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: Functional Block Diagram

    DIV[3:0] ck_div SEG[43:0] VSEL LCDEN COM[7:4] Interrupt HDEN CONTRAST[2:0] SEG[43:40] BIAS[1:0] SEG[31:28] SEG[43:40] COM[3:0] SEG[39:0] Analog Switch Array 443 / 674 Nations Technologies Inc. Tel:+86-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: Functional Description

    Example of frame frequency calculation is shown in the following table: Table 22-1 Frame rate calculation example LCDCLK PRES[3:0] DIV[3:0] Ratio Duty frame 32.768kHz 30.12Hz 32.768kHz 30.12Hz 444 / 674 Nations Technologies Inc. Tel:+86-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: Common End Driver

    1/2 V at the end of each odd period. 445 / 674 Nations Technologies Inc. Tel:+86-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: Figure 22-2 Odd-Even Frames Example(1/4 Duty Cycle, 1/3 Bias)

    1 is inactive. When the LCD_CTRL.LCDEN bit is disabled, all COM is pulled to VSS and the LCD_STS.ENSTS flag becomes 446 / 674 Nations Technologies Inc. Tel:+86-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: Segment Driver

    When the LCD_CTRL.LCDEN bit is disabled, all SEG ports are pulled down to VSS. Below figure shows the waveform with different duty cycles and bias 447 / 674 Nations Technologies Inc. Tel:+86-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: Figure 22-4 1/2 Duty Cycle, 1/2 Bias

    0/2VLCD COM0 SEG2 SEG3 2/2VLCD 1/2VLCD COM0-SEG0 Activated pixel 0/2VLCD -1/2VLCD -2/2VLCD 1/2VLCD COM0-SEG1 0/2VLCD Inactivated pixel -1/2VLCD 448 / 674 Nations Technologies Inc. Tel:+86-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: Figure 22-5 1/3 Duty Cycle, 1/3 Bias

    SEG2 0/3VLCD 3/3VLCD 2/3VLCD 1/3VLCD COM0-SEG1 Activated pixel 0/3VLCD -1/3VLCD -2/3VLCD -3/3VLCD 1/3VLCD COM0-SEG0 0/3VLCD Inactivated pixel -1/3VLCD 449 / 674 Nations Technologies Inc. Tel:+86-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: Figure 22-6 1/4 Duty Cycle, 1/3 Bias

    SEG1 0/3VLCD 3/3VLCD 2/3VLCD 1/3VLCD COM0-SEG1 0/3VLCD Activated pixel -1/3VLCD -2/3VLCD -3/3VLCD 1/3VLCD COM0-SEG0 0/3VLCD Inactivated pixel -1/3VLCD 450 / 674 Nations Technologies Inc. Tel:+86-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: Blink Function

    LCD_FCTRL.BLINKF[2:0] bits and divide f . Table 22-2 lists configuration examples for ck_div different blink frequencies. 451 / 674 Nations Technologies Inc. Tel:+86-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: Voltage Generator And Contrast Control

    For LCD_FCTRL.PULSEON[2:0] bits: LCD_FCTRL.PULSEON[2:0] configures the time that R is enabled by the HDEN switch when the COM and SEG 452 / 674 Nations Technologies Inc. Tel:+86-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: Figure 22-8 Lcd Drive Voltage Control

    2/3 V BUFEN BUFEN LCDRail2 BUFEN 1/2 V 1/3 V BUFEN BUFEN LCDRail3 BUFEN 1/4 V BIAS[1] Static 453 / 674 Nations Technologies Inc. Tel:+86-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: Double Buffer Display

    44 SEG pins and 1, 2, 3 and 4 COM pins are available.In 1/8 duty cycle mode, there are up to 40 SEG pins, and SEG[43:40] can be used as COM[7:4]. 454 / 674 Nations Technologies Inc. Tel:+86-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: Table 22-3 Com And Seg Pins Mapping Table

    SEG[31:28] 30× 4 COM[3:0] COM[3:0] —— —— 34× 4 SEG[32], SEG[35] SEG[32], SEG[35] Not used SEG[31:28] Not available 455 / 674 Nations Technologies Inc. Tel:+86-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 SEG[43:40]/ COM[7:4] Not available COM[3] Not used —— —— 20×3 COM[2:0] COM[2:0] SEG[32], SEG[35] SEG[32], SEG[35] SEG[31:28] Not available 456 / 674 Nations Technologies Inc. Tel:+86-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 Not available SEG[17:0] SEG[17:0] SEG[43:40]/ COM[7:4] SEG[43:40] COM[3:1] Not used —— —— STATIC 44×1 COM[0] COM[0] SEG[39:32] SEG[39:32] 457 / 674 Nations Technologies Inc. Tel:+86-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 3. Not available: The pin is not lead out in the current package; Not used: The pin is lead out in the current package, but this function is not supported according to the current configuration. 458 / 674 Nations Technologies Inc. Tel:+86-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: Working Process

    LCD registers must be read and written by 32 bits Start address of the LCD controller register is 0x40004000 459 / 674 Nations Technologies Inc. Tel:+86-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: Lcd Controller Register Overview

    Reset Value LCD_RAM1_COM4 034h Reset Value LCD_RAM2_COM4 038h Reserved Reset Value LCD_RAM1_COM5 03Ch Reset Value 040h LCD_RAM2_COM5 Reserved 460 / 674 Nations Technologies Inc. Tel:+86-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: Lcd Control Register (Lcd_Ctrl)

    01:1/3 Bias; 10:1/4 Bias; 11: Reserved. DUTY[2:0] Duty selection 000: static LCD; 001:1/2 DUTY; 010:1/3 duty; 011:1/4 duty; 461 / 674 Nations Technologies Inc. Tel:+86-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: Lcd Frame Control Register (Lcd_Fctrl)

    = ck_pres/(16+n) 0000: ck_div = ck_pres/16; 0001: ck_div = ck_pres/17; 0010: ck_div = ck_pres/18; 1111: ck_div = ck_pres/31. 462 / 674 Nations Technologies Inc. Tel:+86-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 Pulse on duration This bit configures the pulse duration based on ck_pres. 000: 0; 001: 1 / ck_pres; 463 / 674 Nations Technologies Inc. Tel:+86-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: Lcd Status Register (Lcd_Sts)

    LCD frame control register synchronization flag Every time the LCD_FCTRL register is updated in the LCDCLK domain, the bit is 464 / 674 Nations Technologies Inc. Tel:+86-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: Lcd Clear Register (Lcd_Clr)

    0: LCD controller is disabled. 1: LCD controller is enabled. LCD clear register (LCD_CLR) Address offset: 0x0C Reset value: 0x0000 0000 465 / 674 Nations Technologies Inc. Tel:+86-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: Lcd Display Memory Register (Lcd_Ram1_Comx X = 0

    Display memory LCD_RAM2_COMx (x = 0...3) Pixel bit (y = 0...11), each bit corresponds to a pixel. The pixel value 1 represents activity, and 0 represents inactivity. 466 / 674 Nations Technologies Inc. Tel:+86-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: Lcd Display Memory Register (Lcd_Ram2_Comx X = 4

    Display memory LCD_RAM2_COMx (x = 4...7) Pixel bits (y = 0...7), each bit corresponds to a pixel. The pixel value 1 represents activity, and 0 represents inactivity. 467 / 674 Nations Technologies Inc. Tel:+86-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: I2C Interface

    It support interrupt mode, users can enable or disable interrupt according to their needs. 468 / 674 Nations Technologies Inc. Tel:+86-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: Sda And Scl Line Control

    The block diagram of I C interface is shown in the figure below. 469 / 674 Nations Technologies Inc. Tel:+86-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: Start And Stop Conditions

    Clock synchronization and Arbitration The I2C module supports multi-master arbitration, which means two masters can initiate an I2C START 470 / 674 Nations Technologies Inc. Tel:+86-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: Clock Synchronization

    Each I2C device is identified by a unique address. According to the device function, they can be either a transmitter 471 / 674 Nations Technologies Inc. Tel:+86-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 I2C_STS1.TXDATE bit is cleared.After that, as long as there is still data to be sent and I2C_STS1.TXDATE is set to 1, the software can write a byte to I2C_DAT register. 472 / 674 Nations Technologies Inc. Tel:+86-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 23-3 Slave Transmitter Transfer Sequence Diagram

    After it is found that it is set, the software clears the I2C_STS1.ADDRF bit by 473 / 674 Nations Technologies Inc. Tel:+86-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 23-4 Slave Receiver Transfer Sequence Diagram

    When the START condition is generated on the bus through the start bit, the device enters the master mode. 474 / 674 Nations Technologies Inc. Tel:+86-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 I2C_STS1.TXDATE flag bit. After that, there is no need to care about the status of the I2C_STS1.TXDATE bit. 475 / 674 Nations Technologies Inc. Tel:+86-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 23-5 Master Transmitter Transfer Sequence Diagram

    The software sequence of EV8 must be completed before the end of the current byte transfer. c) When I2C_STS1.TXDATE or I2C_STS1.BSF bit is set, stop condition should be arranged when EV8_2 occurs. 476 / 674 Nations Technologies Inc. Tel:+86-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 1, an acknowledge pulse will be sent. At this time, the software can read the first byte from the I2C_DAT register, and then the I2C_STS1.RXDATNE bit is cleared to 0. After that, as long as I2C_STS1.RXDATNE is 477 / 674 Nations Technologies Inc. Tel:+86-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: Figure 23-6 Master Receiver Transfer Sequence Diagram

    6. EV9: I2C_STS1.ADDR10F=1, reading STS1 and then writing to the DAT register will clear this event. Note: a) If a single byte is received, it is NA. 478 / 674 Nations Technologies Inc. Tel:+86-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: Error Conditions Description

    And User make sure that in the event of an underrun error, the receiver discard repeatedly byte, 479 / 674 Nations Technologies Inc. Tel:+86-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: Dma Application

    If use DMA mode need set I2C_CTRL2.DMAEN bit. When data byte is received,DMA will send I2C data to storage area, set DMA channel for I2C reception. The following steps must be opreate: 480 / 674 Nations Technologies Inc. Tel:+86-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: Packet Error Check

    DMA transfer. And if it does the last DMA request of the master receiver, NACK will be sent automatically after receiving the last byte. When arbitration is lost, PEC calculation is invalid. 481 / 674 Nations Technologies Inc. Tel:+86-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: Smbus

    Device identification On the SMBus, as a slave have a only address for any device, named slave address. 482 / 674 Nations Technologies Inc. Tel:+86-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: Bus Protocol

    I2C_STS1.SMBALERT. The 7-bit device address provided from the sending device is placed on the 7 most significant bits of the byte, the eighth bit can be either '0' or '1'. 483 / 674 Nations Technologies Inc. Tel:+86-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: Debug Mode

    Send buffer is empty. TXDATE Bus error BUSERR I2C error interrupt Lost arbitration (master) ARLOST ERRINTEN Acknowledge fail ACKFAIL 484 / 674 Nations Technologies Inc. Tel:+86-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: I2C Registers

    Reset Value I2C_STS2 PECVAL[7:0] 018h Reserved Reset Value I2C_CLKCTRL CLKCTRL[11:0] 01Ch Reserved Reset Value 020h I2C_TMRISE Reserved TMRISE[5:0] 485 / 674 Nations Technologies Inc. Tel:+86-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: I2C Control Register 1 (I2C_Ctrl1)

    To detect the PEC of the second byte, the I2C_CTRL1.PEC bit must be set after the ACKPOS bit is configured and when the ADDR event is extended. ACKEN Acknowledge enable 486 / 674 Nations Technologies Inc. Tel:+86-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 If I2C_CTRL1.SMBTYPE=1, the host address of SMBus is used. SMBTYPE SMBus type 0: Device 1: Host Reserved Reserved, the reset value must be maintained. 487 / 674 Nations Technologies Inc. Tel:+86-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: I2C Control Register 2 (I2C_Ctrl2)

    I2C_STS1.ADDR F = 1 (Master/Slave) I2C_STS1.ADD10F = 1 (Master) I2C_STS1.STOPF = 1 (Slave) I2C_STS1.BSF = 1 with no I2C_STS1.TXDATE or I2C_STS1.RXDATNE event 488 / 674 Nations Technologies Inc. Tel:+86-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: I2C Own Address Register 1 (I2C_Oaddr1)

    Reserved, the reset value must be maintained. ADDR[9:8] Interface address 9~8 bits of the address. Note: don't care these bits in 7-bit address mode 489 / 674 Nations Technologies Inc. Tel:+86-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: I2C Own Address Register 2 (I2C_Oaddr2)

    Note: If the ARLOST event occurs when processing the ACK pulse, the received byte will not be copied into the data register, so it cannot be read. 490 / 674 Nations Technologies Inc. Tel:+86-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: I2C Status Register 1 (I2C_Sts1)

    DAT register, under-run occurs which leads that the same byte will be send twice. 491 / 674 Nations Technologies Inc. Tel:+86-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 Note: When BSF is set, the RXDATNE bit cannot be cleared when reading data, because the data register is still full. Reserved Reserved, the reset value must be maintained. 492 / 674 Nations Technologies Inc. Tel:+86-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 1' after receiving the ACK of the second byte of the address. In slave mode: 493 / 674 Nations Technologies Inc. Tel:+86-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: I2C Status Register 2 (I2C_Sts2)

    Hardware clears this bit when a stop condition or a repeated start condition is generated, or when I2C_CTRL1.EN=0. 494 / 674 Nations Technologies Inc. Tel:+86-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: I2C Clock Control Register (I2C_Clkctrl)

    1: I2C in fast mode(duty cycle can be configured). DUTY Duty cycle in fast mode 0:Tlow/Thigh = 2; 495 / 674 Nations Technologies Inc. Tel:+86-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: I2C Rise Time Register (I2C_Tmrise)

    If the result is not an integer, write the integer part to TMRISE[5:0] to ensure the t parameter. HIGH 496 / 674 Nations Technologies Inc. Tel:+86-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 497 / 674 Nations Technologies Inc. Tel:+86-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: Universal Synchronous Asynchronous Receiver Transmitter (Usart)

    LIN break frame detection, noise flag/overflow error/frame error in multi-buffer communication 498 / 674 Nations Technologies Inc. Tel:+86-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: Functional Block Diagram

    The data packets of serial communication are transmitted from the sending device to the RX interface of the receiving 499 / 674 Nations Technologies Inc. Tel:+86-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: Usart Frame Format

    Start Stat Stop bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7 Start Idle frame Start Stop Break frame 500 / 674 Nations Technologies Inc. Tel:+86-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: Transmitter

    Receiving in Smartcard mode General USART mode, single-wire mode and modem mode. Transmitting and receiving in Smartcard mode 501 / 674 Nations Technologies Inc. Tel:+86-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 24-4 Configuration Stop Bit

    USART_DAT register will clear USART_STS.TXDE; After writing the last data word in the USART_DAT register, wait for USART_STS.TXC =1, which indicates 502 / 674 Nations Technologies Inc. Tel:+86-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: Single Byte Communication

    The samples at the 3rd, 5th, and 7th bits, and the samples at the 8th, 9th, and 10th bits are all '0' (that is, 6 '0'), then confirm the receipt of the start bit, the USART_STS.RXDNE flag bit is set, and if USART_CTRL1.RXDNEIEN=1, 503 / 674 Nations Technologies Inc. Tel:+86-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: Figure 24-6 Start Bit Detection

    1.5 stop bit (Smartcard mode): when sending in Smartcard mode, the device must check whether the data is sent correctly. So the receiver function block must be activated (USART_CTRL1.RXEN=1) and sample the signal 504 / 674 Nations Technologies Inc. Tel:+86-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: Framing Error

    USART_STS.RXDNE and the hardware will generate an interrupt when the USART_STS.RXDNE flag is set. In multi-buffer communication mode, an interrupt will be generated if the USART_CTRL3.ERRIEN bit 505 / 674 Nations Technologies Inc. Tel:+86-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: Overrun Error

    P��L��  PCLK1 is used for USART2, USART3, up to 27MHz; 506 / 674 Nations Technologies Inc. Tel:+86-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: Table 24-3 Error Calculation When Setting Baud Rate

    0.02% 19.2 175.8125 0.02% 57.6 57.6 29.3125 0.05%% 57.6 78.125 0.05% 115.2 115.384 14.625 0.16% 115.2 29.3125 0.05% 507 / 674 Nations Technologies Inc. Tel:+86-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: Receiver's Tolerance Clock Deviation

    When the parity bit is enabled for transmission, A parity bit is generated, parity check is performed on reception. Table 24-6 Frame format WL bit PCEN bit USART frame 508 / 674 Nations Technologies Inc. Tel:+86-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: Even Parity

    5. Start the channel. 509 / 674 Nations Technologies Inc. Tel:+86-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 24-7 Transmission Using Dma

    5. Start the channel. 510 / 674 Nations Technologies Inc. Tel:+86-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: Hardware Flow Control

    Figure 24-9 hardware flow control between two USART DEVICE 1 DEVICE 2 TX control RX control RX control TX control 511 / 674 Nations Technologies Inc. Tel:+86-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: Figure 24-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. 512 / 674 Nations Technologies Inc. Tel:+86-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 24-11 Cts Flow Controls

    As shown in the Figure 24-12 below, when an idle frame is detected, USART is woken up, and then USART_CTRL1.RCVWU is cleared by hardware. At this time, USART_STS.IDLEF is not set. 513 / 674 Nations Technologies Inc. Tel:+86-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: Figure 24-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. 514 / 674 Nations Technologies Inc. Tel:+86-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: Synchronous Mode

    The transmitter in synchronous mode works the same as in asynchronous mode. Data on the TX pin is sent out synchronously with CK. 515 / 674 Nations Technologies Inc. Tel:+86-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: Figure 24-14 Usart Synchronous Transmission Example

    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) 516 / 674 Nations Technologies Inc. Tel:+86-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: Single-Wire Half-Duplex Mode

    Single-wire half-duplex mode USART supports single-wire half-duplex communication, allowing data to be transmitted in both directions, but only 517 / 674 Nations Technologies Inc. Tel:+86-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: Irda Sir Endec Mode

    For the receiver, the requirement for a valid signal is that the duration of the low level signal must be greater than 2 cycles of the IrDA low power baud rate clock. 518 / 674 Nations Technologies Inc. Tel:+86-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: Lin Mode

    When LIN is sent, the length of the data bits sent can only be 8 bits. By setting USART_CTRL1.SDBRK, a 13-bit '0' will be sent as the break symbol, and insert a stop bit. 519 / 674 Nations Technologies Inc. Tel:+86-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 If a '1' is sampled before the 10th or 11th sample point, the current detection is canceled and the start bit is searched again. 520 / 674 Nations Technologies Inc. Tel:+86-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 24-20 Break Detection In Lin Mode (11-Bit Break Length-The Linbdl Bit Is Set)

    Bit0 Bit1 Bit2 Idle Bit3 Bit4 Bit5 Bit6 Bit7 Bit8 Bit9 Bit10 wait delimiter Sample Sample data LINBDF 521 / 674 Nations Technologies Inc. Tel:+86-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: Smartcard Mode (Iso7816)

    (according to the ISO protocol, the duration of the received NACK can be 1 or 2 baud clock cycles). 522 / 674 Nations Technologies Inc. Tel:+86-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: Figure 24-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. 523 / 674 Nations Technologies Inc. Tel:+86-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: Interrupt Request

    RXDNEIEN Data overrun error detected. ORERR Idle line detected IDLEF IDLEIEN Parity error PEIEN Disconnect flag LINBDF LINBDIEN 524 / 674 Nations Technologies Inc. Tel:+86-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: Mode Support

    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 525 / 674 Nations Technologies Inc. Tel:+86-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: Usart Status Register (Usart_Sts)

    This bit is cleared by software. 0: LIN break character not detected. 1: LIN break character detected. TXDE The Transmit data register empty. 526 / 674 Nations Technologies Inc. Tel:+86-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 Note: this bit will not generate an interrupt because it appears with USART_STS.RXDNE, and the hardware will generate an interrupt when setting the 527 / 674 Nations Technologies Inc. Tel:+86-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: Usart Data Register (Usart_Dat)

    Contains the data sent or received; Software can change the transmitted data by writing these bits, or read the values of these bits to obtain the received data. 528 / 674 Nations Technologies Inc. Tel:+86-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: Usart Baud Rate Register (Usart_Brcf)

    Software can set or clear this bit. 0:USART is disabled. 529 / 674 Nations Technologies Inc. Tel:+86-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 1: the transmitter is enabled. RXEN Receiver enable 0: The receiver is disabled. 1: the receiver is enabled. 530 / 674 Nations Technologies Inc. Tel:+86-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: Usart Control Register 2 Register (Usart_Ctrl2)

    Note: For UART4/5, only one stop bit and two stop bits are valid. CLKEN Clock enable 0:CK pin is disabled 1:CK pin enabled 531 / 674 Nations Technologies Inc. Tel:+86-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: Usart Control Register 3 Register (Usart_Ctrl3)

    If the lower four bits of the received data frame are equal to the ADDR[3:0] value, USART will be awakened. USART control register 3 register (USART_CTRL3) Address offset : 0x14 532 / 674 Nations Technologies Inc. Tel:+86-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 0: Do not send NACK when there is a parity error. 1: send NACK when there is a parity error. Note: This bit cannot be used for UART4/5 533 / 674 Nations Technologies Inc. Tel:+86-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: Usart Guard Time And Prescaler Register (Usart_Gtp)

    (PCLK1/PCLK2) to generate low power consumption frequency. 00000000: reserved-do not write this value. 534 / 674 Nations Technologies Inc. Tel:+86-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 1111: Divide the source clock by 62. In Smartcard mode, PSCV[7:5] is reserved. Note: This bit is invalid for UART4/5. 535 / 674 Nations Technologies Inc. Tel:+86-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: Low Power Universal Asynchronous Receiver Transmitter (Lpuart)

     Start bit detection  Receive buffer non-empty detection  A configurable receive byte  A programmable 4-byte frame 536 / 674 Nations Technologies Inc. Tel:+86-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: Functional Block Diagram

    TX: Serial data output. When sending is enabled, the pin defaults to be high level. The following pins are required in hardware flow control mode: 537 / 674 Nations Technologies Inc. Tel:+86-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: Lpuart Frame Format

    When the Transmit Enable bit (LPUART_CTRL.TXEN) is set and there is data in the buffer, the transmitter sends 8- bit data words. The data in the shift register is output on the TX pin. 538 / 674 Nations Technologies Inc. Tel:+86-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 After the last data byte is written to the LPUART_DAT register, you must wait for LPUART_STS.TXC=1 before shutting down the LPUART module or setting the microcontroller into low-power mode. 539 / 674 Nations Technologies Inc. Tel:+86-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: Receiver

    The steps for LPUART to receive data are as follows: Configure baud rate, parity check, wake up event/enable, sampling mode, DMA, flow control, etc. 540 / 674 Nations Technologies Inc. Tel:+86-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 Noise errors use an over-sampling technique (if the LPUART_CTRL.SMPCNT bit is 0, that is, the number of samples is 3) to recover data by distinguishing valid input data from noise. 541 / 674 Nations Technologies Inc. Tel:+86-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: Fractional Baud Rate Generation

    Here the �� is the clock for LPUART (the clock source of LPUART can be HSI, LSE, SYSCLK, or PCLK1). 542 / 674 Nations Technologies Inc. Tel:+86-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 If the MCU is powered by 3.3V, the LPUART baud rate should be within 1Mbps, and if the MCU is powered by 1.8V, the LPUART baud rate should be within 115200bps. 543 / 674 Nations Technologies Inc. Tel:+86-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: Parity Control

    LPUART_STS.TXC flag bit is asserted by the hardware to indicate that the transfer is completed. The software needs wait for LPUART_STS.TXC=1. 544 / 674 Nations Technologies Inc. Tel:+86-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: Figure 25-5 Sending Using Dma

    When completing the transfer specified by the DMA controller, the DMA controller generates an interrupt on the DMA channel's interrupt vector. 545 / 674 Nations Technologies Inc. Tel:+86-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: Hardware Flow Control

    RTS flow control If RTS flow control is enabled (LPUART_CTRL.RTSEN=1), the RTS will be driven high (active) when the RTS 546 / 674 Nations Technologies Inc. Tel:+86-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: Figure 25-8 Rts Flow Control

    Transmit delay Transmit Data 3 Start Start Stop Stop Data 2 TX line Data 1 Idle Data 3 547 / 674 Nations Technologies Inc. Tel:+86-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: Low Power Wake Up

    LPUART registers LPUART register overview Table 25-4 LPUART register overview Offset Register LPUART_STS 000h Reserved Reset Value 548 / 674 Nations Technologies Inc. Tel:+86-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: Lpuart Status Register (Lpuart_Sts)

    Once the sender requests to send data, it is ready to receive it. 0: CTS line is reset. 1: CTS line is set. FIFO_NE FIFO non-empty flag. 549 / 674 Nations Technologies Inc. Tel:+86-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: Lpuart Interrupt Enable Register (Lpuart_Inten)

    0: Disables buffer half-full interrupt 1: Enables buffer half-full interrupt FOFO_FUIE Receive buffer full interrupt enable 0: Disables buffer full interrupt 550 / 674 Nations Technologies Inc. Tel:+86-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: Lpuart Control Register (Lpuart_Ctrl)

    1: Enables CTS hardware flow control RTS_THSEL[1:0] RTS threshold selection 00: When FIFO is half full, RTS is effective (pull up) 551 / 674 Nations Technologies Inc. Tel:+86-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: Lpuart Baud Rate Configuration Register 1 (Lpuart_Brcfg1)

    In this case, the integer part of the LPUARTDIV is 3 and the decimal part is 0.4133.LPUART_BRCFG1 = 3.LPUART_BRCFG2 will be used for baud rate 552 / 674 Nations Technologies Inc. Tel:+86-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: Lpuart Data Register (Lpuart_Dat)

    2 with baud rate. For details on how to configure register 2, refer to the section "Fractional baud rate generation". LPUART wake up data register (LPUART_WUDAT) Address offset: 0x18 553 / 674 Nations Technologies Inc. Tel:+86-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 LPUART_CTRL.WUSEL[1:0] = 11 is used to wake up frame matching. In this case, all 4 bytes are valid 554 / 674 Nations Technologies Inc. Tel:+86-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: Serial Peripheral Interface/Inter-Ic Sound (Spi/I2S)

     Steady state clock polarity programmable.  The data direction is always MSB first.  Supports DMA function. 555 / 674 Nations Technologies Inc. Tel:+86-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: Spi Function Description

    SPI works in the master mode. Conversely, SPI works in the slave mode. Users can use a standard I/O pin of the master device to control the NSS pin of the slave device. 556 / 674 Nations Technologies Inc. Tel:+86-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: Figure 26-2 Selective Management Of Hardware/Software

    Figure 26-2 Selective management of hardware/software The following figure is an example of the interconnection of single master and single slave devices 557 / 674 Nations Technologies Inc. Tel:+86-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: Figure 26-3 Master And Slave Applications

    Figure 26-4 is the combination timing of four CLKPHA and CLKPOL bits transmitted by SPI when the SPI_CTRL1.LSBFF=0. 558 / 674 Nations Technologies Inc. Tel:+86-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: Data Format

    SPI_CTRL1.LSBFF bit, the data bits follow the MSB or LSB order is serially shifted to the 559 / 674 Nations Technologies Inc. Tel:+86-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: Schematic Diagram Of The Change Of Te/Rne/Busy When The Host Is Continuously Transmitting In Full Duplex Mode

    Set SPI_CTRL1.SPIEN = 1, enable SPI module. Write the first data to be sent into SPI_DAT register (this operation will clear SPI_STS.TE bit). 560 / 674 Nations Technologies Inc. Tel:+86-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: Figure 26-6 Schematic Diagram Of Te/Busy Change When 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). 561 / 674 Nations Technologies Inc. Tel:+86-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: Figure 26-7 Schematic Diagram Of Rne Change When Continuous Transmission Occurs In Receive-Only Mode (Bidirmode = 0 And Ronly = 1)

    Figure 26-8 Schematic diagram of the change of TE/RNE/BUSY when the slave is continuously transmitting in full duplex 562 / 674 Nations Technologies Inc. Tel:+86-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: Schematic Diagram Of Te/Busy Change During Continuous Transmission In Slave Unidirectional Transmit-Only Mode

    MOSI pin. The received data bits are sequentially and consecutively shifted serially into an shift register and then 563 / 674 Nations Technologies Inc. Tel:+86-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 SPI_DAT register before the current data frame sending is completed, the continuous sending function can be achieved. 564 / 674 Nations Technologies Inc. Tel:+86-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: Status Flag

    SPI_DAT register. When the send buffer is not empty, the hardware will clear this flag to 0. Receive buffer non-empty flag bit (RNE) 565 / 674 Nations Technologies Inc. Tel:+86-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: Disabling The Spi

    3. Wait for the last RNE (SPI_STS.RNE) to be set before entering shutdown mode (or turning off the SPI module clock). 566 / 674 Nations Technologies Inc. Tel:+86-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: Spi Communication Using Dma

    (SPI_STS.TE) bit to be set to 1, and wait for the BUSY flag (SPI_STS.BUSY) bit to be set to 0. 567 / 674 Nations Technologies Inc. Tel:+86-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: Crc Calculation

    8-bit data frame format adopts CRC8, and the 16-bit data frame format adopts CRC16. The polynomial used in 568 / 674 Nations Technologies Inc. Tel:+86-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: Error Flag

    (SPI_CTRL2.ERRINTEN = 1). All received data is lost, and the SPI_DAT register retains only previously unread data. 569 / 674 Nations Technologies Inc. Tel:+86-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: Spi Interrupt

    Receive buffer non empty flag RNEINTEN Master mode failure event MODERR Overflow error OVER ERRINTEN CRC error flag CRCERR 570 / 674 Nations Technologies Inc. Tel:+86-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: I2S Function Description

    WS: Channel selection (shared with NSS pin), used as data control signal output in master mode, and used as input in slave mode; 571 / 674 Nations Technologies Inc. Tel:+86-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: Supported Audio Protocols

    (MSB) is sent and will change on the falling edge of the clock signal. 572 / 674 Nations Technologies Inc. Tel:+86-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 26-14 I 2 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). 573 / 674 Nations Technologies Inc. Tel:+86-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 26-16 I 2 S Philips Protocol Standard Waveform (16-Bit Extended To 32-Bit Packet Frame, Clkpol = 0)

    (MSB) are generated simultaneously. The standard data receiving and sending processing mode is the same as I S Philips standard. 574 / 674 Nations Technologies Inc. Tel:+86-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 26-17 The Msb Is Aligned With 16-Bit Or 32-Bit Full Precision, Clkpol = 0

    Figure 26-18 MSB aligns 24-bit data, CLKPOL = 0 Send Receive 8-bit remaining 0 forced 24-bit data Right channel Left channel 32-bit 575 / 674 Nations Technologies Inc. Tel:+86-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: Figure 26-19 Msb-Aligned 16-Bit Data Is Extended To 32-Bit Packet Frame, Clkpol = 0

    Figure 26-20 LSB alignment 16-bit or 32-bit full precision, CLKPOL = 0 Send Receive Left channel (16-bit or 32-bit) Right channel 576 / 674 Nations Technologies Inc. Tel:+86-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: Figure 26-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. 577 / 674 Nations Technologies Inc. Tel:+86-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 26-23 Pcm Standard Waveform (16 Bits)

    Figure 26-24 PCM standard waveform (16-bit extended to 32-bit packet frame) WS short frame WS long frame 13-bit 16-bit 578 / 674 Nations Technologies Inc. Tel:+86-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: Clock Generator

    ���� ������ [ ( 32 × 2 ) × ( ( 2 × �������� ) + ������_��������) × 4] ⁄ �� 579 / 674 Nations Technologies Inc. Tel:+86-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: I2S Transmission And Reception Sequence

    SPI_I2SCFG.CHBITS bit; 4. When user needs to enable interrupt or DMA, the configuration operation is the same as SPI; 580 / 674 Nations Technologies Inc. Tel:+86-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 SPI_CTRL2.ERRINTEN bit is set to 1, an interrupt is generated to indicate that an error has occurred. The channel corresponding to the currently transmitted data can be confirmed by the SPI_STS.CHSIDE bit. When 581 / 674 Nations Technologies Inc. Tel:+86-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: Status Flag

    When the receive buffer is not empty, this flag is set to 1, indicating that valid data has been received into the receive 582 / 674 Nations Technologies Inc. Tel:+86-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: Error Flag

    Reading the SPI_STS register to clears the SPI_STS.UNDER bit. S interrupt The following table lists all I S interrupts. 583 / 674 Nations Technologies Inc. Tel:+86-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: Dma Function

    Reset Value MODCFG STDSEL TDATLEN SPI_I2SCFG [1:0] [1:0] [1:0] 01Ch Reserved Reset Value SPI_I2SPREDIV LDIV[7:0] 020h Reserved Reset Value 584 / 674 Nations Technologies Inc. Tel:+86-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: Spi Control Register 1 (Spi_Ctrl1) (Not Used In I2S Mode)

    1 by the accessed slave device, and only the accessed slave device can output, so as to avoid data line conflicts. 585 / 674 Nations Technologies Inc. Tel:+86-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 Note: This bit cannot be changed during communication. Note: Not used in I S mode. CLKPOL Clock polarity 586 / 674 Nations Technologies Inc. Tel:+86-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: Spi Control Register 2 (Spi_Ctrl2)

    When this bit is set, a DMA request is issued as soon as the TE flag(SPI_STS.TE) is set 587 / 674 Nations Technologies Inc. Tel:+86-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: Spi Status Register (Spi_Sts)

    Note: this bit is set by hardware and cleared by software by writing 0. Note: Not used in I S mode. 588 / 674 Nations Technologies Inc. Tel:+86-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: Spi Data Register (Spi_Dat)

    For 16-bit data, the buffer is 16-bit, and the entire data register is used when sending and receiving, that is, SPI_DAT[15:0]. SPI CRC polynomial register (SPI_CRCPOLY) (not used in I S mode) Address: 0x10 589 / 674 Nations Technologies Inc. Tel:+86-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: Spi Rx Crc Register (Spi_Crcrdat) (Not Used In I2S Mode)

    This register is reset when ‘1’ is written to the SPI_CTRL1.CRCEN bit. The CRC calculation uses the polynomial in SPI_CRCPOLY. 590 / 674 Nations Technologies Inc. Tel:+86-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: Spi_I2S Configuration Register(Spi_I2Scfg

    Note: This bit is only meaningful when SPI_I2SCFG.STDSEL = 11 (used by the PCM standard). Note: not used in SPI mode. Reserved Reserved, the reset value must be maintained. 591 / 674 Nations Technologies Inc. Tel:+86-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: Spi_I2S Prescaler Register (Spi_I2Sprediv)

    Reserved, the reset value must be maintained. MCLKOEN Master clock output enable 0: Disable master clock output. 1: Enable master clock output. 592 / 674 Nations Technologies Inc. Tel:+86-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 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. 593 / 674 Nations Technologies Inc. Tel:+86-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: Controller Area Network (Can)

    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 594 / 674 Nations Technologies Inc. Tel:+86-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: Can Module

    CANTX pin is disabled. CAN is in normal mode when CAN_MSTS.INIAK and CAN_MSTS.SLPAK bits are both '0', and it must 595 / 674 Nations Technologies Inc. Tel:+86-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: Normal Mode

    CAN bus activity is detected, regardless of whether the hardware is enabled to automatically wake up CAN. 596 / 674 Nations Technologies Inc. Tel:+86-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: Send Mailbox

    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. 597 / 674 Nations Technologies Inc. Tel:+86-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: Can Test Mode

    To enter loopback mode, the CAN_BTIM.SLM bit should be cleared and the CAN_BTIM.LBM bit should be set. 598 / 674 Nations Technologies Inc. Tel:+86-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: Figure 27-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. 599 / 674 Nations Technologies Inc. Tel:+86-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: Figure 27-5 Silent Mode

    To enter loopback silence mode, both the CAN_BTIM.SLM bit and the CAN_BTIM.LBM bit should be set. Figure 27-6 Loopback silent mode CAN-CTRL transceiver CAN_Bus 600 / 674 Nations Technologies Inc. Tel:+86-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: Can Debugging Mode

    When more than one sending mailbox is registered, the sending order is determined by the identifier of the message in the mailbox. 601 / 674 Nations Technologies Inc. Tel:+86-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: Cancel Sending

    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. 602 / 674 Nations Technologies Inc. Tel:+86-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: Receiving Management

    Please refer to 27.4.5 Section: identifier filtering. 603 / 674 Nations Technologies Inc. Tel:+86-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: Figure 27-8 Receive Fifo Status

    (the CAN_INTE.FFITE bit is set), a FIFO full interrupt request will be generated. 604 / 674 Nations Technologies Inc. Tel:+86-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: Identifier Filtering

    And the filter group should be set to work in identifier list mode in order to filter out an identifier. 605 / 674 Nations Technologies Inc. Tel:+86-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: Mask Mode

    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. 606 / 674 Nations Technologies Inc. Tel:+86-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: Table 27-1 Examples Of Filter Numbers

    Point to FIFOx Filter group Filter mode FIFO1 filter number 32 bit list mode FIFO1 16 bit list mode 2/3/4/5 607 / 674 Nations Technologies Inc. Tel:+86-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: Message Storage

    A mailbox contains all information related to a message: identifier, data, control, status and time stamp information. The mailbox is the interface between software and hardware to transfer messages. 608 / 674 Nations Technologies Inc. Tel:+86-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: Bit Time Characteristic

    1 to 8 time units, but it can also be automatically shortened to compensate for the negative drift of phase. 609 / 674 Nations Technologies Inc. Tel:+86-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: Figure 27-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 610 / 674 Nations Technologies Inc. Tel:+86-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: Figure 27-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 611 / 674 Nations Technologies Inc. Tel:+86-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: Can Interrupt

    When FIFO1 becomes full, and the CAN_RFF1.FFULL1 bit is set. When FIFO1 overruns, and the CAN_ RFF1.FFOVR1 bit is set. 612 / 674 Nations Technologies Inc. Tel:+86-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: Error Management

    In initialization mode, CAN will not monitor the status of CAN RX pin, so the recovery process cannot be completed. 613 / 674 Nations Technologies Inc. Tel:+86-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: Can Configuration Flow

    CAN_TMIx.TXRQ(x = 0~2) bit must be written to ‘1’ after this mailbox is programed. 614 / 674 Nations Technologies Inc. Tel:+86-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: Can Registers

    In addition, only when the whole filter is set to the initialization mode (that is, CAN_FMC.FINITM=1), the 615 / 674 Nations Technologies Inc. Tel:+86-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: 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 616 / 674 Nations Technologies Inc. Tel:+86-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 DATA5[7:0] DATA4[7:0] 1BCh Reset Value CAN_RMI1 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 617 / 674 Nations Technologies Inc. Tel:+86-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 220h 224h 23Fh CAN_F0B1 FBC[31:0] 240h Reset Value CAN_F0B2 FBC[31:0] 244h Reset Value CAN_F1B1 FBC[31:0] 248h Reset Value 618 / 674 Nations Technologies Inc. Tel:+86-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: Can Control And Status Register

    Reserved, the reset value must be maintained. TTCM Time triggered communication mode 0: disable time triggered communication mode; 619 / 674 Nations Technologies Inc. Tel:+86-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 The software can request the CAN to enter the sleep mode by setting this bit, and once the current CAN activity (sending or receiving messages) ends, the CAN will enter the sleep mode. 620 / 674 Nations Technologies Inc. Tel:+86-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 When this bit is set, if the CAN_INTE.SLKITE bit is set, a state change interrupt will be generated. 621 / 674 Nations Technologies Inc. Tel:+86-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 11 consecutive recessive bits on the RX pin of CAN. CAN transmit status register (CAN_TSTS) Address offset: 0x08 Reset value: 0x1C00 0000 622 / 674 Nations Technologies Inc. Tel:+86-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 1: The last sending attempt was successful. When the sending request of mailbox 2 is successfully completed, hardware sets 623 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 648 Arbitration lost for mailbox 0 When the mailbox 0 fails to send due to the loss of arbitration, set this bit 624 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 649 When there are 3 messages in FIFO 0, the hardware sets this bit'. This bit is cleared by software. Reserved Reserved, the reset value must be maintained. 625 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 650 CAN_RFF1.RFFOM1 bit, CAN_RFF1.FFMP1 is decremented by 1 until it is 0. CAN interrupt enable register (CAN_INTE) Address offset: 0x14 626 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 651 1: When CAN_RFF1.FFOVR bit is set, an interrupt is generated. FFITE1 FIFO 1 full interrupt enable 0: When CAN_RFF1.FFULL bit is set, no interrupt is generated; 627 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 652 CAN protocol. 15:7 Reserved Reserved, the reset value must be maintained. LEC[2:0] The Last error code. 628 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 653 Reset value: 0x0123 0000 Notes: This register CAN only be accessed by software when CAN is in initialization mode. 629 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 654: Can Mailbox Register

    Notes: 1.This register is write-protected when the mailbox to which it belongs is waiting to be sent; 2.This register implements the send request control function (bit 0)-the reset value is 0. 630 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 655 CAN_TMDTx.MTIM[7:0] is the seventh byte and CAN_TMDTx.MTIM[15:8] is the eighth byte. They replace the data written in CAN_TMDHx[31:16] 631 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 656 When the mailbox is not empty, all bits in this register are write protected. Address offset: 0x18c, 0x19c, 0x1ac Reset value: undefined 632 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 657 Reserved, the reset value must be maintained. Receive FIFO mailbox data length and time stamp register(CAN_RMDTx)( x=0..1) Address offset: 0x1B4, 0x1C4 Reset value: undefined 633 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 658 Data byte 0 of the message. Notes: the message contains 0 to 8 bytes of data, starting from byte 0. 634 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 659: Can Filter Register

    Initialization mode settings for all filter groups. 0: The filter group works in normal mode; 1: The filter group works in initialization mode. 635 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 660 1: The filter bit width is a single 32-bit. CAN filter FIFO assignment register (CAN_FFA1) Address offset: 0x214 Reset value: 0x0000 0000 636 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 661 Only when the corresponding CAN_FA1.FACx bit is cleared or the CAN_FMC.FINIT bit is set, the corresponding filter register can be modified. 637 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 662 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 27-4. 638 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 663: Universal Serial Bus Full-Speed Device Interface (Usb_Fs_Device)

     Support USB suspend/resume operation  Frame lock clock pulse generation Figure 28-1 is a functional block diagram of a USB peripheral. 639 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 664: Clock Configuration

    SRAM, so the maximum endpoint packet buffer that can be used by each endpoint is less than 512 bytes. Note: 640 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 665: Access Packet Buffer Memory

    USB module accesses the Packet Buffer Memory. 641 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 666: Buffer Description Table

    0 only receives data up to the endpoint 0 packet receive buffer size, other redundant data is discarded and a buffer overflow exception occurs. 642 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 667: Double-Buffered Endpoints

    DATTOG and SW_BUF. DATTOG indicates the buffer currently being used by the USB module, 643 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 668: Table 28-1 Dattog And Sw_Buf Definitions

    DATTOG = 0. If the application has not finished processing the data in buffer0 corresponding to ADDR3_RX_0/CNT3_RX_0, the software will not toggle SW_BUF (SW_BUF = 0). If there is 644 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 669: Figure 28-4 Double Buffered Bulk Endpoint Example

    The Tx buffer of endpoint 3 (buffer0) DATTOG=0 SW_BUF=1 Usb bus The Rx buffer of endpoint 3 Application (buffer1) 512 bytes packet buffer 645 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 670: Usb Transfer

    ADDR register is used as a pointer to the endpoint data packet receiving buffer corresponding to the endpoint, and 646 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 671: Control Transfer

    Data stage, whether the Data stage is IN transmission or OUT transmission. As shown in Figure 28-5, take control write transfer as an example. Before enabling subsequent Data 647 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 672 SETUP token packet, and will not reply any handshake packet to the host, forcing the host to send the SETUP token packet again. 648 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 673: Figure 28-5 Control Transfer

    USB host will allocate the required bandwidth for the endpoint in 649 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 674: Usb Events And Interrupts

    USB transceiver. The software operation process is as follows:  Enable the clock signal of the USB module 650 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 675: Table 28-4 Resume Event Detection

    Table 28-4 Resume event detection [USB_FN.RXDP_STS, USB_FN.RXDM_STS] Wake-up event Software operation Root reset None 651 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 676: Usb Interrupt

    USB registers The peripheral registers can be accessed by half-words (16-bit) or words (32-bit). USB base address: 0x4000 5C00 652 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 677: Usb Register Overview

    Reset Value USB_CTRL 040h Reserved Reset Value USB_STS EP_ID[3:0] 044h Reserved Reset Value USB_FN FN[10:0] 048h Reserved Reset Value 653 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 678: Usb Endpoint N Register (Usb_Epn), N=[0

    STS_RX[1:0] Receive status This bit indicates the current state of the endpoint, Table 28-6 lists the available states 654 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 679 Double-buffered endpoint, this bit is used to implement the flow control mechanism for double-buffered endpoints. Isochronous endpoint, this bit is used for double buffer exchange. Note: 655 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 680: Table 28-6 Receive Status Code

    STALL: the status of the handshake packet is STALL NAK: the status of the handshake packet is NAK VALID: endpoints can be used to send 656 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 681: Usb Control Register (Usb_Ctrl)

    1: Enable start of frame interrupt, when USB_STS.SOF = 1, an interrupt will be generated. ESOFM Expected start of frame interrupt enable 0: Disable the expected start of frame interrupt 657 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 682: Usb Interrupt Status Register (Usb_Sts)

    When USB_CTRL.FRST = 1, the USB module will remain in reset state until software clears this bit. USB interrupt status register (USB_STS) Address offset: 0x44 658 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 683 Software can read and write this bit, but only writing 0 is valid, and writing 1 is invalid. 、 In suspend mode, the USB hardware will not detect the suspend signal until the 659 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 684 Isochronous endpoints and double-buffered bulk endpoints have high priority, other endpoints have low 660 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 685: Usb Frame Number Register (Usb_Fn)

    Hardware increments this bit every time the USB module receives a PID SOF token packet. USB device address register (USB_ADDR) Address offset: 0x4C Reset value: 0x0000 0000 661 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 686: Usb Packet Buffer Description Table Address Register (Usb_Buftab)

    32 bits, the data packet buffer memory addresses use 32-bit aligned addresses, not the addresses used by the USB_BUFTAB register and the buffer description table. 662 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 687: Send Buffer Address Register N (Usb_Addrn_Tx)

    Address offset: [USB_ BUFTAB] + n× 16 + 8 USB local address: [USB_ BUFTAB] + n× 8 + 4 663 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 688: Receive Data Byte Number Register N (Usb_Cntn_Rx)

    Table 28-8 Endpoint packet receive buffer size definition NUM_BLK[4:0] BLSIZE = 0 BLSIZE = 1 00000 Not allowed 32 bytes 00001 2 bytes 64 bytes 664 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 689 The size of the endpoint packet receive buffer is defined during the device enumeration process and is defined by the wMaxPacketSize field of the standard endpoint descriptor in the USB 2.0 protocol specification. 665 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 690: Debug Support (Dbg)

    -M4F core hardware debugging module can provide the following debugging functions:  SWJ-DP: serial /JTAG debug port  AHP-AP: AHB access port 666 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 691: Jtag/Swd Function

    See the following Table for the pin allocation of JTAG debugging interface and SWD debugging interface (SWDIO is alternated with JTMS, SWCLK is alternated with JTCK): 667 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 692: Mcu Debug Function

    The DBG_CTRL.STDBY bit needs to be configured to start the internal RC oscillator to provide the clock for HCLK and FCLK. 668 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 693: Peripherals Debug Support

    Only 32-bit access is supported, fixed values cannot be modified. Bit field Name Description 31:28 SRAM[3:0] SRAM capacity indication bit (capacity: (N+1)*8K). 669 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 694: Debug Control Register (Dbg_Ctrl)

    Set or cleared by software. 0: TIMx running state has no effect. 1: Pause the counter of TIMx. 670 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 695 1: (FCLK on, HCLK on) In DBG_SLEEP mode, both FCLK and HCLK clocks are provided by the previously configured system clock. 671 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 696: Unique Device Serial Number (Uid)

    Secure Bootloader with security function. UCID is 128 bits and complies with the definition of the Nations Technologies chip serial number. It contains information about chip production and version.
  • Page 697: 31 Version History

    Add Clock Tree Figure note: When PLL is selected as system clock source, PLL minimum clock output is 32MHz 673 / 674 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 698: 32 Notice

    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