Nations N32G032 Series User Manual

32-bit arm cortex-m0
Table of Contents

Advertisement

Quick Links

N32G032 series
®
32-bit ARM Cortex
-M0 microcontroller
User manual V2.4.0

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Summary of Contents for Nations N32G032 Series

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

    4 Reset and clock control (RCC) ............................ 74 4.1 Reset Control Unit..............................74 4.1.1 Power reset ..............................74 2 / 620 Nations Technologies Inc. Tel:+86-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 5.2.6 I/O configuration of peripherals ........................131 5.2.7 GPIO Locking mechanism ........................... 133 5.3 GPIO Registers ................................ 134 3 / 620 Nations Technologies Inc. Tel:+86-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 RTC Timestamp trigger source selection register (EXTI_TS_SEL) ............158 7 DMA controller ............................... 159 7.1 Introduction ................................159 7.2 Main features ................................159 4 / 620 Nations Technologies Inc. Tel:+86-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 LRC result register (CRC_LRC) ........................179 9 Advanced-control timers (TIM1 and TIM8) ......................... 180 9.1 TIM1 and TIM8 introduction ............................. 180 5 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 6 Capture/compare register 3 (TIMx_CCDAT3) .................... 243 9.4.18 Capture/compare register 4 (TIMx_CCDAT4) .................... 243 9.4.19 Break and Dead-time registers (TIMx_BKDT) ................... 244 6 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 7 Capture/compare register 1 (TIMx_CCDAT1) .................... 297 10.4.15 Capture/compare register 2 (TIMx_CCDAT2) .................... 298 10.4.16 Capture/compare register 3 (TIMx_CCDAT3) .................... 298 7 / 620 Nations Technologies Inc. Tel:+86-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 12.4 LPTIM registers ..............................325 12.4.1 LPTIM register overview......................... 325 12.4.2 LPTIM interrupt and status register (LPTIM_INTSTS) ................326 8 / 620 Nations Technologies Inc. Tel:+86-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 15.2 Main features ................................. 345 15.3 Function Description ............................... 346 15.3.1 ADC clock ..............................348 15.3.2 ADC switch control ........................... 349 9 / 620 Nations Technologies Inc. Tel:+86-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 16.4 COMP working mode ............................376 16.4.1 Window mode ............................376 16.4.2 Independent comparator .......................... 376 16.5 Comparator interconnection ..........................376 10 / 620 Nations Technologies Inc. Tel:+86-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) ..................418 17.6.10 I2C Rise time register (I2C_TMRISE) ....................419 18 Universal synchronous asynchronous receiver transmitter (USART)..............421 11 / 620 Nations Technologies Inc. Tel:+86-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 19.4.6 DMA application ............................. 471 19.4.7 Hardware flow control ..........................473 19.4.8 Low power wake up ..........................475 12 / 620 Nations Technologies Inc. Tel:+86-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 S mode) ............. 517 20.5.8 SPI TX CRC register(SPI_ CRCTDAT) ..................... 517 20.5.9 SPI_ I S configuration register(SPI_I2SCFG) ................... 518 13 / 620 Nations Technologies Inc. Tel:+86-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 RTC Timestamp Sub-second Register (RTC_TSSS) ................545 21.4.16 RTC Calibration Register (RTC_CALIB)....................545 21.4.17 RTC Tamper Configuration Register(RTC_TMPCFG) ..............546 14 / 620 Nations Technologies Inc. Tel:+86-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 SQRT square root register (SQRT_ROOT) ..................... 565 25 Controller area network (CAN) ..........................566 25.1 Introduction to CAN .............................. 566 15 / 620 Nations Technologies Inc. Tel:+86-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 28.3 UCID register ................................. 617 28.4 DBGMCU_ID register ............................617 29 Version history ..............................619 30 Notice ................................... 620 16 / 620 Nations Technologies Inc. Tel:+86-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 17 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 18 Table 5-17 I2C2 alternate function I/O remapping ..................125 Table 5-18 SPI1/I2S1 alternate function I/O remapping ................. 126 18 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 19 Table 5-46 COMP ............................133 Table 5-47 BEEPER ............................133 Table 5-48 Other .............................. 133 Table 5-49 GPIO register overview ......................... 134 19 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 20 Table 15-6 ADC is used for external triggering of injection channels ............. 355 Table 15-7 ADC interrupt ..........................358 20 / 620 Nations Technologies Inc. Tel:+86-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 Table 25-1 Examples of filter numbers ......................579 Table 25-2 Send mailbox register list ......................581 Table 25-3 Receive mailbox register list ......................581 21 / 620 Nations Technologies Inc. Tel:+86-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 Table 25-4 CAN register overview ........................588 Table 27-1 Debug port pin ..........................616 Table 28-1 DBGMCU_ID bit description ......................617 22 / 620 Nations Technologies Inc. Tel:+86-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 9-9 Repeat count sequence diagram in up-counting mode ..............190 Figure 9-10 Repeat count sequence diagram in center-aligned mode ............. 190 23 / 620 Nations Technologies Inc. Tel:+86-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 10-5 Timing diagram of the down-counting, internal clock divided factor = 2/N ........ 254 Figure 10-6 Timing diagram of the Center-aligned, internal clock divided factor =2/N ......... 255 24 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 25 Figure 12-3 LPTIM output waveform, Continuous counting mode configuration .......... 317 Figure 12-4 PTIM output waveform, single counting mode configuration ............. 318 25 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 26 Figure 18-9 Reception using DMA ......................... 437 Figure 18-10 hardware flow control between two USART ................438 Figure 18-11 RTS flow control ........................438 26 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 27 Figure 20-7 Schematic diagram of RNE change when continuous transmission occurs in receive-only mode (BIDIRMODE = 0 and RONLY = 1) ....................... 489 27 / 620 Nations Technologies Inc. Tel:+86-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 Figure 25-2 CAN working mode ........................569 Figure 25-3 Single CAN block diagram ......................570 Figure 25-4 loopback mode ..........................571 28 / 620 Nations Technologies Inc. Tel:+86-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 Figure 25-14 CAN error state diagram ......................585 Figure 27-1 N32G032 level and Cortex®-M0 level debugging block diagram ..........615 29 / 620 Nations Technologies Inc. Tel:+86-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: Abbreviations In The Text

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

    AHB to APB bridge (AHB2APBx,x=1,2), which connects all APB devices These are connected to each other through a multi-level AHB bus architecture, as shown in Figure 2-1: 31 / 620 Nations Technologies Inc. Tel:+86-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: Figure 2-1 Bus Architecture

    -M0 kernel Sbus to bus matrix, used for instruction pre-fetch, data load (constant load and debug access) and AHB/APB peripheral access. 32 / 620 Nations Technologies Inc. Tel:+86-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: Bus Address Mapping

    The address mapping includes all AHB and APB peripherals: AHB peripherals, APB1 peripherals, APB2 peripherals, Flash, SRAM, System Memory, etc. The specific mapping is as follows: 33 / 620 Nations Technologies Inc. Tel:+86-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: Table 2-1 List Of Peripheral Register Addresses

    Address range Peripherals 0x4002_8400 – 0x5FFF_FFFF Reserved 0x4002_8000 – 0x4002_83FF HDIV 0x4002_3400 – 0x4002_7FFF Reserved 0x4002_3000 – 0x4002_33FF 34 / 620 Nations Technologies Inc. Tel:+86-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 Reserved APB1 0x4000_5800 – 0x4000_5BFF I2C2 0x4000_5400 – 0x4000_57FF I2C1 0x4000_5000 – 0x4000_53FF UART5 0x4000_4C00 – 0x4000_4FFF LPUART2 35 / 620 Nations Technologies Inc. Tel:+86-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: Boot Management

     The built-in SRAM is mapped to boot space (0x0000_0000);  The built-in SRAM is accessible in two address areas, 0x0000_0000 or 0x2000_0000; 36 / 620 Nations Technologies Inc. Tel:+86-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: Memory System

     The Option Byte area is 0.5KB, containing 1 Page, also known as Option Byte, and the effective space is 37 / 620 Nations Technologies Inc. Tel:+86-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: Table 2-3 Flash Bus Address List

    That is, when writing or 38 / 620 Nations Technologies Inc. Tel:+86-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 Wait for the FLASH_ STS.BUSY bit to change to' 0';  Read out the erased page and verify it. Mass Erase 39 / 620 Nations Technologies Inc. Tel:+86-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  Set the FLASH_CTRL.START bit to '1';  Wait for the FLASH_ STS.BUSY bit to change to '0'; 40 / 620 Nations Technologies Inc. Tel:+86-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: Option Byte

    0xFF. When the option byte and its complement are both 0xFF (the state after erasing), the above verification steps are skipped and verification is not required. 41 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 42: Table 2-4 Option Byte List

    Write protection option byte: WRP0 ~ 1, which can be written through the register FLASH _WRP [15:0] query 42 / 620 Nations Technologies Inc. Tel:+86-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: Write Protect

     The write protection property of each page can be configured for programming and erasing;  L1 level: 43 / 620 Nations Technologies Inc. Tel:+86-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  When executed in SWD debug mode or after booting from internal SRAM, all Pages do not allow 44 / 620 Nations Technologies Inc. Tel:+86-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: Table 2-6 Flash Read-Write-Erase

    Allow Allow Allow Allow area mass erase Read-Write- Read-Write- Read-Write- Flash option byte area Read-Write-Erase Erase Erase Erase 45 / 620 Nations Technologies Inc. Tel:+86-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 Read and Read and SRAM (All) Read and write write write Boot mode SRAM protect Changing a Protection 46 / 620 Nations Technologies Inc. Tel:+86-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 L2 protection level, cannot boot from SRAM level SWD is banned. After 4KB of flash 47 / 620 Nations Technologies Inc. Tel:+86-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 After 4KB of flash Read-write- Read-write- Prohibit Read-write-erase is automatically erased. main memory area erase erase 48 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 49: Sram

    SRAM cannot hold data in PD mode; other operating modes (Run, Lprun, Sleep, and Stop) Data retention normally. The main features are as follows:  The maximum total capacity is 16KB 49 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 50: Flash Register Description

    2.2.3.2 FLASH control and status registers See for abbreviations in register descriptions 1.1 section. 2.2.3.2.1 FLASH access control register (FLASH_AC) Address offset: 0x00 50 / 620 Nations Technologies Inc. Tel:+86-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 Used to unlock the FLASH_CTRL.LOCK bit. 2.2.3.2.3 FLASH OPTKEY register (FLASH_OPTKEY) Address offset: 0x08 Reset value: 0xXXXX XXXX 51 / 620 Nations Technologies Inc. Tel:+86-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 This bit is cleared to '0' at the end of the operation or when an error occurs. 52 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 53 After an unsuccessful unlock operation, this bit cannot be changed until the next system reset. START Start 53 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 54 Note: When the FLASH_STS.BUSY bit is '1', this register cannot be written. 2.2.3.2.7 FLASH option byte register (FLASH_OB) Address offset: 0x1C Reset value: 0x03FF FFFC 54 / 620 Nations Technologies Inc. Tel:+86-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 0: The L1 level of read protection is disabled. 1: L1 read protection is enabled. Note: This bit is read-only. OBERR Option byte error 55 / 620 Nations Technologies Inc. Tel:+86-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 Reserved,the reset value must be maintained After writing a word to a 32-bit Flash address,the corresponding higher 6-bit ECC value. 56 / 620 Nations Technologies Inc. Tel:+86-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 Control (Pwr)

    STOP mode: The voltage regulator provides power in low power mode and the output voltage can be configured to 1.5V or 1.2V by software.  PD mode: The voltage regulator is turned off. 57 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 58: Power Supply Supervisor

    Refer to the electrical characteristics section of the data sheet for details on power-on and power-off resets. 58 / 620 Nations Technologies Inc. Tel:+86-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: Figure 3-2 Power On Reset/Power Down Reset Waveform

    PVD threshold, according to the rise/fall edge trigger setting of EXTI line 16. For example, this feature can be used to perform emergency shutdown tasks. 59 / 620 Nations Technologies Inc. Tel:+86-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: Power Modes

    CPU running at LSI or LSE, PLL off, all LPRUN from other peripherals configurable. Voltage software control software control FLASH regulator in normal mode. 60 / 620 Nations Technologies Inc. Tel:+86-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: Table 3-2 Peripheral Running Status

    Power down mode Peripheral Run/Active Sleep Low power run Wakeup Wakeup Status Status capability capability Cortex-M0 FLASH SRAM8KB POR/PDR USART/UART 61 / 620 Nations Technologies Inc. Tel:+86-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: Lprun Mode

    FLASH to enter the deep standby mode as required. Note that a write key is required to enable write protection before accessing the PWR_CTRL4 register. 62 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 63: Sleep Mode

    After waking up, the HSI is turned on, and the code starts from where it hangs. FLASH is in deep sleep mode. 63 / 620 Nations Technologies Inc. Tel:+86-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: Pd Mode

    If the access to the APB area is in progress, the time to enter the STOP mode will be delayed until the APB access is completed. 64 / 620 Nations Technologies Inc. Tel:+86-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: Debug Support

    Register 0x00 PWR_CTRL Reserved Reset value 0x04 PWR_CTRLSTS Reserved Reserved Reset value 0x08 PWR_CTRL2 Reserved Reserved Reset value 65 / 620 Nations Technologies Inc. Tel:+86-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: Power Control Register (Pwr_Ctrl)

    PVD level selection. PVD threshold is controlled below: PWR_CTRL.PLS Voltage 0000 1.8v 0001 2.0v 0010 2.2v 0011 2.4v 66 / 620 Nations Technologies Inc. Tel:+86-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: Power Control Status Register (Pwr_Ctrlsts)

    Reserved, the reset value must be maintained. 3.4.3 Power control status register (PWR_CTRLSTS) Address offset: 0x04 Reset value: 0x0000 0800 67 / 620 Nations Technologies Inc. Tel:+86-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 Only VDDD POR/PDR can reset this bit. 0: No wakeup event occurred 1: A wakeup event was received from the WKUP pin 68 / 620 Nations Technologies Inc. Tel:+86-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 2 (Pwr_Ctrl2)

    This register is write protected. Before each software write operation to this register, it must first write the key 69 / 620 Nations Technologies Inc. Tel:+86-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: Power Control Register 5 (Pwr_Ctrl5)

    1: Enable fast wake-up when system exits from STOP (wake-up time ~5us) 3.4.7 Power control register 5 (PWR_CTRL5) Address offset: 0x24 Reset value: 0x0000 0007 70 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 71: Power Control Register 6 (Pwr_Ctrl6)

    Only VDDD POR/PDR can reset this register. Only after connecting to the Debugger, software can write access to this register. 71 / 620 Nations Technologies Inc. Tel:+86-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 TIM1 stops working when core enters debug state. This bit is set or cleared by software. 0: The counter of TIM1 works normally 72 / 620 Nations Technologies Inc. Tel:+86-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 1: (FCLK on, HCLK on) In DBGSLEEP mode, both FCLK and HCLK clocks are provided by the previously configured system clock. 73 / 620 Nations Technologies Inc. Tel:+86-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)

    Independent watchdog end of count condition (IWDG reset)  Software reset (SW reset)  Low power management reset 74 / 620 Nations Technologies Inc. Tel:+86-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

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

    LPTIMER working clock can come from one of the following six sources, which can be configured by software:  HSI clock  HSE Clock  LSI clock  LSE clock  COMP1_OUT 76 / 620 Nations Technologies Inc. Tel:+86-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  If the APB prescaler is not 1, the timer clock frequency is twice the APB frequency where the timer is located. FCLK is the free running clock of the Cortex®-M0. See ARM's Cortex®-M0 Technical Reference Manual for details. 77 / 620 Nations Technologies Inc. Tel:+86-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: Clock Tree Diagram

    2. For more details about the internal and external clock source characteristics, please refer to the "Electrical Characteristics" section in the product datasheet. 78 / 620 Nations Technologies Inc. Tel:+86-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: Hse Clock

    The 4 to 20MHz external oscillator has the advantage of producing a more accurate master clock for the system. The 79 / 620 Nations Technologies Inc. Tel:+86-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: Hsi Clock

    SYSCLK exceeding 48MHz. In addition, users can also configure RCC_CTRL.PLLBP to bypass the PLL frequency division and frequency 80 / 620 Nations Technologies Inc. Tel:+86-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: Lse Clock

    An interrupt can be generated if enabled in the Clock Interrupt Register (RCC_CLKINT). 81 / 620 Nations Technologies Inc. Tel:+86-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: Lsi Calibration

    PLL clock is used as the system clock), the clock failure will cause a switch of the system clock to the 82 / 620 Nations Technologies Inc. Tel:+86-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: Rtc Clock

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

    RCC_APB1PRST 010h Reserved Reset Value RCC_AHBPCLKEN 014h Reserved Reset Value RCC_APB2PCLKEN 018h Reserved Reset Value 01Ch RCC_APB1PCLKEN Reserved 84 / 620 Nations Technologies Inc. Tel:+86-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: Clock Control Register (Rcc_Ctrl)

    10:Using PF0 analog input for HSE OSC_IN, HSE shall be configured for external crystal mode; 11:Reserved 85 / 620 Nations Technologies Inc. Tel:+86-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 Internal high-speed clock enable Set and cleared by software. This bit cannot be cleared when HSI is used as the 86 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 87: Clock Configuration Register (Rcc_Cfg)

    Set and cleared by software. 000: no clock 001: LSI clock 010: LSE clock 011: System clock (SYSCLK) 100: HSI clock 87 / 620 Nations Technologies Inc. Tel:+86-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 100: HCLK divided by 2 101: HCLK divided by 4 110: HCLK divided by 8 111: HCLK divided by 16 88 / 620 Nations Technologies Inc. Tel:+86-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: Clock Interrupt Register (Rcc_Clkint)

    100: LSI selected as the system clock 4.3.4 Clock interrupt register (RCC_CLKINT) Address offset: 0x08 Reset value: 0x0000 0000 89 / 620 Nations Technologies Inc. Tel:+86-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 1: RAMC generates a reset when it detects a parity error 0: The reset is not generated when RAMC detects a parity error 90 / 620 Nations Technologies Inc. Tel:+86-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 This bit is cleared by software by setting the HSERDICLR bit. 0: No clock ready interrupt caused by HSE oscillator 1: Clock ready interrupt caused by HSE oscillator 91 / 620 Nations Technologies Inc. Tel:+86-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: Apb2 Peripheral Reset Register (Rcc_Apb2Prst)

    Set and cleared by software. 0: Clear reset 1: Reset USART1 TIM8RST TIM8 reset Set and cleared by software. 0: Clear reset 92 / 620 Nations Technologies Inc. Tel:+86-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 1: Reset GPIO port A Reserved Reserved, the reset value must be maintained. AFIORST Alternate function IO reset 93 / 620 Nations Technologies Inc. Tel:+86-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)

    Set and cleared by software. 0: Clear reset 1: Reset UART5 LPUART2RST LPUART2 reset Set and cleared by software. 94 / 620 Nations Technologies Inc. Tel:+86-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 and cleared by software. 0: Clear reset 1: Reset TIM3 timer Reserved Reserved, the reset value must be maintained. 95 / 620 Nations Technologies Inc. Tel:+86-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: Ahb Peripheral Clock Enable Register (Rcc_Ahbpclken)

    0: Disable HSQRT clock 1: Enable HSQRT clock FLITFEN Flash interface clock enable Set and cleared by software. 96 / 620 Nations Technologies Inc. Tel:+86-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: Apb2 Peripheral Clock Enable Register (Rcc_Apb2Pclken)

    Set and cleared by software. 0: Disable TIM8 clock 1: Enable TIM8 clock TIM1EN TIM1 clock enable Set and cleared by software. 97 / 620 Nations Technologies Inc. Tel:+86-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 Set and cleared by software. 0: Disable the alternate function IO clock 1: Enable the alternate function IO clock 98 / 620 Nations Technologies Inc. Tel:+86-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)

    UART5 clock enable Set and cleared by software. 0: Disable UART5 clock 1: Enable UART5 clock LPUART2EN LPUART2 clock enable 99 / 620 Nations Technologies Inc. Tel:+86-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: Disable LPTIM timer clock 1: Enable LPTIM timer clock TIM4EN TIM4 timer clock enable 100 / 620 Nations Technologies Inc. Tel:+86-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: Low Speed Clock Control Register (Rcc_Lsctrl)

    The external low-speed clock oscillator is bypassed. Set by software to bypass LSE. At this time LSEEN needs to be set 0 101 / 620 Nations Technologies Inc. Tel:+86-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: Control/Status Register (Rcc_Ctrlsts)

    It is cleared by writing RMRSTF bit or por_rst_n reset. 0: No EMCCLAMP reset occurred 1: EMCCLAMP reset occurred EMCGBRSTF EMCGB reset flag 102 / 620 Nations Technologies Inc. Tel:+86-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 0: No NRST pin reset occurred 1: NRST pin reset occurred MMURSTF MMU reset flag Set by hardware when MMU reset occurs. 103 / 620 Nations Technologies Inc. Tel:+86-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: Ahb Peripheral Reset Register (Rcc_Ahbprst)

    Set and cleared by software. 0: Clear reset 1: Reset RNG Reserved Reserved, the reset value must be maintained. HDIVRST HDIV reset 104 / 620 Nations Technologies Inc. Tel:+86-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: Clock Configuration Register 2(Rcc_Cfg2)

    Set and cleared by software. 000: APB1 clock is selected 001: System clock is selected 010: HSI clock is selected 105 / 620 Nations Technologies Inc. Tel:+86-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 Note:When switching the ADC 1M clock source, you need to ensure that the HSI clock is turned on Reserved Reserved, the reset value must be maintained. ADCPLLPRE[4:0] ADC PLL divider 106 / 620 Nations Technologies Inc. Tel:+86-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: Emc Control Register 3 (Rcc_Emcctrl)

    Others: HCLK clock divided by 32 4.3.14 EMC control register 3 (RCC_EMCCTRL) Address offset: 0x30 Reset value: 0x0000 0000 107 / 620 Nations Technologies Inc. Tel:+86-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 EMC clamp2 reset Set and cleared by software. and reset by por_rst_n 0: Disable reset request 1: Enable reset request 108 / 620 Nations Technologies Inc. Tel:+86-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 Set and cleared by software. and reset by por_rst_n 0: Disable detection 1: Enable detection CLPDET3 EMC Clamp3 detection enble 109 / 620 Nations Technologies Inc. Tel:+86-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 EMC Clamp0 detection enble Set and cleared by software. and reset by por_rst_n 0: Disable detection 1: Enable detection 110 / 620 Nations Technologies Inc. Tel:+86-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: Gpio And Afio

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

    Alternate function + push-pull + pull-up Alternate function + push-pull + pull-down Reserved Alternate function open-drain Alternate function open-drain + pull-up 112 / 620 Nations Technologies Inc. Tel:+86-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: Table 5-2 I/O List Of Functional Features Of The Pin

    5.2.1.1 Input mode When the I / O port is configured as input mode:  Output buffer is disabled 113 / 620 Nations Technologies Inc. Tel:+86-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: Figure 5-2 Input Floating / Pull-Up / Pull-Down Configuration Mode

    Read access to input data register to get I/O status.  Read access to the output data register to get the last written value. 114 / 620 Nations Technologies Inc. Tel:+86-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: Figure 5-3 Output Mode

    Read access to input data register to get I/O status.  Read access to the output data register to get the last written value. 115 / 620 Nations Technologies Inc. Tel:+86-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-4 Alternate Function Mode

    Analog From on-chip peripheral I/O Pin diode Read Input data register TTL Schmitt trigger Analog To on-chip peripheral 116 / 620 Nations Technologies Inc. Tel:+86-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: Status After Reset

    5.2.5 Alternate function When I/O ports are configured for alternate function mode. The port bit configuration register (GPIOx_AFL/ 117 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 118: Table 5-3 I/O List Of Functional Features Of The Pin

    Alternate function Remapping TIM1_ETR PA12 TIM1_BKIN PB12 TIM1_CH1 TIM1_CH2 TIM1_CH3 PA10 TIM1_CH4 PA11 TIM1_CH1N PB13 TIM1_CH2N PB14 TIM1_CH3N PB15 118 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 119: Table 5-5 Tim8 Alternate Function I/O Remapping

    TIM8_ETR AF13 PA10 TIM8_BKIN TIM8_CH1 PB12 TIM8_CH2 PB13 PA10 TIM8_CH3 PB11 PB14 TIM8_CH4 PB15 TIM8_CH1N TIM8_CH2N TIM8_CH3N PB15 119 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 120: Table 5-6 Tim3 Alternate Function I/O Remapping

    5.2.5.3.4 TIM4 alternate function I/O remapping Table 5-7 TIM4 alternate function I/O remapping Alternate function Remapping TIM4_ETR PB10 TIM4_CH1 TIM4_CH2 PB15 TIM4_CH3 TIM4_CH4 120 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 121: Table 5-8 Lptim Alternate Function I/O Remapping

    5.2.5.5 CAN alternate function I/O remapping Table 5-9 CAN alternate function I/O remapping Alternate function Remapping PB11 CAN_RX PB12 CAN_TX 121 / 620 Nations Technologies Inc. Tel:+86-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-10 Usart1 Alternate Function I/O Remapping

    Table 5-11 USART2 alternate function I/O remapping Alternate function Remapping USART2_CTS AF10 USART2_RTS AF10 USART2_TX PA14 USART2_RX PA10 AF10 122 / 620 Nations Technologies Inc. Tel:+86-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-12 Uart5 Alternate Function I/O Remapping

    5.2.5.7.1 LPUART1 alternate function I/O remapping Table 5-14 LPUART1 alternate function I/O remapping Alternate function Remapping LPUART1_CTS PB13 LPUART1_RTS PB14 LPUART1_TX 123 / 620 Nations Technologies Inc. Tel:+86-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-15 Lpuart2 Alternate Function I/O Remapping

    5.2.5.8 I2Cx alternate function I/O remapping 5.2.5.8.1 I2C1 alternate function I/O remapping Table 5-16 I2C1 alternate function I/O remapping Alternate function Remapping I2C1_SCL 124 / 620 Nations Technologies Inc. Tel:+86-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-17 I2C2 Alternate Function I/O Remapping

    Table 5-17 I2C2 alternate function I/O remapping Alternate function Remapping PA11 I2C2_SCL PB10 PB13 PA10 PA12 I2C2_SDA PB11 PB14 I2C2_SMBA 125 / 620 Nations Technologies Inc. Tel:+86-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 Spi1/I2S1 Alternate Function I/O Remapping

    Table 5-19 SPI2 alternate function I/O remapping Alternate function Remapping SPI2_ NSS PB12 PB10 SPI2_ SCLK PB13 PB14 SPI2_ MISO PB15 SPI2 _MOSI 126 / 620 Nations Technologies Inc. Tel:+86-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-20 Spi3 Alternate Function I/O Remapping

    PA14 5.2.5.10.3 COMP3 alternate function I/O remapping Table 5-23 COMP3 alternate function I/O remapping Alternate function Remapping COMP3_OUT 127 / 620 Nations Technologies Inc. Tel:+86-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-24 Beeper1 Alternate Function I/O Remapping

    5.2.5.13 RTC alternate function I/O remapping PC13 can be used as RTC TAMPER1 intrusion detection pin, RTC Timestamp, RTC output (RTC alarm, Wakeup 128 / 620 Nations Technologies Inc. Tel:+86-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-27 Rtc Alternate Function I/O Remapping

    It can only be used in GPIO mode when the LSE is turned off The mode of the GPIO is 129 / 620 Nations Technologies Inc. Tel:+86-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-32 Osc Alternate Function Remapping

    ADC_ETRR = 1 ADC external trigger ADC external trigger regular conversion is connected to ADC external trigger regular conversion is 130 / 620 Nations Technologies Inc. Tel:+86-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

    Table 5-40 TIM3 and LPTIM TIM3/4/LPTIM pin Configuration PAD configuration mode TIM3/4/LPTIM_CHx Input capture channel x Alternate function push-pull 131 / 620 Nations Technologies Inc. Tel:+86-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-41 Can

    Full duplex mode / Slave mode or pull-up/pull-up) Simple bidirectional data line / Master mode Alternate function push-pull 132 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 133: Gpio Locking Mechanism

    GPIOx_PLOCK.  Only after the GPIOx_PLOCK.PLOCKK is operated in the correct sequence w1->w0->w1->r0 (where r0 must 133 / 620 Nations Technologies Inc. Tel:+86-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 Registers

    Reset Value Reserved 0 Reserved Reserved GPIOx_SR x=A,B,C,D,F Reserved x=A,B,C 008h Reset Value Reserved 1 Reserved Reserved 134 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 135: Gpio Port Mode Description Register (Gpiox_Pmode)

    5.3.2 GPIO port mode description register (GPIOx_PMODE) Offset address : 0x00 Reset value : 0xEBFF FFFC(x=A) ;0xFFFF FFFF(x=B,C,D) ;0xFFFF FFFC(x=F) 135 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 136: Gpio Port Type Definition (Gpiox_Potype)

    When x = F, y = 0, 1, 2, 4, 5, 6, 7, the remaining bits are reserved, and the reserved bits are read-only. 136 / 620 Nations Technologies Inc. Tel:+86-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 Slew Rate Configuration Register (Gpiox_Sr)

    When x = D, y = 2, the remaining bits are reserved, and the reserved bits are read- 17:16 only; 137 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 138: Gpio Port Input Data Register (Gpiox_Pid)

    5.3.7 GPIO port output data register (GPIOx_POD) Offset address : 0x14 Reset value : 0x0000 0000 (x=A,B,C,D,F) 138 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 139: Gpio Port Bit Set/Clear Register (Gpiox_Pbsc)

    When x = F, y = 0, 1, 2, 4, 5, 6, 7, the remaining bits are reserved, and the reserved 139 / 620 Nations Technologies Inc. Tel:+86-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 Port Configuration Lock Register (Gpiox_ Plock)

    When x = F, y = 0, 1, 2, 4, 5, 6, 7, the remaining bits are reserved, and the reserved bits are read-only. 140 / 620 Nations Technologies Inc. Tel:+86-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 Low Register (Gpiox_Afl)

    5.3.11 GPIO alternate function high register (GPIOx_AFH) Offset address : 0x24 Reset value : 0xF00F FFFF(x = A) ;0xFFFF FFFF(x =B,C,D,F) 141 / 620 Nations Technologies Inc. Tel:+86-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 Port Bit Clear Register (Gpiox_Pbc)

    Reserved Reserved,the reset value must be maintained 15:0 PBCy Clear bit y of port GPIOx (x = A,B,C,D,F) 142 / 620 Nations Technologies Inc. Tel:+86-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: Gpio Driver Strength Configuration Register (Gpiox_ Ds)

    When x = F, y = 0, 1, 2, 4, 5, 6, 7, the remaining bits are reserved, and the reserved bits are read-only. 5.4 AFIO Registers 5.4.1 AFIO register overview AFIO base address: 0x40010000 143 / 620 Nations Technologies Inc. Tel:+86-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 Configuration Register (Afio_Cfg)

    NSS mode selection bit of SPI3 (NSS is configured in AFIO push-pull mode). 0: NSS is high impedance when idle 1: NSS is high level when idle 144 / 620 Nations Technologies Inc. Tel:+86-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 1 (Afio_Exti_Cfg1)

    Reserved,the reset value must be maintained 5.4.3 AFIO external interrupt configuration register 1 (AFIO_EXTI_CFG1) Offset address : 0x08 Reset value : 0x0000 0000 145 / 620 Nations Technologies Inc. Tel:+86-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 2 (Afio_Exti_Cfg2)

    These bits are readable and writable by software and are used to select the input source for the EXTIx external interrupt. EXTI4 configuration: 0000: PA4 pin 0001: PB4 pin 0010: reserved 146 / 620 Nations Technologies Inc. Tel:+86-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 3 (Afio_Exti_Cfg3)

    0101: reserved Other: reserved EXTI11 configuration: 0000: PA11 pin 0001: PB11 pin 0010: reserved 0101: reserved Other: reserved 147 / 620 Nations Technologies Inc. Tel:+86-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: Afio External Interrupt Configuration Register 4 (Afio_Exti_Cfg4)

    0101: reserved Other: reserved EXTI15 configuration: 0000: PA15 pin 0001: PB15 pin 0010: PC15 pin 0101: reserved Other: reserved 148 / 620 Nations Technologies Inc. Tel:+86-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: Interrupts And Events

    PVD interrupt connected to EXTI line Settable 0x0000 0044 RTC interrupt connected to EXTI lines Settable 0x0000 0048 17, 19 and 20 149 / 620 Nations Technologies Inc. Tel:+86-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 UART5/ UART6 UART5/ UART6 global interrupt 0x0000 00B8 COMP1(connected to EXTI line 18) Settable COMP1/COMP2/COMP3 0x0000 00BC /COMP2/COMP3 interrupt 150 / 620 Nations Technologies Inc. Tel:+86-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 151 / 620 Nations Technologies Inc. Tel:+86-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

    When a preset edge occurs on an event line, an event request pulse is generated and the corresponding pending bit is not set to '1'. 152 / 620 Nations Technologies Inc. Tel:+86-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 Mapping

    PA12 PA13 PA14 PA15 EXTI5 EXTI12 EXTI13 EXTI14 AFIO_EXTI_CFG4 PB12 PB13 PB14 PB15 Register PC12 PC13 PC14 PC15 153 / 620 Nations Technologies Inc. Tel:+86-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 line 22 is connected to the LPUART1/2 wake up event  EXTI line 23 is connected to the LPTIM wake up event 154 / 620 Nations Technologies Inc. Tel:+86-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 Registers

    EXTI_TS_SEL TSSEL[3:0] 018h Reserved Reset Value 6.3.2 Interrupt mask register(EXTI_IMASK) Address offset : 0x00 Reset value : 0x00000000 155 / 620 Nations Technologies Inc. Tel:+86-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: Event Mask Register(Exti_Emask)

    0: Disables rising edge trigger (interrupts and events) on input line x. 1: Enable rising edge trigger (interrupts and events) on input line x. 156 / 620 Nations Technologies Inc. Tel:+86-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: Falling Edge Trigger Selection Register(Exti_Ft_Cfg)

    Note: This bit can be cleared to '0' by writing '1' to clear the corresponding bit of EXTI_PEND. 157 / 620 Nations Technologies Inc. Tel:+86-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: Interrupt Request Pending Register(Exti_Pend)

    1: select EXTI1 as the trigger source of timestamp event; …… 15: Select EXTI15 as the trigger source of timestamp events. 158 / 620 Nations Technologies Inc. Tel:+86-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: Dma Controller

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

    Each DMA data transfer consists of three operations:  Data access: determine the source address (DMA_PADDRx or DMA_MADDRx) according to the transfer 160 / 620 Nations Technologies Inc. Tel:+86-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: Channel Priority And Arbitration

    DMA_CHCFGx.PSIZE and DMA_CHCFGx.MSIZE. When DMA_CHCFGx.PSIZE and DMA_CHCFGx.MSIZE are different, the DMA module aligns the data according to the below. 161 / 620 Nations Technologies Inc. Tel:+86-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: 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 162 / 620 Nations Technologies Inc. Tel:+86-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: Peripheral/Memory Address Incrementation

    7.4.6 Channel configuration procedure The detail configuration flow is as below: Configure interrupt mask bits, 1: enable interrupts, 0 disable interrupts. 163 / 620 Nations Technologies Inc. Tel:+86-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: Flow Control

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

    165 / 620 Nations Technologies Inc. Tel:+86-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: Dma Request Mapping

    Note: The same request source cannot be used for different channels of the DMA, otherwise only the channel with higher priority will be triggered. 166 / 620 Nations Technologies Inc. Tel:+86-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: Dma Registers

    050h Reset Value DMA_CHSEL4 CH_SEL[5:0] 054h Reserved Reset Value DMA_CHCFG5 058h Reserved Reset Value 05Ch DMA_TXNUM5 Reserved NDTX[15:0] 167 / 620 Nations Technologies Inc. Tel:+86-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 Interrupt Status Register (Dma_Intsts)

    Hardware sets this bit when transfer error happen. This bit is cleared by software by writing ‘1’ to DMA_INTCLR.CERRFx bit. 168 / 620 Nations Technologies Inc. Tel:+86-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: Dma Interrupt Flag Clear Register (Dma_Intclr)

    Clear transfer complete flag for channel x (x=1…8). 29/25/21/17/13/9/5/1 CTXCFx Software can set this bit to clear TXCF of corresponding channel. 0: No action. 169 / 620 Nations Technologies Inc. Tel:+86-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 Channel X Configuration Register (Dma_Chcfgx)

    11: Reserved PSIZE[1:0] Peripheral data size. Software can configure data size read/write from/to peripheral address. 00: 8-bits 01: 16-bits 170 / 620 Nations Technologies Inc. Tel:+86-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 Channel X Transfer Number Register (Dma_Txnumx)

    Note: The x is channel number, x = 1…8 Address offset: 0x0C+20 * (x–1) Reset value: 0x0000 0000 171 / 620 Nations Technologies Inc. Tel:+86-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: Dma Channel X Peripheral Address Register (Dma_Paddrx)

    Note: The x is channel number, x = 1…8 Address offset: 0x14+20 * (x–1) Reset value: 0x0000 0000 172 / 620 Nations Technologies Inc. Tel:+86-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 Channel Request Select Register (Dma_Chselx)

    For the mapping of peripheral DMA requests to DMA input request channel numbers, please refer to Table 7-4 173 / 620 Nations Technologies Inc. Tel:+86-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: 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. 174 / 620 Nations Technologies Inc. Tel:+86-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: Crc Function Description

    If the initial value needs to be set, the LRC register should be configured first. 175 / 620 Nations Technologies Inc. Tel:+86-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: 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. 8.4.3 CRC32 independent data register (CRC_CRC32IDAT) Address offset: 0x04 176 / 620 Nations Technologies Inc. Tel:+86-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: Crc32 Control Register (Crc_Crc32Ctrl)

    0 automatically. 8.4.5 CRC16 control register (CRC_CRC16CTRL) Address offset: 0x0C Reset value: 0x0000 0000 177 / 620 Nations Technologies Inc. Tel:+86-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: Crc16 Input Data Register (Crc_Crc16Dat)

    Note: 8-bits, 16-bits and 32-bits operations are supported. 8.4.7 CRC cyclic redundancy check code register (CRC_CRC16D) Address offset: 0x14 Reset value: 0x0000 0000 178 / 620 Nations Technologies Inc. Tel:+86-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: Lrc Result Register (Crc_Lrc)

    XOR with LCR register value. The result will be stored in LRC. Software read the result. It should be cleared before next use. 179 / 620 Nations Technologies Inc. Tel:+86-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: 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 180 / 620 Nations Technologies Inc. Tel:+86-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: 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 181 / 620 Nations Technologies Inc. Tel:+86-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: Prescaler Description

    TIMx_STS.UDITF is set:  The repetition counter reloads the contents of the TIMx_REPCNT 182 / 620 Nations Technologies Inc. Tel:+86-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 The figure below shows some examples of the counter behavior and the update flags for different division factors in the up-counting mode. 183 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 184: Figure 9-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) 184 / 620 Nations Technologies Inc. Tel:+86-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 Counter overflow Update event(UEV) Update interrupt flag(UDITF) Auto-reload preload register Write a new value in TIMx_AR Auto-reload shadow register 185 / 620 Nations Technologies Inc. Tel:+86-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: 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". 186 / 620 Nations Technologies Inc. Tel:+86-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 9-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) 187 / 620 Nations Technologies Inc. Tel:+86-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: Figure 9-7 A Center-Aligned Sequence Diagram That Includes Counter Overflows And Underflows (Arpen = 1)

    The basic unit of Section 9.3.1 describes the conditions for generating an update event (UEV). An update event (UEV) is actually only generated when the repeat counter reaches zero, which is valuable for generating PWM signals. 188 / 620 Nations Technologies Inc. Tel:+86-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: Figure 9-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 189 / 620 Nations Technologies Inc. Tel:+86-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 9-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 190 / 620 Nations Technologies Inc. Tel:+86-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: Clock Selection

    Counter clock = CK_CNT=CK_PSC Counter register 63 64 65 66 00 01 02 03 04 05 06 07 191 / 620 Nations Technologies Inc. Tel:+86-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 9-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. 192 / 620 Nations Technologies Inc. Tel:+86-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 9-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 193 / 620 Nations Technologies Inc. Tel:+86-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: 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. 194 / 620 Nations Technologies Inc. Tel:+86-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 9-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. 195 / 620 Nations Technologies Inc. Tel:+86-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 9-17 Capture/Compare Channel 1 Main Circuit

    TIM1_CCMOD1.OC1PEN From time base unit Figure 9-18 Output part of channelx (x= 1,2,3, take channel 1 as example) 196 / 620 Nations Technologies Inc. Tel:+86-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: Input Capture Mode

    There is a capture interrupt flag TIMx_STS.CCxITF, which can issue an interrupt or DMA request if the corresponding interrupt enable is pulled high. 197 / 620 Nations Technologies Inc. Tel:+86-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: Pwm Input Mode

    Configure TIMx_CCEN.CC1P equal to ‘0’ to select the active polarity of filtered timer input 1(TI1FP1), valid on the rising edge.  Configure TIMx_CCMOD1.CC2SEL equal to ‘10’ select TI1 as valid input for TIMx_CCDAT2. 198 / 620 Nations Technologies Inc. Tel:+86-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: Forced Output Mode

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

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

    201 / 620 Nations Technologies Inc. Tel:+86-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: Figure 9-22 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 202 / 620 Nations Technologies Inc. Tel:+86-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: Figure 9-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. 203 / 620 Nations Technologies Inc. Tel:+86-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: One-Pulse Mode

    4. TIMx_CCDAT1 writes the count value to be delayed (t ), TIMx_AR - TIMx_CCDAT1 is the count value of DELAY 204 / 620 Nations Technologies Inc. Tel:+86-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: 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. 205 / 620 Nations Technologies Inc. Tel:+86-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: 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. 206 / 620 Nations Technologies Inc. Tel:+86-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: Figure 9-26 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 207 / 620 Nations Technologies Inc. Tel:+86-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: 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) ^ 208 / 620 Nations Technologies Inc. Tel:+86-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 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 209 / 620 Nations Technologies Inc. Tel:+86-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: Debug Mode

    2. The slave mode is selected as reset mode (TIMx_SMCTRL.SMSEL=100), and the trigger input is selected as TI1 (TIMx_SMCTRL.TSEL=101); 210 / 620 Nations Technologies Inc. Tel:+86-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: 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. 211 / 620 Nations Technologies Inc. Tel:+86-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: 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. 212 / 620 Nations Technologies Inc. Tel:+86-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 9-30 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); 213 / 620 Nations Technologies Inc. Tel:+86-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: Timer Synchronization

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

    The relationship between the counting direction and the encoder signal is shown in Table 9-1 Counting direction versus encoder signals 215 / 620 Nations Technologies Inc. Tel:+86-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: Table 9-1 Counting Direction Versus Encoder Signals

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

    Figure 9-34 Encoder interface mode example with IC1FP1 polarity inverted forward jitter backward jitter Counter down 217 / 620 Nations Technologies Inc. Tel:+86-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: 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. 218 / 620 Nations Technologies Inc. Tel:+86-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: 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 219 / 620 Nations Technologies Inc. Tel:+86-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: Timx Register Description(X=1, 8)

    Input capture mode Reset Value TIMx_CCMOD2 Output compare 01Ch mode Reset Value TIMx_CCMOD2 Input capture 01Ch mode Reset Value 220 / 620 Nations Technologies Inc. Tel:+86-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: Control Register 1 (Timx_Ctrl1)

    TIMx_CCDAT6 CCDAT6[15:0] 05Ch Reserved Reset Value 9.4.2 Control register 1 (TIMx_CTRL1) Offset address: 0x00 Reset value: 0x0000 0000 221 / 620 Nations Technologies Inc. Tel:+86-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 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 222 / 620 Nations Technologies Inc. Tel:+86-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 2 (Timx_Ctrl2)

    TIMx_CTRL1.CNTEN bit is set in the software. Trigger mode can automatically set TIMx_CTRL1.CNTEN bit by hardware. 9.4.3 Control register 2 (TIMx_CTRL2) Offset address: 0x04 Reset value: 0x0000 0000 223 / 620 Nations Technologies Inc. Tel:+86-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 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. 224 / 620 Nations Technologies Inc. Tel:+86-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: Slave Mode Control Register (Timx_Smctrl)

    This bit is used to enable external clock mode 2, and the counter is driven by any active edge on the ETRF signal in this mode. 0: External clock mode 2 disable. 225 / 620 Nations Technologies Inc. Tel:+86-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 (via TRGO) and its slaves. This is useful when several timers are required to be synchronized to a single external event. 226 / 620 Nations Technologies Inc. Tel:+86-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: Table 9-3 Timx Internal Trigger Connection

    ITR0 (TSEL = 000) ITR1 (TSEL = 001) ITR2 (TSEL = 010) ITR3 (TSEL = 011) TIM1 TIM3 TIM4 TIM8 TIM1 TIM4 227 / 620 Nations Technologies Inc. Tel:+86-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: Dma/Interrupt Enable Registers (Timx_Dinten)

    0: Disable trigger interrupt 1: Enable trigger interrupt COMIEN COM interrupt enable 0: Disable COM interrupt 1: Enable COM interrupt 228 / 620 Nations Technologies Inc. Tel:+86-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: Status Registers (Timx_Sts)

    See TIMx_STS.CC1OCF description. CC3OCF Capture/Compare 3 overcapture flag See TIMx_STS.CC1OCF description. CC2OCF Capture/Compare 2 overcapture flags See TIMx_STS.CC1OCF description. 229 / 620 Nations Technologies Inc. Tel:+86-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 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: 230 / 620 Nations Technologies Inc. Tel:+86-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: Event Generation Registers (Timx_Evtgen)

    This bit is automatically cleared by hardware. 0: No action 1: Generated a trigger event 231 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 232: Capture/Compare Mode Register 1 (Timx_Ccmod1)

    ICx describes the function of a channel in input mode. Hence, 232 / 620 Nations Technologies Inc. Tel:+86-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 TIMx_CCDAT1, OC1REF signal of channel 1 is high, otherwise it is low. Note 1: In PWM mode 1 or PWM mode 2, the OC1REF level changes only when the 233 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 234 Input capture mode: Bit field Name Description 15:12 IC2F[3:0] Input Capture 2 Filter 11:10 IC2PSC[1:0] Input Capture 2 Prescaler 234 / 620 Nations Technologies Inc. Tel:+86-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 11: CC1 channel is configured as input, IC1 is mapped to TRC. This mode is only active when the internal trigger input is selected by TIMx_SMCTRL.TSEL. 235 / 620 Nations Technologies Inc. Tel:+86-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: Capture/Compare Mode Register 2 (Timx_Ccmod2)

    TIMx_SMCTRL.TSEL. Note: CC3SEL is writable only when the channel is off (TIMx_CCEN.CC3EN = 0). Input capture mode: 236 / 620 Nations Technologies Inc. Tel:+86-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 Enable Registers (Timx_Ccen)

    Description 31:22 Reserved Reserved, the reset value must be maintained CC6P Capture/Compare 6 output polarity See TIMx_CCEN.CC1P description. 237 / 620 Nations Technologies Inc. Tel:+86-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 1: Enable - Enable output OC1N signal. The level of OC1N depends on the value of these bits TIMx_BKDT.MOEN, TIMx_BKDT.OSSI, TIMx_BKDT.OSSR, TIMx_CTRL2.OI1, TIMx_CTRL2.OI1N and TIMx_CCEN.CC1EN. 238 / 620 Nations Technologies Inc. Tel:+86-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: Table 9-4 Output Control Bits Of Complementary Ocx And Ocxn Channels With Break Function

    Output disabled(not driven by timer) Output disabled(not driven by timer) OCx=CCxP,OCx_EN=0 OCxN=CCxNP,OCxN_EN=0 Off-state (Output enabled with inactive OCxREF + polarity, 239 / 620 Nations Technologies Inc. Tel:+86-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: Counters (Timx_Cnt)

    Reset value: 0x0000 Bit field Name Description 15:0 CNT[15:0] Counter value 9.4.12 Prescaler (TIMx_PSC) Offset address: 0x28 Reset value: 0x0000 240 / 620 Nations Technologies Inc. Tel:+86-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: Auto-Reload Register (Timx_Ar)

    Setting the TIMx_EVTGEN.UDGN bit will reload the content of TIMx_REPCNT.REPCNT and generate an update event. 241 / 620 Nations Technologies Inc. Tel:+86-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: Capture/Compare Register 1 (Timx_Ccdat1)

    When configured as input mode, register CCDAT2 and CCDDAT2 are only readable. When configured as output mode, register CCDAT2 and CCDDAT2 are readable and writable. 242 / 620 Nations Technologies Inc. Tel:+86-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 3 (Timx_Ccdat3)

    CC4 channel is configured as input: CCDAT4 contains the counter value transferred by the last input capture 4 event (IC4). 243 / 620 Nations Technologies Inc. Tel:+86-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: Break And Dead-Time Registers (Timx_Bkdt)

    CCxNEN = 1. Then, OCx/OCxN enable output signal = 1 For more details, See Section 9.4.10, capture/compare enablement registers (TIMx_CCEN). 244 / 620 Nations Technologies Inc. Tel:+86-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 DTGN [then] = 111: dead time = (32 + DTGN [4:0]) × (16 × t value see TIMx_CTRL1.CLKD [1:0]. 245 / 620 Nations Technologies Inc. Tel:+86-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: Dma Control Register (Timx_Dctrl)

    00001: TIMx_CTRL2, 00010: TIMx_SMCTRL, … 10001:TIMx_BKDT 10010:TIMx_DCTRL 9.4.21 DMA transfer buffer register (TIMx_DADDR) Offset address: 0x4C Reset value: 0x0000 246 / 620 Nations Technologies Inc. Tel:+86-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: 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 247 / 620 Nations Technologies Inc. Tel:+86-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 Register 5 (Timx_Ccdat5)

    Otherwise, this preloaded value is transferred to the active register only when an update event occurs. TIM1_CC6 for OPAMP switch. 248 / 620 Nations Technologies Inc. Tel:+86-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: General-Purpose Timers (Tim3 And Tim4)

    Incremental (quadrature) encoder interface: used for tracking motion and resolving rotation direction and position  Hall sensor interface: used to do three-phase motor control 249 / 620 Nations Technologies Inc. Tel:+86-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 Description

    TIMx_CTRL1.UPDIS=0. The counter CK_CNT is valid only when the TIMx_CTRL1.CNTEN bit is set. The counter starts counting one clock cycle after the TIMx_CTRL1.CNTEN bit is set. 250 / 620 Nations Technologies Inc. Tel:+86-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: Counter Mode

    Update auto-reload shadow registers with preload value(TIMx_AR), when TIMx_CTRL1.ARPEN = 1.  The prescaler shadow register is reloaded with the preload value(TIMx_PSC). 251 / 620 Nations Technologies Inc. Tel:+86-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: 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) 252 / 620 Nations Technologies Inc. Tel:+86-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: Figure 9-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 253 / 620 Nations Technologies Inc. Tel:+86-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 10-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". 254 / 620 Nations Technologies Inc. Tel:+86-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 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) 255 / 620 Nations Technologies Inc. Tel:+86-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: Clock Selection

    10.3.3 Clock selection  The internal clock of timers :CK_INT  Two kinds of external clock mode : 256 / 620 Nations Technologies Inc. Tel:+86-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 10-8 Control Circuit In Normal Mode, Internal Clock Divided By 1

    Counter clock = CK_CNT=CK_PSC 63 64 65 66 00 01 02 03 04 05 06 07 Counter register 257 / 620 Nations Technologies Inc. Tel:+86-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: Figure 10-9 Ti2 External Clock Connection Example

    The delay between the rising edge of TI2 and the actual clock of the counter depends on the resynchronization circuit at the input of TI2. 258 / 620 Nations Technologies Inc. Tel:+86-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 10-10 Control Circuit In External Clock Mode 1

    Select the polarity on ETR pin by setting TIMx_SMCTRL.EXTP equal to ‘0’, The rising edge of ETR is valid 259 / 620 Nations Technologies Inc. Tel:+86-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: 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. 260 / 620 Nations Technologies Inc. Tel:+86-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 10-13 Capture/Compare Channel (Example: Channel 1 Input Stage)

    The output part generates an intermediate waveform OCxRef (active high) as reference. The polarity acts at the end of the chain. 261 / 620 Nations Technologies Inc. Tel:+86-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: Figure 10-14 Capture/Compare Channel 1 Main Circuit

    Comparator mode Write CCDAT1H Write in progress CNT>CCDAT1 CNT=CCDAT1 Write CCDAT1L CC1SEL[0] CC1SEL[1] TIM1_CCMOD1.OC1PEN From time base unit 262 / 620 Nations Technologies Inc. Tel:+86-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: Input Capture Mode

    Define the sampling frequency of the TI1 input and the length of the digital filter by configuring the 263 / 620 Nations Technologies Inc. Tel:+86-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: 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. 264 / 620 Nations Technologies Inc. Tel:+86-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: Forced Output Mode

    When the capture/compare register and the counter have the same value, the output compare function’s operations are as follow: 265 / 620 Nations Technologies Inc. Tel:+86-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 Otherwise the TIMx_CCDATx shadow register will be updated at the next update event. Here is an example. 266 / 620 Nations Technologies Inc. Tel:+86-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: Pwm Mode

    User should not modified TIMx_CTRL1.DIR by software, it is updated by hardware. 267 / 620 Nations Technologies Inc. Tel:+86-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: Figure 10-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 before starting the counter, and not writing the counter while it is running. 268 / 620 Nations Technologies Inc. Tel:+86-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: Figure 10-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. 269 / 620 Nations Technologies Inc. Tel:+86-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: One-Pulse Mode

    4. TIMx_CCDAT1 writes the count value to be delayed (t ), TIMx_AR - TIMx_CCDAT1 is the count value of DELAY 270 / 620 Nations Technologies Inc. Tel:+86-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: 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. 271 / 620 Nations Technologies Inc. Tel:+86-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: 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. 272 / 620 Nations Technologies Inc. Tel:+86-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: Figure 10-22 Block Diagram Of Timer Interconnection

    The configuration steps are shown as below.  Setting TIM1_CTRL2.MMSEL=’100’ to use the OC1REF of TIM1 as trigger output. 273 / 620 Nations Technologies Inc. Tel:+86-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: Figure 10-23 Tim3 Gated By Oc1Ref Of Tim1

    Setting TIM3_CTRL1.CNTEN= ‘1’ to start TIM3.  Setting TIM1_CTRL1.CNTEN= ‘1’ to start TIM1.  Setting TIM1_CTRL1.CNTEN= ‘0’ to stop TIM1. 274 / 620 Nations Technologies Inc. Tel:+86-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 10-24 Tim3 Gated By Enable Signal Of Tim1

     Setting TIM3_SMCTRL. SMSEL = ‘110’ to set TIM3 to trigger mode.  Setting TIM1_CTRL1.CNTEN=1 to start TIM1. 275 / 620 Nations Technologies Inc. Tel:+86-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 10-25 Trigger Tim3 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. 276 / 620 Nations Technologies Inc. Tel:+86-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: Encoder Interface Mode

    The relationship between the counting direction and the encoder signal is shown in Table 10-1 Table 10-1 Counting direction versus encoder signals Level on opposite signals TI1FP1 signal TI2FP2 signal 277 / 620 Nations Technologies Inc. Tel:+86-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 10-27 Example Of Counter Operation In Encoder Interface Mode

    The following figure shows the example of counter behavior when IC1FP1 polarity is inverted (CC1P= '1', other configurations are the same as above) 278 / 620 Nations Technologies Inc. Tel:+86-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: Interfacing With Hall Sensor

    Table 10-2 Register overview Offset Register TIMx_CTRL1 000h Reset Value TIMx_CTRL2 004h Reset Value TIMx_SMCTRL 008h Reset Value 279 / 620 Nations Technologies Inc. Tel:+86-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 03Ch Reserved Reset Value TIMx_CCDAT4 CCDAT4[15:0] 040h Reserved Reset Value 044h Reserved TIMx_DCTRL DBLEN[4:0] DBADDR[4:0] 048h Reset Value 280 / 620 Nations Technologies Inc. Tel:+86-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: Control Register 1 (Timx_Ctrl1)

    ARPEN: Auto-reload preload enable 0: Shadow register disable for TIMx_AR register 1: Shadow register enable for TIMx_AR register 281 / 620 Nations Technologies Inc. Tel:+86-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 CNTEN Counter Enable 0: Disable counter 1: Enable counter 282 / 620 Nations Technologies Inc. Tel:+86-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 2 (Timx_Ctrl2)

    101: Compare - OC2REF signal is used as the trigger output (TRGO). 110: Compare - OC3REF signal is used as the trigger output (TRGO). 283 / 620 Nations Technologies Inc. Tel:+86-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: Slave Mode Control Register (Timx_Smctrl)

    01: ETRP frequency divided by 2 10: ETRP frequency divided by 4 11: ETRP frequency divided by 8 284 / 620 Nations Technologies Inc. Tel:+86-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 (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. 285 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 286: Dma/Interrupt Enable Registers (Timx_Dinten)

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

    0: Disable update interrupt 1: Enables update interrupt 10.4.6 Status registers (TIMx_STS) Offset address: 0x10 Reset value: 0x0000 287 / 620 Nations Technologies Inc. Tel:+86-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 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. 288 / 620 Nations Technologies Inc. Tel:+86-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: Event Generation Registers (Timx_Evtgen)

    Capture/Compare 4 generation See TIMx_EVTGEN.CC1GN description. CC3GN Capture/Compare 3 generation See TIMx_EVTGEN.CC1GN description. CC2GN Capture/Compare 2 generation See TIMx_EVTGEN.CC1GN description. 289 / 620 Nations Technologies Inc. Tel:+86-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: Capture/Compare Mode Register 1 (Timx_Ccmod1)

    14:12 OC2MD[2:0] Output Compare 2 mode OC2PEN Output Compare 2 preload enable OC2FEN Output Compare 2 fast enable 290 / 620 Nations Technologies Inc. Tel:+86-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 Note 1: Only when TIMx_CTRL1.ONEPM = 1(In one-pulse mode), PWM mode can be used without verifying the preload register, otherwise no other behavior can be predicted. 291 / 620 Nations Technologies Inc. Tel:+86-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 0000: No filter, sampling at f frequency 0001: f , N = 2 SAMPLING CK_INT 0010: f , N = 4 SAMPLING CK_INT 292 / 620 Nations Technologies Inc. Tel:+86-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: Capture/Compare Mode Register 2 (Timx_Ccmod2)

    10.4.9 Capture/compare mode register 2 (TIMx_CCMOD2) Offset address: 0x1C Reset value: 0x0000 See the description of the CCMOD1 register above Output comparison mode: 293 / 620 Nations Technologies Inc. Tel:+86-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 11: CC4 channel is configured as input, IC4 is mapped on TRC. This mode is only active when the internal trigger input is selected by TIMx_SMCTRL.TSEL. 294 / 620 Nations Technologies Inc. Tel:+86-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 Enable Registers (Timx_Ccen)

    Reserved, the reset value must be maintained CC1P Capture/Compare 1 output polarity When the corresponding channel of CC1 is in output mode: 295 / 620 Nations Technologies Inc. Tel:+86-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: Counters (Timx_Cnt)

    GPIO and AFIO registers. 10.4.11 Counters (TIMx_CNT) Offset address: 0x24 Reset value: 0x0000 Bit field Name Description 15:0 CNT[15:0] Counter value 296 / 620 Nations Technologies Inc. Tel:+86-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: Prescaler (Timx_Psc)

    Reset value: 0x0000 Bit field Name Description 15:0 CCDAT1[15:0] Capture/Compare 1 value  CC1 channel is configured as output: 297 / 620 Nations Technologies Inc. Tel:+86-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: Capture/Compare Register 2 (Timx_Ccdat2)

    When configured as output mode, register CCDAT2 is readable and writable. 10.4.16 Capture/compare register 3 (TIMx_CCDAT3) Offset address: 0x3C Reset value: 0x0000 298 / 620 Nations Technologies Inc. Tel:+86-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 4 (Timx_Ccdat4)

    When configured as output mode, register CCDAT4 is readable and writable. 10.4.18 DMA Control register (TIMx_DCTRL) Offset address: 0x48 Reset value: 0x0000 299 / 620 Nations Technologies Inc. Tel:+86-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: Dma Transfer Buffer Register (Timx_Daddr)

    DMA base address = The address of TIM_CTRL1 + TIMx_DCTRL. DBADDR * 4; DMA burst len = TIMx_DCTRL.DBLEN + 1. 300 / 620 Nations Technologies Inc. Tel:+86-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 For the fourth time, DMA access to the TIMx_ DADDR register will be mapped to access TIMx_CCDAT4 register; 301 / 620 Nations Technologies Inc. Tel:+86-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: Basic Timers (Tim6)

    The counter CK_CNT is valid only when the TIMx_CTRL1.CNTEN bit is set. The counter starts counting one clock 302 / 620 Nations Technologies Inc. Tel:+86-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: Counter Mode

    TIMx_STS.UDITF is set:  Update auto-reload shadow registers with preload value(TIMx_AR), when TIMx_CTRL1.ARPEN = 1. 303 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 304: Figure 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) 304 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 305: Figure 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 305 / 620 Nations Technologies Inc. Tel:+86-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: 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). 306 / 620 Nations Technologies Inc. Tel:+86-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: Register Overview

    PSC[15:0] 028h Reserved Reset Value TIMx_AR AR[15:0] Reserved Reset Value 11.4.2 Control Register 1 (TIMx_CTRL1) Offset address: 0x00 307 / 620 Nations Technologies Inc. Tel:+86-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: Dma/Interrupt Enable Registers (Timx_Dinten)

    Counter Enable 0: Disable counter 1: Enable counter 11.4.3 DMA/Interrupt Enable Registers (TIMx_DINTEN) Offset address: 0x0C Reset value: 0x0000 308 / 620 Nations Technologies Inc. Tel:+86-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: Status Registers (Timx_Sts)

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

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

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

    Programmable digital filter for filtering glitch  Configurable output: Pulse, PWM  Configurable I/O polarity  Encoder mode 312 / 620 Nations Technologies Inc. Tel:+86-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: Function Description

    The LPTIM can use an internal clock source or an external clock source. The internal clock source can be selected between APB, LSI, LSE, HSE, HSI or COMP1 by configuring the RCC_CFG2.LPTIMSEL[2:0] bits. The external 313 / 620 Nations Technologies Inc. Tel:+86-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: Glitch Filter

    LPTIM_CFG.TRIGFLT[1:0] bits. If glitch filter is not used, user can use digital filter in comparator or external analog filter to remove glitches. 314 / 620 Nations Technologies Inc. Tel:+86-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: Prescaler

    Note: Any write to the LPTIM_CTRL.SNGMST/ LPTIM_CTRL.TSTCM bit will be discarded if the LPTIM is not enabled. Table 12-2 6 trigger inputs corresponding to LPTIM_CFG.TRGSEL[2:0] bits Trigger selection mode Corresponding external trigger pin 315 / 620 Nations Technologies Inc. Tel:+86-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: Operating Mode

    If software trigger is used, setting LPTIM_CTRL.TSTCM bit will start the internal counter for continuous mode. Any subsequent external trigger event will be discarded as shown in Figure 12-3. 316 / 620 Nations Technologies Inc. Tel:+86-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: Figure 12-3 Lptim Output Waveform, Continuous Counting Mode Configuration

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

    In case of software start (LPTIM_CFG.TRGEN[1:0] = ‘00’), the LPTIM_CTRL.SNGMST setting will start the counter for one-shot counting. 318 / 620 Nations Technologies Inc. Tel:+86-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: Timeout Function

    Figure 12-6 below shows the three possible waveforms that can be generated on the LPTIM output. Also, it shows the effect of the polarity change using the LPTIM_CFG.WAVEPOL bit. 319 / 620 Nations Technologies Inc. Tel:+86-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: Register Update

    After a write to the LPTIM ARR register or the LPTIM COMP register, any successive write before respectively the LPTIM _INTSTS.ARRUPD flag or the LPTIM_INTSTS.CMPUPD flag be set, will lead to unpredictable results. So 320 / 620 Nations Technologies Inc. Tel:+86-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: Counter Mode

    The encoder mode allows the counter counts the events within 0 and LPTIM_ARR.ARRVAL[15:0] value. (0 up to LPTIM_ARR.ARRVAL[15:0] or LPTIM_ARR.ARRVAL[15:0] to 0). In this case, user must configure 321 / 620 Nations Technologies Inc. Tel:+86-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 ‘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’). 322 / 620 Nations Technologies Inc. Tel:+86-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: Non-Orthogonal Encoder Mode

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

    The following events generate an interrupt/wake-up event, if they are enabled through the LPTIM_INTEN register:  Compare match  Auto-reload match (whatever the direction if encoder mode) 324 / 620 Nations Technologies Inc. Tel:+86-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: Lptim Registers

    Reserved Reset Value LPTIM_INTCLR 004h Reserved Reset Value LPTIM_INTEN 008h Reserved Reset Value LPTIM_CFG 00Ch Reserved Reset Value 325 / 620 Nations Technologies Inc. Tel:+86-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: Lptim Interrupt And Status Register (Lptim_Intsts)

    CMPM Compare match. Hardware set this to inform application that LPTIM_CNT register value reached the LPTIM_COMP register's value. 326 / 620 Nations Technologies Inc. Tel:+86-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 Interrupt Clear Register (Lptim_Intclr)

    Note: The LPTIM_INTEN register must only be modified when the LPTIM is disabled (LPTIM_CTRL.LPTIMEN bit reset to ‘0’) Bit Field Name Description 31:7 Reserved Reserved, the reset value must be maintained. 327 / 620 Nations Technologies Inc. Tel:+86-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 Configuration Register (Lptim_Cfg)

    Non-Orthogonal mode enable 0: Non-Orthogonal mode disabled 1: Non-Orthogonal mode enabled Encoder mode enable 0: Encoder mode disabled 328 / 620 Nations Technologies Inc. Tel:+86-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 Trigger selector The trigger source is selected from the following 6 available sources as the trigger event for LPTIM: 329 / 620 Nations Technologies Inc. Tel:+86-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 11: External clock signal level change must be stable for at least 8 clock periods 330 / 620 Nations Technologies Inc. Tel:+86-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 Control Register (Lptim_Ctrl)

    LPTIM_ARR and LPTIM_CNT registers and the LPTIM counter keeps counting in Continuous mode. 331 / 620 Nations Technologies Inc. Tel:+86-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: Lptim Compare Register (Lptim_Comp)

    Note: The LPTIM_ARR register must only be modified when the LPTIM is enabled (LPTIM_CTRL.LPTIMEN bit reset to ‘1’) 332 / 620 Nations Technologies Inc. Tel:+86-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: Lptim Counter Register (Lptim_Cnt)

    If identical, the reading is reliable. 333 / 620 Nations Technologies Inc. Tel:+86-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: 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) 334 / 620 Nations Technologies Inc. Tel:+86-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: 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. 335 / 620 Nations Technologies Inc. Tel:+86-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: Debug Mode

    Pre-scale register and reload register controls the time that generates reset, as shown in Table 13-1. 336 / 620 Nations Technologies Inc. Tel:+86-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: Iwdg Registers

    Reset value IWDG_STS 0x0C Reserved Reset value 13.5.2 IWDG key register (IWDG_KEY) Address offset: 0x00 Reset value: 0x00000000 337 / 620 Nations Technologies Inc. Tel:+86-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: Iwdg Pre-Scaler Register (Iwdg_Prediv)

    Therefore, the read value is valid only when the IWDG_STS.PVU bit is ‘0’. 13.5.4 IWDG reload register (IWDG_RELV) Address offset: 0x08 Reset value: 0x00000FFF 338 / 620 Nations Technologies Inc. Tel:+86-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: Iwdg Status Register (Iwdg_Sts)

    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. 339 / 620 Nations Technologies Inc. Tel:+86-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: Window Watchdog (Wwdg)

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

    MCU. Counter count down from 0x7F to 0x3F using scaled APB1 341 / 620 Nations Technologies Inc. Tel:+86-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: 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. 342 / 620 Nations Technologies Inc. Tel:+86-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: Wwdg Registers

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

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

     At the end of injection conversion  Analog watchdog event  Data alignment with embedded data consistency 345 / 620 Nations Technologies Inc. Tel:+86-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: Function Description

    ADC input voltage range: 0≤ V ≤V 15.3 Function Description 15-1 is a functional block diagram of an ADC. Figure 346 / 620 Nations Technologies Inc. Tel:+86-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: Figure 15-1 Block Diagram Of A Single Adc

    开始触发 ADC_ETRGINJ_EXTISEL选择位 (注入组) EXTIx ADC_ETRGINJ_REMAP控制位 EXTRSEL(2:0)控制位 EXTRTRIG控制位 TIM1_CH1 TIM1_CH2 开始触发 TIM1_CH3 (规则组) TIM3_TRGO TIM4_CH4 ADC_ETRGREG_EXTISEL选择位 EXTIx TIM8_TRGO ADC_ETRGREG_REMAP控制位 347 / 620 Nations Technologies Inc. Tel:+86-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: Adc Clock

    When switching the ADC clock source to ADC_1M, it is necessary to ensure that the HSI clock is enabled. 348 / 620 Nations Technologies Inc. Tel:+86-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: Adc Switch Control

    The ADC_RSEQ1.LEN[3:0] bits specified regular channel sequence length. 349 / 620 Nations Technologies Inc. Tel:+86-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: Internal Channel

    (ADC_CTRL1.ENDCIEN) is set to 1 at this time, an interrupt will be generated . The converted data will be stored in the ADC_DAT register. 350 / 620 Nations Technologies Inc. Tel:+86-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: Timing Diagram

    1, if ADC_CTRL1.AWDGIEN has been configured to 1, an interrupt will be generated at this time. The analog watchdog can be controlled for one or more channels by configuring ADC_CTRL1.AWSGSGLEN and ADC_CTRL1.AWDGCH[4:0]. 351 / 620 Nations Technologies Inc. Tel:+86-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: Scan Mode

    If a regular event is generated during the injection conversion, the regular sequence channel will start conversion after the 352 / 620 Nations Technologies Inc. Tel:+86-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: Discontinuous Mode

    Injection channels Configure ADC_CTRL1.DJCH to 1 to enable the discontinuous mode on the injection channel, obtain the injection 353 / 620 Nations Technologies Inc. Tel:+86-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: Data Aligned

    The total conversion time is calculated as follows: = Sampling time + 12 cycles CONV 354 / 620 Nations Technologies Inc. Tel:+86-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: Externally Triggered Conversion

    Table 15-6 ADC is used for external triggering of injection channels EXTJSEL[2:0] Trigger source Type TIM1_TRGO event TIM1_CC4 event Internal signal from the on-chip timer 355 / 620 Nations Technologies Inc. Tel:+86-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: Dma Requests

    Not suitable for measuring absolute temperature. When accurate temperature measurement is required, an external temperature sensor should be used. 356 / 620 Nations Technologies Inc. Tel:+86-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: Temperature Sensor Using Flow

    ADC is powered on, so in order to shorten the delay, the ADC_CTRL2.TEMPEN and ADC_CTRL2.ON bits should be set at the same time. 357 / 620 Nations Technologies Inc. Tel:+86-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: Adc Interrupt

    004h Reserved Reset Value ADC_CTRL2 008h Reserved Reset Value ADC_SAMPT1 00Ch Reserved Reset Value ADC_SAMPT2 010h Reset Value 358 / 620 Nations Technologies Inc. Tel:+86-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: Adc Status Register (Adc_Sts)

    Reset Value ADC_CTRL3 054h Reserved Reset Value 15.10.2 ADC status register (ADC_STS) Address offset: 0x00 Reset value: 0x0000 0000 359 / 620 Nations Technologies Inc. Tel:+86-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: Adc Control Register 1 (Adc_Ctrl1)

    1: Analog watchdog event occurs. 15.10.3 ADC control register 1 (ADC_CTRL1) Address offset: 0x04 Reset value: 0x0000 0000 360 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 361 0: Disable automatic injection channel conversion. 1: Enable automatic injection channel conversion. 361 / 620 Nations Technologies Inc. Tel:+86-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 10000: ADC analog input channel 16 10001: ADC analog input channel 17 10010: ADC analog input channel 18 362 / 620 Nations Technologies Inc. Tel:+86-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: 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 363 / 620 Nations Technologies Inc. Tel:+86-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 Note: If there are other bits changed in this register along with ON, the conversion will not be 364 / 620 Nations Technologies Inc. Tel:+86-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: Adc Sampling Time Register 1 (Adc_Sampt1)

    VREFINT, respectively. 15.10.6 ADC sampling time register 2 (ADC_ SAMPT2) Address offset: 0x10 Reset value: 0x0000 0000 365 / 620 Nations Technologies Inc. Tel:+86-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: Adc Sampling Time Register 3 (Adc_Sampt3)

    0100: 29 cycles 1100: 300 cycles 0101: 42 cycles 1101: 400 cycles 0110: 56 cycles 1110: 480 cycles 366 / 620 Nations Technologies Inc. Tel:+86-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: Adc Injected Channel Data Offset Register X (Adc_Joffsetx) (X=1

    These bits define the high thresholds for analog watchdog. 15.10.10 ADC watchdog low threshold register (ADC_WDGLOW) Address offset: 0x2C Reset value: 0x0000 0000 367 / 620 Nations Technologies Inc. Tel:+86-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: Adc Regular Sequence Register 1 (Adc_Rseq1)

    13th conversion in regular sequence 15.10.12 ADC regular sequence register 2 (ADC_RSEQ2) Address offset: 0x34 Reset value: 0x0000 0000 368 / 620 Nations Technologies Inc. Tel:+86-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: Adc Regular Sequence Register 3 (Adc_Rseq3)

    SEQ3[4:0] 3rd conversion in regular sequence SEQ2[4:0] 2nd conversion in regular sequence SEQ1[4:0] 1st conversion in regular sequence 369 / 620 Nations Technologies Inc. Tel:+86-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: Adc Injection Sequence Register (Adc_Jseq)

    15.10.15 ADC injection data register x (ADC_JDATx) (x= 1…4) Address offset: 0x40 - 0x4C Reset value: 0x0000 0000 370 / 620 Nations Technologies Inc. Tel:+86-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: Adc Regulars Data Register (Adc_Dat)

    This bit is set and cleared by the software to enable/disable the injection channel conversion end interrupt 0: ADC_STS.JENDCA interrupt is disabled 1: ADC_STS.JENDCA interrupt is enabled 371 / 620 Nations Technologies Inc. Tel:+86-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 0: The reference source is the external reference VDD 1: The reference source is the internal voltage 2.4V 372 / 620 Nations Technologies Inc. Tel:+86-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: Comparator (Comp)

    16.1 COMP system connection block diagram The COMP module supports an independent comparator, which is connected to the APB1 bus. 373 / 620 Nations Technologies Inc. Tel:+86-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: Comp Features

    LPRUN, SLEEP, and STOP modes.  Built-in two 64-level programmable reference input comparison voltage source VREF1, VREF2 374 / 620 Nations Technologies Inc. Tel:+86-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: Comp Configuration Process

    Note: For the above steps, you need to turn on the filter enable first, and then turn on the comparator enable. The comparator enable needs to be enabled after the filter (if enabled) configuration and enable are completed. In 375 / 620 Nations Technologies Inc. Tel:+86-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: Comp Working Mode

    For the interconnection of the comparator output ports, please refer to the AFIO remapping chapter,Remap IO multiplexing function in GPIOx_AFL/AFH. COMP1_OUT can be mapped to PA0/PA6/PA9/PA11/PA13/PA15 COMP2_OUT can be mapped to PA2/PA4/PA7/PA10/PA12/PA14 376 / 620 Nations Technologies Inc. Tel:+86-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 TIM1_BKIN + TIM8_BKIN TIM1_BKIN + TIM8_BKIN TIM1_BKIN + TIM8_BKIN 1100 TIM8_BKIN TIM8_BKIN TIM8_BKIN 1101 LPTIM_ETR LPTIM_ETR LPTIM_ETR Other 377 / 620 Nations Technologies Inc. Tel:+86-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: Interrupt

    Reserved Reset Value COMP1_FILC SAMPWIN[4:0] THRESH[4:0] 014h Reserved Reset Value COMP1_FILP CLKPSC[15:0] 018h Reserved Reset Value 01Ch Reserved 378 / 620 Nations Technologies Inc. Tel:+86-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: Comp Interrupt Enable Register (Comp_Inten)

    Bit field Name Description 31:3 Reserved Reserved,the reset value must be maintained CMP3IEN COMP3 interrupt enable 0: disable 379 / 620 Nations Technologies Inc. Tel:+86-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: Comp Interrupt Register (Comp_Intsts)

    Address offset : 0x08 Reset value : 0x0000 0000 Bit field Name Description 31:3 Reserved Reserved,the reset value must be maintained 380 / 620 Nations Technologies Inc. Tel:+86-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: Comp Lock Register(Comp_Lock)

    COMP1_CTRL register will become a read-only register 0: COMP1_CTRL can be read and written 1: COMP1_CTRL read only 381 / 620 Nations Technologies Inc. Tel:+86-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: Comp1 Control Register (Comp1_Ctrl)

    OUTTRG[3:0] These bits select which Timer input must be connected with the COMP1 output. 0000:Reserved 0001:TIM1_BKIN 0010:TIM1_IC1 0011:TIM1_OCrefclear 382 / 620 Nations Technologies Inc. Tel:+86-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: Comp1 Filter Control Register (Comp1_Filc)

    This bit switches COMP1 ON/OFF. 0: Disable 1: Enable 16.7.7 COMP1 filter control register (COMP1_FILC) Address offset : 0x14 383 / 620 Nations Technologies Inc. Tel:+86-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: Comp1 Filter Frequency Division Register (Comp1_Filp)

    2: Every 3 cycle … 16.7.9 COMP2 control register (COMP2_CTRL) Address offset : 0x20 Reset value : 0x0000 0000 384 / 620 Nations Technologies Inc. Tel:+86-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 These bits select which Timer input must be connected with the COMP2 output. 0000:Reserved 0001:TIM1_BKIN 0010:TIM1_IC1 0011:TIM1_OCrefclear 0100:TIM8_IC1 0101:TIM8_OCrefclear 0110:TIM3_IC2 0111:TIM3_OCrefclear 1000:Reserved 1001:TIM4_IC2 1010:TIM4_OCrefclear 1011:TIM1_BKIN + TIM8_BKIN 385 / 620 Nations Technologies Inc. Tel:+86-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: Comp2 Filter Control Register (Comp2_Filc)

    0: Disable 1: Enable 16.7.10 COMP2 filter control register (COMP2_FILC) Address offset : 0x24 Reset value : 0x0000 0000 386 / 620 Nations Technologies Inc. Tel:+86-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: Comp2 Filter Frequency Division Register (Comp2_Filp)

    2: Every 3 cycle … 16.7.12 COMP3 control register (COMP3_CTRL) Address offset : 0x30 Reset value : 0x0000 0000 387 / 620 Nations Technologies Inc. Tel:+86-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 1011:TIM1_BKIN + TIM8_BKIN 1100:TIM8_BKIN 1101:LPTIM_ETR others:Reserved INPSEL[2:0] COMP3 Non-inverting input selection 000:PF1 001:PC7 010:PA11 011:PF6 100:Reserved 101:Reserved 110:VREF2 388 / 620 Nations Technologies Inc. Tel:+86-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: Comp3 Filter Control Register (Comp3_Filc)

    1: Enable 16.7.14 COMP3 filter frequency division register (COMP3_FILP) Address offset : 0x38 Reset value : 0x0000 0000 389 / 620 Nations Technologies Inc. Tel:+86-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: Comp Reference Input Compare Voltage Register (Comp_Invref)

    Comparator reference input comparison voltage VREF1 gear selection 0~VDDA, a total of 64 gears VREF1EN Comparator reference input compare voltage VREF1 enable 0: disable 1: enable 390 / 620 Nations Technologies Inc. Tel:+86-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: C Interface

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

    The block diagram of I C interface is shown in the figure below. 392 / 620 Nations Technologies Inc. Tel:+86-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: Figure 17-1 I2C Functional Block Diagram

    So some mechanisms are needed to grant a master the access to the bus. This process is generally named Clock Synchronization and Arbitration. 393 / 620 Nations Technologies Inc. Tel:+86-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 Each I2C device is identified by a unique address. According to the device function, they can be either a transmitter or a receiver. 394 / 620 Nations Technologies Inc. Tel:+86-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 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. 395 / 620 Nations Technologies Inc. Tel:+86-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: Figure 17-3 Slave Transmitter Transfer Sequence Diagram

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

    When the START condition is generated on the 397 / 620 Nations Technologies Inc. Tel:+86-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 I2C_STS1.TXDATE is cleared at this time. At any time, as long as there is data waiting to be sent and the I2C_STS1.TXDATE bit is set to 1, the software can write a byte to the I2C_DAT register. 398 / 620 Nations Technologies Inc. Tel:+86-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: Figure 17-5 Master Transmitter Transfer Sequence Diagram

    The software sequence of EV8 must be completed before the end of the current byte transfer. 399 / 620 Nations Technologies Inc. Tel:+86-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 1, an acknowledge pulse will be sent. At this time, the software can read the first byte from the I2C_DAT 400 / 620 Nations Technologies Inc. Tel:+86-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: Figure 17-6 Master Receiver Transfer Sequence Diagram

    I2C_CTRL1.STOPGEN=1. 6. EV9: I2C_STS1.ADDR10F=1, reading STS1 and then writing to the DAT register will clear this event. Note: 401 / 620 Nations Technologies Inc. Tel:+86-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: Error Conditions Description

    And software should clear I2C_STS1.RXDATNE bit, transmitter retransmit last byte. When I2C interface is sending data (I2C_STS1.TXDATE=1, new data have not sending to register), and I2C_DAT 402 / 620 Nations Technologies Inc. Tel:+86-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: Dma Application

    DMA ocurrs a interrrupt. Note: if DMA is used for transmission, do not set I2C_CTRL2.BUFINTEN bit. 403 / 620 Nations Technologies Inc. Tel:+86-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: Receive Process

    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. 404 / 620 Nations Technologies Inc. Tel:+86-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: Smbus

    It is mainly used to transmit ON/OFF instructions for power unit and provide a control bus for system and power management-related tasks. 405 / 620 Nations Technologies Inc. Tel:+86-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: Device Identification

    A device which only has slave function can set I2C_CTRL1.SMBALERT bit to indicate it want to communicate with host. The host handles the interrupt and accesses all SMBALERT devices through the ARA (Alert Response Address, 406 / 620 Nations Technologies Inc. Tel:+86-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: Debug Mode

    ADDR10F Received stop (slave) STOPF Data byte transfer completed. Receive buffer is not empty. RXDATNE EVTINTEN and BUFINTEN 407 / 620 Nations Technologies Inc. Tel:+86-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: I2C Registers

    Reset Value I2C_OADDR2 ADDR2[7:1] 00Ch Reserved Reset Value I2C_DAT DATA[7:0] 010h Reserved Reset Value I2C_STS1 014h Reserved Reset Value 408 / 620 Nations Technologies Inc. Tel:+86-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: I2C Control Register 1 (I2C_Ctrl1)

    0: I2C_CTRL1.ACKEN bit determines whether to send an ACK to the byte currently being received; I2C_CTRL1.PEC bit indicates that the byte in the current shift register is PEC. 409 / 620 Nations Technologies Inc. Tel:+86-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 0:Disable General call. not respond(NACK) to the address 00h; 1:Enable General call. respond(ACK) the address 00h. PEC enable PECEN 0:Disable PEC module; 410 / 620 Nations Technologies Inc. Tel:+86-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: I2C Control Register 2 (I2C_Ctrl2)

    0: Disable DMA 1: Enable DMA BUFINTEN Buffer interrupt enable 0: When I2C_STS1.TXDATE=1 or I2C_STS1.RXDATNE=1, any interrupt is not generated. 411 / 620 Nations Technologies Inc. Tel:+86-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: I2C Own Address Register 1 (I2C_Oaddr1)

    000001:Disable 000010:2MHz 000011:3MHz 110000:48MHz 110001~111111:Disable. I2C Own address register 1 (I2C_OADDR1) 17.6.4 Address offset: 0x08 Reset value: 0x0000 412 / 620 Nations Technologies Inc. Tel:+86-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: I2C Own Address Register 2 (I2C_Oaddr2)

    Note: Valid only for 7-bit address mode 17.6.6 I2C Data register (I2C_DAT) Address offset: 0x10 Reset value: 0x0000 413 / 620 Nations Technologies Inc. Tel:+86-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: I2C Status Register 1 (I2C_Sts1)

    Writing ‘0’ to this bit by software can clear it, or it is cleared by hardware when I2C_CTRL1.EN=0. 414 / 620 Nations Technologies Inc. Tel:+86-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 If a NACK is received, or the next byte to be sent is PEC(I2C_CTRL1.PEC=1), this bit will not be set. 415 / 620 Nations Technologies Inc. Tel:+86-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 (I2C_STS1.TXDATE=1). Note: After receiving a NACK, the BSF bit will not be set. 416 / 620 Nations Technologies Inc. Tel:+86-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: I2C Status Register 2 (I2C_Sts2)

    SMBus host header(Slave mode) Hardware clears this bit when a stop condition or a repeated start condition is generated, or 417 / 620 Nations Technologies Inc. Tel:+86-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: I2C Clock Control Register (I2C_Clkctrl)

    10 MHz, so that a fast clock of 400KHz can be generated PCLK1 418 / 620 Nations Technologies Inc. Tel:+86-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: I2C Rise Time Register (I2C_Tmrise)

    4. These delays have no filters; I2C Rise time register (I2C_TMRISE) 17.6.10 Address offset: 0x20 Reset value: 0x0002 419 / 620 Nations Technologies Inc. Tel:+86-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 If the result is not an integer, write the integer part to TMRISE[5:0] to ensure the t parameter. HIGH Note: TMRISE[5:0] can only be set when I2C is disabled (EN=0). 420 / 620 Nations Technologies Inc. Tel:+86-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: Universal Synchronous Asynchronous Receiver Transmitter (Usart)

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

    Among them, TX is the output pin for serial data transmission. When the transmitter is active 422 / 620 Nations Technologies Inc. Tel:+86-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: Usart Frame Format

    A break frame is a complete data frame consisting of '0's, including the stop bit. at the end of the break frame, the transmitter inserts 1 or 2 more stop bits ('1') to acknowledge the start bit. 423 / 620 Nations Technologies Inc. Tel:+86-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: Transmitter

    USART_CTRL1.TXEN is reset during a data transfer, it will cause the baud rate counter to stop counting and the data being transferred will be corrupted. 424 / 620 Nations Technologies Inc. Tel:+86-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: Table 18-1 Stop Bit Configuration

    9-bit data, the break frame consists of 11 bits of low level, 425 / 620 Nations Technologies Inc. Tel:+86-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: Figure 18-5 Transmisson Delay

    Bit 7 Bit 2 Bit 4 Bit 2 Bit 4 Baud rate:100K Stop bits:1 Data bits:8 Parity:None Data: 0x55 426 / 620 Nations Technologies Inc. Tel:+86-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: Single Byte Communication

    Because TXDE=1 TXC is set TXC flag Set by hardware Frame 1 Frame 2 Idle Frame 3 TX line 427 / 620 Nations Technologies Inc. Tel:+86-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: Receiver

    Return to idle state and wait for falling edge. Figure 18-7 Start bit detection 428 / 620 Nations Technologies Inc. Tel:+86-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 1 clock cycle, which is sampled at the midpoint of this period of time. For details, see 18.4.14 Smartcard mode. 429 / 620 Nations Technologies Inc. Tel:+86-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: Framing Error

    A framing error occurs when a stop bit is not received and recognized at the expected time. At this time, the frame 430 / 620 Nations Technologies Inc. Tel:+86-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: Overrun Error

    Received bits Data validity Effective be invalid be invalid be invalid be invalid be invalid be invalid Effective 431 / 620 Nations Technologies Inc. Tel:+86-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: Generation Of Fractional Baud Rate

    Closest integer: 16 = 0x10 => DIV_Decimal[3:0] overrun => carry must be added to the fractional part DIV_Integer = DIV_Integer (0d50.990+carry) = 51 = 0x33 So: USART_BRCF= 0x330, USARTDIV = 0d51.00 432 / 620 Nations Technologies Inc. Tel:+86-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: Receiver's Tolerance Clock Deviation

    The tolerance of the USART receiver is equal to the maximum tolerable variation. 433 / 620 Nations Technologies Inc. Tel:+86-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: Parity Control

    USART_STS.PEF flag is set to '1', and if USART_CTRL1.PEIEN is enabled, an interrupt is generated. Odd parity Configure USART_CTRL1.PSEL to 1, you can choose odd parity. 434 / 620 Nations Technologies Inc. Tel:+86-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: Dma Application

    5. Start the channel. 6. After the data transfer is completed, the transfer complete flag (DMA_INTSTS.TXCFx) is set to 1. 435 / 620 Nations Technologies Inc. Tel:+86-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: Figure 18-8 Transmission Using Dma

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

    USART supports hardware flow control. The purpose is to coordinate the sending and receiving parties so that the data will not be lost. The connection method is shown in the following figure. 437 / 620 Nations Technologies Inc. Tel:+86-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: Figure 18-10 Hardware Flow Control Between Two Usart

    The low level is valid, and the low level indicates that the device can send data to the other device. If 438 / 620 Nations Technologies Inc. Tel:+86-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: Multiprocessor Communication

    The USART can wake up from mute mode by idle line detection or address mark detection. 18.4.9.1 Idle line detection The idle line detection configuration process is as follows: 439 / 620 Nations Technologies Inc. Tel:+86-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: Figure 18-13 Mute Mode Using Idle Line Detection

    When the received address does not match the address of the USART_CTRL2.ADDR[3:0] bits, USART_CTRL1.RCVWU is written to 1 by hardware. 440 / 620 Nations Technologies Inc. Tel:+86-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: Synchronous Mode

    0 (USART_CTRL2.CLKPHA=0), the data is sampled on the first edge of the clock; when the phase polarity is 1 (USART_CTRL2.CLKPHA=1), the data is sampled on the second edge. 441 / 620 Nations Technologies Inc. Tel:+86-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: Figure 18-15 Usart Synchronous Transmission Example

    But setup time and hold time (depending on baud rate, 1/16 bit time) must be considered. Figure 18-15 USART synchronous transmission example 442 / 620 Nations Technologies Inc. Tel:+86-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: Figure 18-16 Usart Data Clock Timing Example (Wl=0)

    Clock(CLKPOL=0,CLKPHA=0) Clock(CLKPOL=0,CLKPHA=1) Clock(CLKPOL=1,CLKPHA=0) Clock(CLKPOL=1,CLKPHA=1) Data on TX (from master) MSB Stop Start LSB Data on RX (from slave) 443 / 620 Nations Technologies Inc. Tel:+86-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: Figure 18-17 Usart Data Clock Timing Example (Wl=1)

    Note: the function of CK is different in Smartcard mode, please refer to the Smartcard mode section for details. 444 / 620 Nations Technologies Inc. Tel:+86-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: Single-Wire Half-Duplex Mode

    The transmit encoder output has opposite polarity to the decoder input. When idle, SIR transmit is low, while SIR 445 / 620 Nations Technologies Inc. Tel:+86-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: Irda Low Power Mode

    Figure 18-19 IrDASIRENDEC-Block diagram TX pin Transmit Encoder IRDAMEN NORMAL = 0 or 1 USART MODE Receive RX pin Decoder 446 / 620 Nations Technologies Inc. Tel:+86-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: Lin Mode

    RX line has gone back to high.An interrupt is generated if the LIN breaker detection interrupt (USART_CTRL2.LINBDIEN) is enabled. 447 / 620 Nations Technologies Inc. Tel:+86-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: Figure 18-21 Break Detection In Lin Mode (11-Bit Break Length-The Linbdl Bit Is Set)

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

    In smart card mode, the data bits should be configured as 8 bits, and the parity bit should be configured. 449 / 620 Nations Technologies Inc. Tel:+86-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: Figure 18-23 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. 450 / 620 Nations Technologies Inc. Tel:+86-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: Interrupt Request

    RXDNEIEN Data overrun error detected. ORERR IDLEF Idle line detected IDLEIEN Parity error PEIEN Disconnect flag LINBDF LINBDIEN 451 / 620 Nations Technologies Inc. Tel:+86-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: 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 452 / 620 Nations Technologies Inc. Tel:+86-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: Usart Status Register (Usart_Sts)

    This bit is cleared by software. 0: LIN break character not detected. 1: LIN break character detected. 453 / 620 Nations Technologies Inc. Tel:+86-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 0: No noise error detected. 1: Noise error detected. Note: this bit will not generate an interrupt because it appears with 454 / 620 Nations Technologies Inc. Tel:+86-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: Usart Data Register (Usart_Dat)

    Reset value : undefined (uncertain value) Bit field Name Description 31:9 Reserved Reserved, the reset value must be maintained 455 / 620 Nations Technologies Inc. Tel:+86-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: Usart Baud Rate Register (Usart_Brcf)

    When this bit is cleared, the divider and output of USART stop working after the current byte transmission is completed to reduce power consumption. Software can set or clear 456 / 620 Nations Technologies Inc. Tel:+86-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 1: IDLE line detection interrupt is enabled. TXEN Transmitter enable. 0: The transmitter is disabled. 1: the transmitter is enabled. RXEN Receiver enable 457 / 620 Nations Technologies Inc. Tel:+86-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: Usart Control Register 2 Register (Usart_Ctrl2)

    Note: For UART5/6, only one stop bit and two stop bits are valid. CLKEN Clock enable 0:CK pin is disabled 458 / 620 Nations Technologies Inc. Tel:+86-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 USART will be awakened. Note: These three bits (USART_CTRL2.CLKPOL, USART_CTRL2.CLKPHA, USART_CTRL2.LBCLK) cannot be overwritten after enabling transmission. 459 / 620 Nations Technologies Inc. Tel:+86-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: Usart Control Register 3 Register (Usart_Ctrl3)

    SCNACK Smartcard NACK enable. This bit is used for Smartcard mode to enable transmitting NACK when parity error 460 / 620 Nations Technologies Inc. Tel:+86-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: Usart Guard Time And Prescaler Register (Usart_Gtp)

    The setting time of USART_STS.TXC flag is delayed by GTV[7:0] baud clock cycles. Note: This bit is invalid for UART5/6. PSCV[7:0] Prescaler value. 461 / 620 Nations Technologies Inc. Tel:+86-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 1111: Divide the source clock by 62. In Smartcard mode, PSCV[7:5] is reserved. Note: This bit is invalid for UART5/6. 462 / 620 Nations Technologies Inc. Tel:+86-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: Low Power Universal Asynchronous Receiver Transmitter (Lpuart)

     Start bit detection  Receive buffer non-empty detection  A configurable receive byte  A programmable 4-byte frame 463 / 620 Nations Technologies Inc. Tel:+86-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: 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: 464 / 620 Nations Technologies Inc. Tel:+86-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: 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. 465 / 620 Nations Technologies Inc. Tel:+86-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 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. 466 / 620 Nations Technologies Inc. Tel:+86-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: Receiver

    LPUART_DAT register contains a buffer between the internal APB bus and the receive shift register. The steps for LPUART to receive data are as follows: 467 / 620 Nations Technologies Inc. Tel:+86-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 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. 468 / 620 Nations Technologies Inc. Tel:+86-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: Fractional Baud Rate Generation

    Baud rate frequency division coefficient (LPUARTDIV) has the following relationship with system clock (PCLK) : TX/RX baud rate = �� /(LPUARTDIV) 469 / 620 Nations Technologies Inc. Tel:+86-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 Note: The lower the clock frequency of the CPU, the lower the accuracy of a particular baud rate. 470 / 620 Nations Technologies Inc. Tel:+86-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: 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. 471 / 620 Nations Technologies Inc. Tel:+86-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 19-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. 472 / 620 Nations Technologies Inc. Tel:+86-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: Hardware Flow Control

    RX control TX control RTS and CTS flow control can be independently enabled by setting LPUART_CTRL.RTSEN and LPUART_CTRL.CTSEN. 473 / 620 Nations Technologies Inc. Tel:+86-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 19-8 Rts Flow Control

    If CTS flow control is enabled (LPUART_CTRL.CTSEN=1), the signal of CTS pin will be changed. See Figure 19-9 for enabling CTS flow control. 474 / 620 Nations Technologies Inc. Tel:+86-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: Low Power Wake Up

    Parity check error PEIE TX complete TXCIE LPUART global interrupt Receive buffer overrun FIFO_OV FIFO_OVIE Receive buffer full FIFO_FU FIFO_FUIE 475 / 620 Nations Technologies Inc. Tel:+86-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: Lpuart Registers

    Reset Value LPUART_WUDAT WUDAT[31:0] 018h Reset Value 19.6.2 LPUART status register (LPUART_STS) Address offset: 0x00 Reset value: 0x0000 0000 476 / 620 Nations Technologies Inc. Tel:+86-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: Lpuart Interrupt Enable Register (Lpuart_Inten)

    0: No parity error detected. 1: Parity error detected 19.6.3 LPUART interrupt enable register (LPUART_INTEN) Address offset: 0x04 Reset value: 0x0000 0000 477 / 620 Nations Technologies Inc. Tel:+86-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: Lpuart Control Register (Lpuart_Ctrl)

    10) 1: 1 sample bits, closed noise detection 13:12 WUSEL[1:0] Wake up event selection. 478 / 620 Nations Technologies Inc. Tel:+86-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: Lpuart Baud Rate Configuration Register 1 (Lpuart_Brcfg1)

    1: Odd parity 19.6.5 LPUART baud rate configuration register 1 (LPUART_BRCFG1) Address offset: 0x0C Reset value: 0x0000 0174 479 / 620 Nations Technologies Inc. Tel:+86-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: Lpuart Data Register (Lpuart_Dat)

    Read the data register when receiving 19.6.7 LPUART baud rate configuration register 2 (LPUART_BRCFG2) Address offset: 0x14 Reset value: 0x0000 0000 480 / 620 Nations Technologies Inc. Tel:+86-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: Lpuart Wake Up Data Register (Lpuart_Wudat)

    LPUART_CTRL.WUSEL[1:0] = 11 is used to wake up frame matching. In this case, all 4 bytes are valid 481 / 620 Nations Technologies Inc. Tel:+86-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: Serial Peripheral Interface/Inter-Ic Sound (Spi/ I2S)

     Steady state clock polarity programmable.  The data direction is always MSB first.  Supports DMA function. 482 / 620 Nations Technologies Inc. Tel:+86-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: 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. 483 / 620 Nations Technologies Inc. Tel:+86-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: Figure 20-2 Selective Management Of Hardware/Software

    Internal NSS SSEL The following figure is an example of the interconnection of single master and single slave devices. 484 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 485: Figure 20-3 Master And Slave Applications

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

    SPI_CTRL1.LSBFF bit, the data bits follow the MSB or LSB order is serially shifted to the MOSI pin. At the 486 / 620 Nations Technologies Inc. Tel:+86-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: Figure 20-5 Schematic Diagram Of The Change Of Te/Rne/Busy When The Host Is Continuously Transmitting In

    The software operation process is as follows: Enable SPI module, set SPI_CTRL1.SPIEN = 1. 487 / 620 Nations Technologies Inc. Tel:+86-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: Figure 20-6 Schematic Diagram Of Te/Busy Change When The Host Transmits Continuously In One-Way Only Mode

    SPI_STS.RNE bit will be cleared by hardware while reading SPI_DAT register. Repeat this operation to receive all data. 488 / 620 Nations Technologies Inc. Tel:+86-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: Figure 20-7 Schematic Diagram Of Rne Change When Continuous Transmission Occurs In Receive-Only Mode

    Before the master starts data transfer, software must ensure that the data to be send is written to the SPI_DAT register. 489 / 620 Nations Technologies Inc. Tel:+86-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: Figure 20-8 Schematic Diagram Of The Change Of Te/Rne/Busy When The Slave Is Continuously Transmitting In

    Slave two-wire one-way receive-only mode (SPI_CTRL1.MSEL = 0, SPI_CTRL1.BIDIRMODE = 0 and SPI_CTRL1.RONLY = 1).The data receiving process begins when the slave device receives the clock signal and the 490 / 620 Nations Technologies Inc. Tel:+86-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 In master mode, the sending process starts when data is written to the send buffer. If the next data has been written into the SPI_DAT register before the current data frame sending is completed, the continuous sending function can 491 / 620 Nations Technologies Inc. Tel:+86-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: Status Flag

    SPI_DAT register. When the send buffer is not empty, the hardware will clear this flag to 0. 492 / 620 Nations Technologies Inc. Tel:+86-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: Turn Off The Spi

    3. Wait for the last RNE (SPI_STS.RNE) to be set before entering shutdown mode (or turning off the SPI module 493 / 620 Nations Technologies Inc. Tel:+86-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: 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. 494 / 620 Nations Technologies Inc. Tel:+86-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: Crc Calculation

    SPI contains two independent CRC calculators for data sending and data reveiving to ensure the correctness of data transmission. According to the sending and receiving data frame format, CRC adopts different calculation methods, 495 / 620 Nations Technologies Inc. Tel:+86-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: Error Flag

    At this time, the overflow flag SPI_STS.OVER bit is set to 1. An interrupt is generated if the user enables the corresponding interrupt (SPI_CTRL2.ERRINTEN = 1). All received data is lost, and the SPI_DAT register retains 496 / 620 Nations Technologies Inc. Tel:+86-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: Spi Interrupt

    Receive buffer non empty flag RNEINTEN Master mode failure event MODERR Overflow error OVER ERRINTEN CRC error flag CRCERR 497 / 620 Nations Technologies Inc. Tel:+86-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: 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; 498 / 620 Nations Technologies Inc. Tel:+86-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: Supported Audio Protocols

    (MSB) is sent and will change on the falling edge of the clock signal. 499 / 620 Nations Technologies Inc. Tel:+86-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 20-14 I S Philips Protocol Waveform (16/32-Bit Full Precision, Clkpol = 0)

    CPU will first read the SPI_DAT register to get 0x95AA, and then read the SPI_DAT register to get 0x6600 (only the upper 8-bit data is valid, and the lower 8-bit data is always 0). 500 / 620 Nations Technologies Inc. Tel:+86-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 (MSB) are generated simultaneously. The standard data receiving and sending processing mode is the same as I S Philips standard. 501 / 620 Nations Technologies Inc. Tel:+86-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 20-17 The Msb Is Aligned With 16-Bit Or 32-Bit Full Precision, Clkpol = 0

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

    Figure 20-20 LSB alignment 16-bit or 32-bit full precision, CLKPOL = 0 Send Receive Left channel (16-bit or 32-bit) Right channel 503 / 620 Nations Technologies Inc. Tel:+86-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: Figure 20-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. 504 / 620 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 505: Figure 20-23 Pcm Standard Waveform (16 Bits)

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

    ���� ������ [ ( 32 × 2 ) × ( ( 2 × �������� ) + ������_��������) × 4] When MCLKOEN = 1 and CHBITS = 1, �� = �� ⁄ �� 506 / 620 Nations Technologies Inc. Tel:+86-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: I2S Send And Receive Sequence

    SPI_I2SCFG.CHBITS bit; 4. When user needs to enable interrupt or DMA, the configuration operation is the same as SPI; 507 / 620 Nations Technologies Inc. Tel:+86-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 SPI_STS.RNE flag bit is set to 1, the SPI_STS.CHSIDE value is updated. The operation of reading data depends on the selected I2S standard. See section 0 for details. 508 / 620 Nations Technologies Inc. Tel:+86-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: 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 buffer. When reading the SPI_DAT register, this flag is set to 0. BUSY flag (BUSY) 509 / 620 Nations Technologies Inc. Tel:+86-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: Error Flag

    Send buffer empty flag TEINTEN Receive buffer non empty flag RNEINTEN Underflow flag bit UNDER ERRINTEN Overflow flag bit OVER 510 / 620 Nations Technologies Inc. Tel:+86-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: Dma Function

    Reset Value 20.5.2 SPI control register 1 (SPI_CTRL1) (not used in I2S mode) Address: 0x00 Reset value: 0x0000 511 / 620 Nations Technologies Inc. Tel:+86-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 0: Full duplex (sending mode and receiving mode). 1: Disable output (receive-only mode). Note: Not used in I S mode. 512 / 620 Nations Technologies Inc. Tel:+86-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 0: In idle state, SCLK remains low. 1: In idle state, SCLK remains high. Note: This bit cannot be changed during communication. 513 / 620 Nations Technologies Inc. Tel:+86-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: 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 0: Disable send buffer DMA. 1: Enable send buffer DMA. 514 / 620 Nations Technologies Inc. Tel:+86-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: Spi Status Register (Spi_Sts)

    Note:This bit is set by hardware and cleared according to the sequence of software operations. For more information about software sequences, refer to 0 for details. 515 / 620 Nations Technologies Inc. Tel:+86-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: Spi Data Register (Spi_Dat)

    SPI_DAT[15:0]. 20.5.6 SPI CRC polynomial register (SPI_CRCPOLY) (not used in I S mode) Address: 0x10 Reset value: 0x0007 516 / 620 Nations Technologies Inc. Tel:+86-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: Mode)

    CRC8 standard; when the data frame format is 16 bits, all 16 bits in the register 517 / 620 Nations Technologies Inc. Tel:+86-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: Spi_ I 2 S Configuration Register(Spi_I2Scfg

    S Philips standard. 01: High byte alignment standard (left alignment). 10: Low byte alignment standard (right alignment). 11: PCM standard. 518 / 620 Nations Technologies Inc. Tel:+86-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: Spi_I 2 S Prescaler Register (Spi_I2Sprediv)

    Note: For correct operation, this bit can only be set when I S is turned off. Note: not used in SPI mode. 519 / 620 Nations Technologies Inc. Tel:+86-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 Note: For correct operation, this bit can only be set when I S is turned off. Note: not used in SPI mode. 520 / 620 Nations Technologies Inc. Tel:+86-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: Real-Time Clock (Rtc)

    SLEEP, STOP modes. 521 / 620 Nations Technologies Inc. Tel:+86-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 Alternatively a tamper event could be a source of Time-stamp event. Alarm A/Alarm B interrupt Wakeup interrupt Interrupts/events Timestamp interrupt Tamper interrupt 522 / 620 Nations Technologies Inc. Tel:+86-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: Rtc Function Description

     Alarm clock output (polarity configurable), Alarm A and Alarm B are optional.  Auto wakeup output (polarity configurable).  RTC input functions: 523 / 620 Nations Technologies Inc. Tel:+86-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: Gpios Of Rtc

    A 15-bit synchronous prescaler which is given by RTC_PRE.DIVS[14:0] bits The formula for f and f are given below: ck_apre ck_spre 524 / 620 Nations Technologies Inc. Tel:+86-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: Rtc Calendar

    (12 or 24 hours) by the RTC_CTRL.HFMT bit.  Exit initialization mode by clearing the RTC_INITSTS.INITM bit. 525 / 620 Nations Technologies Inc. Tel:+86-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: Calendar Reading

    Note: After read RTC_TSH or RTC_SUBS register, it needs to read RTC_DATE register once. 526 / 620 Nations Technologies Inc. Tel:+86-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: Calibration Clock Output

    RTC_CTRL.OPOL bit control the polarity of the Alarm A, Alarm B or Wakeup output. When RTC_CALIB or RTC_ALARM output is selected, the RTC_OUT pin (PC13) is automatically configured as 527 / 620 Nations Technologies Inc. Tel:+86-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: 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 528 / 620 Nations Technologies Inc. Tel:+86-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: 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. 529 / 620 Nations Technologies Inc. Tel:+86-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: Daylight Saving Time Configuration

    ) can be calculated by using the formula given below: ������_����������.����∗512−������_����������.����[8:0] = �� ∗ (1 + ������������ + ������_����������.����[8:0] – ������_����������.���� ∗ 512 Note: n=20/19/18 530 / 620 Nations Technologies Inc. Tel:+86-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: Rtc Low Power Mode

    The new calibration settings will take effect within 3 ck_apre cycles after a data write to the RTC_CALIB. 21.3.19 RTC low power mode The working state of RTC in low power mode. 531 / 620 Nations Technologies Inc. Tel:+86-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: Rtc Registers

    Reset Value RTC_SCTRL SUBF[14:0] 02Ch Reserved Reset Value RTC_TST HOT[1:0] HOU[3:0] MIT[2:0] MIU[3:0] SET[2:0] SEU[3:0] 030h Reserved Reset Value 532 / 620 Nations Technologies Inc. Tel:+86-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: Rtc Calendar Time Register (Rtc_Tsh)

    SCT[2:0] Describes the second tens value in BCD format SCU[3:0] Describes the second units value in BCD format 533 / 620 Nations Technologies Inc. Tel:+86-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: Rtc Calendar Date Register (Rtc_Date)

    31:24 Reserved Reserved, the reset value must be maintained. COEN Calibration output enable This bit controls RTC_CALIB output 534 / 620 Nations Technologies Inc. Tel:+86-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 0: Disable Alarm B interrupt 1: Enable Alarm B Interrupt ALAIEN Alarm A interrupt enable 0: Disable Alarm A interrupt 535 / 620 Nations Technologies Inc. Tel:+86-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 10x: ck_spre (usually 1Hz) clock is selected 11x: ck_spre (usually 1Hz) clock is selected and 2 is added to the RTC_WKUPT.WKUPT counter. 536 / 620 Nations Technologies Inc. Tel:+86-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: Rtc Initial Status Register (Rtc_Initsts)

    This flag must be cleared by software at least 1.5 RTCCLK periods before WTF is set again. ALBF Alarm B flag 537 / 620 Nations Technologies Inc. Tel:+86-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 This flag is set to ‘1’ by hardware when Alarm B values can be changed, after the RTC_CTRL.ALBEN bit has been set to 0. 538 / 620 Nations Technologies Inc. Tel:+86-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: Rtc Prescaler Register (Rtc_Pre)

    Name Description 31:16 Reserved Reserved, the reset value must be maintained. 15:0 WKUPT[15:0] Wake up auto-reload value bits 539 / 620 Nations Technologies Inc. Tel:+86-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: Rtc Alarm A Register (Rtc_Alarma)

    Describes the hour units value in BCD format MASK2 Alarm minutes mask 0: Minutes match 1: Minutes not match 540 / 620 Nations Technologies Inc. Tel:+86-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: Rtc Alarm B Register (Rtc_ Alarmb)

    Describes the minute tens value in BCD format 11:8 MIU[3:0] Describes the minute units value in BCD format 541 / 620 Nations Technologies Inc. Tel:+86-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: Rtc Write Protection Register (Rtc_Wrp)

    This value is the value of the synchronous prescaler counter. This sub-second value is calculated by the below formula: Sub-second value = (RTC_PRE.DIVS[14:0]-SS)/( RTC_PRE.DIVS[14:0]+1) 542 / 620 Nations Technologies Inc. Tel:+86-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: Rtc Shift Control Register (Rtc_Sctrl)

    When AD1S is set to 1, SUBF[14:0] cannot be all 0 21.4.13 RTC Timestamp Time Register (RTC_TST) Address offset: 0x30 Reset value: 0x0000 0000 543 / 620 Nations Technologies Inc. Tel:+86-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: Rtc Timestamp Date Register (Rtc_Tsd)

    Describes which Week day 000: Forbidden 001: Monday 111: Sunday Describes the month tens value in BCD format 544 / 620 Nations Technologies Inc. Tel:+86-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: Rtc Timestamp Sub-Second Register (Rtc_Tsss)

    This feature is intended to be used along with CM[8:0]. When RTCCLK frequency is 32768 Hz, the number of RTCCLK pulses added during a 32-second window is ((512 545 / 620 Nations Technologies Inc. Tel:+86-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: Rtc Tamper Configuration Register(Rtc_Tmpcfg

    1: Enabled tamper 2 interrupt TP1MF Tamper 1 mask flag 0: Not mask tamper 1 event. 1: Mask tamper 1 event. 546 / 620 Nations Technologies Inc. Tel:+86-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 TPFLT = 00, tamper detection is in edge mode: 0: Rising edge trigger a tamper detection event. 547 / 620 Nations Technologies Inc. Tel:+86-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: 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. 548 / 620 Nations Technologies Inc. Tel:+86-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: 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]. 549 / 620 Nations Technologies Inc. Tel:+86-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: Operational Amplifier(Opamp

    Gain-bandwidth product up to 2.5MHz  Support TIM1_CC6 automatically switches the input PIN of OPAMP  Support independent write protection 550 / 620 Nations Technologies Inc. Tel:+86-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: Opamp Function Description

    OPAMP are all connected to the external port, and the amplification factor is determined by the external resistance-capacitance network. 551 / 620 Nations Technologies Inc. Tel:+86-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: Opamp Follow Mode

    OPAMAP_CS.VMSSEL or OPAMAP_CS.VMSEL is connected to the output port from inside the chip. Unoccupied VM pins can be used as other GPIOs. 552 / 620 Nations Technologies Inc. Tel:+86-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: Opamp Internal Programmable Gain (Pga) Mode

    OPAMP_CS.PGAGAN to gain selection. The output of an OPAMP can be a resistive network. OPAMP's VM input pin can be used as a normal GPIOs. 553 / 620 Nations Technologies Inc. Tel:+86-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: Opamp Independent Write Protection

     Enable automatic switching function OPAMP_CS.TCMEN  Configure two conversion MUX configuration (VPSEL,VMSEL,VPSSEL,VMSSEL)  Start OPAMP and TIM 554 / 620 Nations Technologies Inc. Tel:+86-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: Opamp Registers

    22.3.1 OPAMP registers overview Table 22-1 OPAMP register overview Offset Register OPAMP_CS 000h Reserved Reset Value OPA_LOCK 004h Reserved Reset Value 555 / 620 Nations Technologies Inc. Tel:+86-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: Opamp Control Status Register (Opamp_Cs)

    1110 Reserve 0111 PB14 1111 Reserve VMSEL[2:0] OPAMP Inverted input selection Enumerated OPAMP Enumerated OPAMP value value Reserve 556 / 620 Nations Technologies Inc. Tel:+86-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: Opamp Lock Register (Opamp_Lock)

    After the reset, this bit can be written only once 0: The OPAMP register is readable and writable 1: The OPAMP register is read-only 557 / 620 Nations Technologies Inc. Tel:+86-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: Beeper

    0: There is only one output, and the other output is closed. 1: Both outputs are turned on, and the outputs are complementary 558 / 620 Nations Technologies Inc. Tel:+86-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 10010: H4 (Treble 4) 10011: H5 (Treble 5) 10100: H6 (Treble 6) 10101: H7 (Treble 7) default: … 559 / 620 Nations Technologies Inc. Tel:+86-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: Arithmetic Units (Hdiv And Sqrt)

    004h Reset Value HDIV_DIVISOR DIVISOR 008h Reset Value HDIV_QUOTIENT QUOTIENT 00Ch Reset Value HDIV_REMAINDER REMAINDER 010h Reset Value 560 / 620 Nations Technologies Inc. Tel:+86-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: Hdiv Control Status Register (Hdiv_Ctrlsts)

    Divider module enable 0: Close the divider module 1: Enable divider module 24.3.3 HDIV dividend register (HDIV_DIVIDEND) Offset address: 0x04 561 / 620 Nations Technologies Inc. Tel:+86-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: Hdiv Divisor Register (Hdiv_Divisor)

    Bit field Name Description 31:0 QUOTIENT Quotient calculated by the divider 24.3.6 HDIV remainder register (HDIV_REMAINDER) Offset address: 0x10 562 / 620 Nations Technologies Inc. Tel:+86-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: Hdiv Divide By Zero Register (Hdiv_Divby0)

    Table 24-2 SQRT register overview Offset Register SQRT_CTRLSTS 000h Reserved Reset Value SQRT_RADICAND RADICAND 004h Reset Value 008h SQRT_ROOT Reserved ROOT 563 / 620 Nations Technologies Inc. Tel:+86-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: Sqrt Control Status Register (Sqrt_Ctrlsts)

    1: Enable the square root calculator module 24.4.3 SQRT Radicand register (SQRT_RADICAND) Offset address: 0x04 Reset value: 0x0000 0000 564 / 620 Nations Technologies Inc. Tel:+86-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: Sqrt Square Root Register (Sqrt_Root)

    Bit field Name Description 31:16 Reserved Reserved,the reset value must be maintained 15:0 ROOT 16-bit square root output 565 / 620 Nations Technologies Inc. Tel:+86-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: Controller Area Network (Can)

    With the wide application of CAN, the nodes of CAN network are growing rapidly. Multiple CAN nodes are connected through CAN network. With increase number of CAN nodes, messages in CAN network also increase 566 / 620 Nations Technologies Inc. Tel:+86-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: Can Module

    CANTX pin is disabled. 567 / 620 Nations Technologies Inc. Tel:+86-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: Normal Mode

    When the CAN_MCTRL.AWKUM bit is clear(enable software wake up), and wake-up interrupt occurred ,then the software must clear the CAN_MCTRL.SLPRQ bit to exit the sleep state. 568 / 620 Nations Technologies Inc. Tel:+86-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: 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. 569 / 620 Nations Technologies Inc. Tel:+86-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: Can Test Mode

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

    CAN system connected by CANTX and CANRX. To enter loopback silence mode, both the CAN_BTIM.SLM bit and the CAN_BTIM.LBM bit should be set. 572 / 620 Nations Technologies Inc. Tel:+86-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: Can Debugging Mode

    The messages in the ready mailbox is sent as soon as the CAN bus enters the idle state, then enter the sending 573 / 620 Nations Technologies Inc. Tel:+86-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: Time Triggered Communication Mode

    If the sending operation fails, whether due to arbitration loss or error, 574 / 620 Nations Technologies Inc. Tel:+86-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: Receiving Management

    Please refer to 25.4.5 Section: identifier filtering. 575 / 620 Nations Technologies Inc. Tel:+86-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: Figure 25-8 Receive Fifo Status

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

    And the filter group should be set to work in identifier list mode in order to filter out an identifier. 577 / 620 Nations Technologies Inc. Tel:+86-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: Figure 25-9 Filter Bit Width Setting-Register Organization

    The filter ID is used to store the identifier format, and the filter MASK is used to indicate which bits must be checked and which bits can be ignored. 578 / 620 Nations Technologies Inc. Tel:+86-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: Table 25-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 579 / 620 Nations Technologies Inc. Tel:+86-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: Message Storage

    25.4.6 Message storage A mailbox contains all information related to a message: identifier, data, control, status and time stamp information. 580 / 620 Nations Technologies Inc. Tel:+86-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: Bit Time Characteristic

    In BS2, it defines the location of the sending point. It stands for PHASE_SEG2 in CAN standard. Its value can be 581 / 620 Nations Technologies Inc. Tel:+86-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 25-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 582 / 620 Nations Technologies Inc. Tel:+86-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: Figure 25-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 583 / 620 Nations Technologies Inc. Tel:+86-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: 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. 584 / 620 Nations Technologies Inc. Tel:+86-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: Error Management

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

    2. Check status bits of each mailbox in CAN_TSTS. If any mailbox with TMEMx (x = 0~2) is ‘1’, user can write the message, which is waiting for transmission, to the corresponding mailbox address. CAN_TMIx.TXRQ(x = 586 / 620 Nations Technologies Inc. Tel:+86-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: Can Register File

    The value of the filter can only be modified when the corresponding filter group is closed or the CAN_FMC.FINITM 587 / 620 Nations Technologies Inc. Tel:+86-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: Can Register Address Overview

    EXTID[17:0] 180h Reset Value CAN_TMDT0 MTIM[15:0] DLC[3:0] 184h Reset Value CAN_TMDL0 DATA3[7:0] DATA2[7:0] DATA1[7:0] DATA0[7:0] 188h Reset Value 588 / 620 Nations Technologies Inc. Tel:+86-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 DATA1[7:0] DATA0[7:0] Reset Value CAN_RMDH0 DATA7[7:0] DATA6[7:0] DATA5[7:0] DATA4[7:0] 1BCh Reset Value CAN_RMI1 STDID[10:0]/EXTID[28:18] EXTID[17:0] 1C0h Reset Value 589 / 620 Nations Technologies Inc. Tel:+86-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 CAN_FA1 FAC[13:0] 21Ch Reset Value 220h 224h 23Fh CAN_F0B1 FBC[31:0] 240h Reset Value CAN_F0B2 FBC[31:0] 244h Reset Value 590 / 620 Nations Technologies Inc. Tel:+86-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 248h Reset Value CAN_F1B2 FBC[31:0] 24Ch Reset Value CAN_F13B1 FBC[31:0] 2A8h Reset Value CAN_F13B2 FBC[31:0] 2ACh Reset Value 591 / 620 Nations Technologies Inc. Tel:+86-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: Can Control And Status Register

    1: Once the hardware detects 128 consecutive 11-bit recessive bits, it will automatically exit the bus-off state. Notes: For more information about bus-off status, please refer to 25.5.1: Error 592 / 620 Nations Technologies Inc. Tel:+86-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 Setting this bit by software enables CAN to enter initialization mode from normal operation mode: once the current CAN activity (sending or receiving) is over, the 593 / 620 Nations Technologies Inc. Tel:+86-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 When an error is detected, a bit of the CAN_ESTS register will be set, and if the corresponding interrupt enable bit of the CAN_INTE register is also set, the 594 / 620 Nations Technologies Inc. Tel:+86-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 Lowest priority flag for mailbox 0 When multiple mailboxes are waiting to send messages, and the priority of 595 / 620 Nations Technologies Inc. Tel:+86-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 1, it will have no effect to set this bit. 14:12 Reserved Reserved, the reset value must be maintained. 596 / 620 Nations Technologies Inc. Tel:+86-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 When this bit is cleared, other sending status bits (CAN_TSTS.TXOKM0, CAN_TSTS.ALSTM0 and CAN_TSTS.TERRM0 bits) of mailbox 0 are also cleared. 597 / 620 Nations Technologies Inc. Tel:+86-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 CAN_RFF0.FFMP0 is decremented by 1 until it is 0. 25.7.3.5 CAN receive FIFO 1 register (CAN_RFF1) Address offset: 0x10 Reset value: 0x0000 0000 598 / 620 Nations Technologies Inc. Tel:+86-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 Reset value: 0x0000 0000 Bit field Name Describe 31:18 Reserved Reserved, the reset value must be maintained. SLKITE Sleep interrupt enable 599 / 620 Nations Technologies Inc. Tel:+86-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 0: When CAN_RFF0.FFULL bit is set, no interrupt is generated; 1: When CAN_RFF0.FFULL bit is set, an interrupt is generated. 600 / 620 Nations Technologies Inc. Tel:+86-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 010: wrong Format (form); 011: Acknowledgment (ack) error; 100: recessive dislocation(CAN transmits recessive but detect dominant on the 601 / 620 Nations Technologies Inc. Tel:+86-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 For resynchronization, this bit field defines the upper limit of how many time units CAN be extended or shortened by CAN hardware in each bit. 602 / 620 Nations Technologies Inc. Tel:+86-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: Can Mailbox Register

    Low byte of extended identity. Identifier extension. This bit determines the type of identifier used for sending messages in the 603 / 620 Nations Technologies Inc. Tel:+86-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 CAN_TMDTx.MTIM[7:0] seventh byte CAN_TMDTx.MTIM[15:8] is the eighth byte. They replace the data written in CAN_TMDHx[31:16] (CAN_TMDLx.DATA6[7:0] and 604 / 620 Nations Technologies Inc. Tel:+86-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 25.7.4.4 Tx mailbox high byte data register(CAN_TMDHx) (x=0..2) When the mailbox is not empty, all bits in this register are write protected. 605 / 620 Nations Technologies Inc. Tel:+86-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 25.7.4.5 Receive FIFO mailbox identifier register (CAN_RMIx) (x=0..1) Address offset: 0x1B0, 0x1C0 Reset value: undefined Notes: All receiving mailbox registers are read-only. 606 / 620 Nations Technologies Inc. Tel:+86-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 This field contains the value of the 16-bit timer at the time of sending the message SOF. 15:8 FMI[7:0] Filter match index 607 / 620 Nations Technologies Inc. Tel:+86-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 Notes: the message contains 0 to 8 bytes of data, starting from byte 0. 25.7.4.8 Receive FIFO mailbox high byte data register(CAN_RMDHx) (x=0..1) Address offset: 0x1BC, 0x1CC 608 / 620 Nations Technologies Inc. Tel:+86-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: Can Filter Register

    Notes: The unreserved bits of this register are completely controlled by software. Bit field Name Describe 31:1 Reserved Reserved, the reset value must be maintained. 609 / 620 Nations Technologies Inc. Tel:+86-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 Notes: You can only write to this register when you set CAN_FMC.FINITM bit and put the filter in initialization mode. 610 / 620 Nations Technologies Inc. Tel:+86-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 0: the filter is associated to FIFO0; 1: the filter is associated to FIFO1. 25.7.5.5 CAN filter activation register (CAN_FA1) Address offset: 0x21C 611 / 620 Nations Technologies Inc. Tel:+86-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 Identifier pattern Each bit of the register corresponds to the level of the corresponding bit of the expected identifier. 612 / 620 Nations Technologies Inc. Tel:+86-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 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 25-4. 613 / 620 Nations Technologies Inc. Tel:+86-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: Cryptographic Algorithm Hardware Acceleration Engine (Sac)

    Note: For information regarding the performance and use of cryptographic algorithms, please contact the sales representatives of National Technology. 614 / 620 Nations Technologies Inc. Tel:+86-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: Debug Support (Dbg)

    The ARM Cortex®-M0 core hardware debugging module can provide the following debugging functions:  SW-DP: Serial debugging port  AHP-AP: AHB access port 615 / 620 Nations Technologies Inc. Tel:+86-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: Swd Function

    The pin assignment of SWD debug interface is shown in the following table: Table 27-1 Debug port pin Debug port Pin assignment SWDIO PA13 SWCLK PA14 616 / 620 Nations Technologies Inc. Tel:+86-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: 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 618 SRAM capacity 4bit 4KB as unit, SRAM size = N * 4KB Reserved 4bit Keep it all 1. 618 / 620 Nations Technologies Inc. Tel:+86-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: Version History

    Modify 18.7.2 chapter bit3 description Add note in chapter 15.5 Add note and figure 18-5 about transmisson delay in chapter 18.4.2.5 619 / 620 Nations Technologies Inc. Tel:+86-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: 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.

This manual is also suitable for:

N32g03 series

Table of Contents