Nations N32G030 Series User Manual

32-bit arm cortex-m0
Table of Contents

Advertisement

Quick Links

N32G030 series
®
32-bit ARM Cortex
-M0 microcontroller
User manual V2.3.0

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Summary of Contents for Nations N32G030 Series

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

    Debug control register (DBG_CTRL) ......................67 4 Reset and clock control (RCC) ............................. 70 4.1 Reset Control Unit ..............................70 2 / 559 Nations Technologies Inc. Tel:+86-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 ........................120 5.2.7 GPIO Locking mechanism ........................... 122 5.3 GPIO Registers ............................... 123 3 / 559 Nations Technologies Inc. Tel:+86-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) ............149 7 DMA controller ................................150 7.1 Introduction ................................150 7.2 Main features ................................150 4 / 559 Nations Technologies Inc. Tel:+86-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) ........................170 9 Advanced-control timers (TIM1 and TIM8) ......................... 171 9.1 TIM1 and TIM8 introduction ............................ 171 5 / 559 Nations Technologies Inc. Tel:+86-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) .................... 234 9.4.18 Capture/compare register 4 (TIMx_CCDAT4) .................... 234 9.4.19 Break and Dead-time registers (TIMx_BKDT) ................... 235 6 / 559 Nations Technologies Inc. Tel:+86-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) .................... 288 10.4.15 Capture/compare register 2 (TIMx_CCDAT2) .................... 289 10.4.16 Capture/compare register 3 (TIMx_CCDAT3) .................... 289 7 / 559 Nations Technologies Inc. Tel:+86-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.5 LPTIM registers ..............................316 12.5.1 LPTIM register overview......................... 316 12.5.2 LPTIM interrupt and status register (LPTIM_INTSTS) ................317 8 / 559 Nations Technologies Inc. Tel:+86-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 ................................337 15.3 Function Description............................... 338 15.3.1 ADC clock ..............................339 15.3.2 ADC switch control ........................... 340 9 / 559 Nations Technologies Inc. Tel:+86-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.1 COMP system connection block diagram ......................368 16.2 COMP features ..............................368 16.3 COMP configuration process ..........................369 16.4 COMP working mode ............................369 10 / 559 Nations Technologies Inc. Tel:+86-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 18.2 Main features ................................ 407 18.3 Functional block diagram ............................. 408 18.4 Function description ............................. 408 18.4.1 USART frame format ..........................409 11 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 12 LPUART register overview ........................462 19.6.2 LPUART status register (LPUART_STS) ....................462 19.6.3 LPUART interrupt enable register (LPUART_INTEN) ................463 12 / 559 Nations Technologies Inc. Tel:+86-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 SPI_I2S prescaler register (SPI_I2SPREDIV) ..................505 21 Real-time clock (RTC) ............................... 507 21.1 Description ................................507 21.2 Specification ................................. 507 13 / 559 Nations Technologies Inc. Tel:+86-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 Alarm B sub-second register (RTC_ALRMBSS) ................535 22 Operational amplifier (OPAMP) ..........................537 22.1 OPAMP features ..............................537 14 / 559 Nations Technologies Inc. Tel:+86-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 25.2 SWD function ............................... 555 25.2.1 Pin assignment ............................555 26 Unique device serial number (UID) .......................... 556 26.1 Introduction ................................556 15 / 559 Nations Technologies Inc. Tel:+86-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 26.3 UCID register ............................... 556 26.4 DBGMCU_ID register ............................556 27 Version history ................................558 28 Notice ..................................559 16 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 17 Table 5-17 EVENTOUT alternate function I/O remapping ................117 Table 5-18 RTC alternate function I/O remapping ................... 118 17 / 559 Nations Technologies Inc. Tel:+86-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 9-3 TIMx internal trigger connection ..................... 218 Table 9-4 Output control bits of complementary OCx and OCxN channels with break function ....230 18 / 559 Nations Technologies Inc. Tel:+86-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 18-5 when DIV_Decimal != 0. Tolerance of USART receiver .............. 420 Table 18-6 Frame format ..........................420 Table 18-7 USART interrupt request ....................... 437 19 / 559 Nations Technologies Inc. Tel:+86-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 24-1 HDIV register overview ........................ 548 Table 24-2 SQRT register overview ........................ 551 Table 26-1 DBGMCU_ID bit description ......................556 20 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 21 Figure 9-9 Repeat count sequence diagram in up-counting mode ..............181 Figure 9-10 Repeat count sequence diagram in center-aligned mode ............. 181 21 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 22 Figure 10-5 Timing diagram of the down-counting, internal clock divided factor = 2/N ........ 245 Figure 10-6 Timing diagram of the Center-aligned, internal clock divided factor =2/N ......... 246 22 / 559 Nations Technologies Inc. Tel:+86-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 12-3 LPTIM output waveform, Continuous counting mode configuration .......... 308 Figure 12-4 PTIM output waveform, single counting mode configuration ............. 309 23 / 559 Nations Technologies Inc. Tel:+86-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 18-8 Transmission using DMA ......................422 Figure 18-9 Reception using DMA ......................... 423 Figure 18-10 hardware flow control between two USART ................424 24 / 559 Nations Technologies Inc. Tel:+86-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 20-6 Schematic diagram of TE/BUSY change when the host transmits continuously in one-way only mode ................................ 474 25 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 26 Figure 22-2 OPAMP Standalone Operational Amplifier Mode ............... 539 Figure 22-3 OPAMP follow mode ........................540 Figure 22-4 Internal programmable gain mode ....................541 26 / 559 Nations Technologies Inc. Tel:+86-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: Abbreviations In The Text

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

    DMA bus: The DMA's AHB master interface is connected to the bus matrix, which coordinates the kernel and 29 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 30: Bus Address Mapping

    0x0000_0000 – 0x0000_FFFF 0x4000_0800 – 0x4000_0BFF Aliased to Flash/SystemMemory/SRAM Reserved 0x4000_0400 – 0x4000_07FF TIM3 0x4000_0000 – 0x4000_03FF BEEPER 30 / 559 Nations Technologies Inc. Tel:+86-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: Table 2-1 List Of Peripheral Register Addresses

    Reserved 0x4000_5800 – 0x4000_5BFF I2C2 APB1 0x4000_5400 – 0x4000_57FF I2C1 0x4000_4C00 – 0x4000_53FF Reserved 0x4000_4800 – 0x4000_4BFF LPUART 31 / 559 Nations Technologies Inc. Tel:+86-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: Boot Management

    Three different BOOT modes can be selected through the BOOT0 pin and the user option byte BOOT configuration. 32 / 559 Nations Technologies Inc. Tel:+86-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: Embedded Boot Loader

     The Option Byte area is 0.5KB, containing 1 Page, also known as Option Byte, and the effective space is 14B, BOOT programs and user programs can be read, written or erased. 33 / 559 Nations Technologies Inc. Tel:+86-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-3 Flash Bus Address List

    That is, when writing or erasing, cannot have any read access to the code or data. 34 / 559 Nations Technologies Inc. Tel:+86-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 Wait for the FLASH_ STS.BUSY bit to change to' 0';  Read out the erased page and verify it. Mass Erase Mass Erase process: 35 / 559 Nations Technologies Inc. Tel:+86-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 Wait for the FLASH_ STS.BUSY bit to change to '0';  Read the erased option byte and verify it. 36 / 559 Nations Technologies Inc. Tel:+86-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: 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. 37 / 559 Nations Technologies Inc. Tel:+86-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-4 Option Byte List

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

     The write protection property of each page can be configured for programming and erasing;  L1 level: 39 / 559 Nations Technologies Inc. Tel:+86-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  When executed in SWD debug mode or after booting from internal SRAM, all Pages do not allow 40 / 559 Nations Technologies Inc. Tel:+86-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: 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 41 / 559 Nations Technologies Inc. Tel:+86-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 Read and Read and SRAM (All) Read and write write write Boot mode SRAM protect Changing a Protection 42 / 559 Nations Technologies Inc. Tel:+86-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 L2 protection level, cannot boot from SRAM level SWD is banned. After 4KB of flash 43 / 559 Nations Technologies Inc. Tel:+86-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 After 4KB of flash Read-write- Read-write- Prohibit Read-write-erase is automatically erased. main memory area erase erase 44 / 559 Nations Technologies Inc. Tel:+86-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: 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 8KB 45 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 46: Flash 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 46 / 559 Nations Technologies Inc. Tel:+86-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 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 47 / 559 Nations Technologies Inc. Tel:+86-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 This bit is cleared to '0' at the end of the operation or when an error occurs. 48 / 559 Nations Technologies Inc. Tel:+86-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 After an unsuccessful unlock operation, this bit cannot be changed until the next system reset. START Start 49 / 559 Nations Technologies Inc. Tel:+86-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 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 50 / 559 Nations Technologies Inc. Tel:+86-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 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 51 / 559 Nations Technologies Inc. Tel:+86-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 Reserved,the reset value must be maintained After writing a word to a 32-bit Flash address,the corresponding higher 6-bit ECC value. 52 / 559 Nations Technologies Inc. Tel:+86-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: 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. 53 / 559 Nations Technologies Inc. Tel:+86-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: Power Supply Supervisor

    Refer to the electrical characteristics section of the data sheet for details on power-on and power-off resets. 54 / 559 Nations Technologies Inc. Tel:+86-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: 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. 55 / 559 Nations Technologies Inc. Tel:+86-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: Nrst

    CPU running at LSI or LSE, PLL off, all software control software control FLASH other peripherals configurable. Voltage 56 / 559 Nations Technologies Inc. Tel:+86-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: 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 57 / 559 Nations Technologies Inc. Tel:+86-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: Lprun Mode

    FLASH to enter the deep standby mode as required. Note that a write key is required to enable 58 / 559 Nations Technologies Inc. Tel:+86-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: Sleep Mode

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

    Register 0x00 PWR_CTRL Reserved Reset value 0x04 PWR_CTRLSTS Reserved Reserved Reset value 0x08 PWR_CTRL2 Reserved Reserved Reset value 61 / 559 Nations Technologies Inc. Tel:+86-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: 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 62 / 559 Nations Technologies Inc. Tel:+86-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: 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 63 / 559 Nations Technologies Inc. Tel:+86-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 Only VDDD POR/PDR can reset this bit. 0: No wakeup event occurred 1: A wakeup event was received from the WKUP pin 64 / 559 Nations Technologies Inc. Tel:+86-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: 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 65 / 559 Nations Technologies Inc. Tel:+86-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 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 66 / 559 Nations Technologies Inc. Tel:+86-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 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. 67 / 559 Nations Technologies Inc. Tel:+86-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 This bit is set or cleared by software. 0: The counter of TIM1 works normally 1: The counter of TIM1 stops working 68 / 559 Nations Technologies Inc. Tel:+86-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 1: (FCLK on, HCLK on) In DBGSLEEP mode, both FCLK and HCLK clocks are provided by the previously configured system clock. 69 / 559 Nations Technologies Inc. Tel:+86-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: Reset And Clock Control (Rcc)

    Window watchdog end of count condition (WWDG reset)  Independent watchdog end of count condition (IWDG reset)  Software reset (SW reset) 70 / 559 Nations Technologies Inc. Tel:+86-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: Software Reset

    20μs for each reset source (external or internal). For external reset, the reset pulse is generated while the NRST pin is asserted low. The Figure below shows the system reset generation circuit. 71 / 559 Nations Technologies Inc. Tel:+86-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: Clock Control Unit

    All peripheral clocks are derived from the system clock (SYSCLK) except in the following cases:  ADC clock is obtained by dividing the AHB/PLL clock. 72 / 559 Nations Technologies Inc. Tel:+86-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  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. 73 / 559 Nations Technologies Inc. Tel:+86-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: 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. 74 / 559 Nations Technologies Inc. Tel:+86-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: Hse Clock

    If the user needs to change the configuration of RCC_CTRL.HSEBP during operation, it should be configured before enabling RCC_CTRL.HSEEN. 75 / 559 Nations Technologies Inc. Tel:+86-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: Hsi Clock

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

    An interrupt can be generated if enabled in the Clock Interrupt Register (RCC_CLKINT). 77 / 559 Nations Technologies Inc. Tel:+86-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: System Clock (Sysclk) Selection

    LPUART_PCLK. Since HSI, HSE, SYSCLK and PCLK will be turned off in low power mode, software should switch the LPUART clock to LSI or LSE before entering low power mode.. 78 / 559 Nations Technologies Inc. Tel:+86-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: Lptime Clock

    4.3 RCC registers 4.3.1 RCC register overview Table 4-1 RCC register overview Offset Register 000h RCC_CTRL Reserved Reserved HSITRIM[4:0] 79 / 559 Nations Technologies Inc. Tel:+86-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 ADCPLLPRES ADCHPRES RCC_CFG2 [2:0] [2:0] [4:0] [4:0] [3:0] 02Ch Reserved Reserved Reset Value RCC_EMCCTRL 030h Reserved Reset Value 80 / 559 Nations Technologies Inc. Tel:+86-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: Clock Control Register (Rcc_Ctrl)

    External high-speed clock ready flag Set by hardware once HSE is ready. This bit is cleared 6 HSE clock cycles after the 81 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 82: Clock Configuration Register (Rcc_Cfg)

    Address offset: 0x04 Reset value: 0x2000 0000 Bit field Name Description 31:28 MCOPRES[3:0] MCO prescaler Set and cleared by software. 82 / 559 Nations Technologies Inc. Tel:+86-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 PLL prescaler 4MHz <= F /N <= 20MHz This bit can only be written when the PLL is off 83 / 559 Nations Technologies Inc. Tel:+86-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 1011: SYSCLK divided by 16 1100: SYSCLK divided by 64 1101: SYSCLK divided by 128 1110: SYSCLK divided by 256 84 / 559 Nations Technologies Inc. Tel:+86-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 Interrupt Register (Rcc_Clkint)

    This bit is set by the software to clear PERRF. 0: No impact. 1: PERRF cleared PLLRDICLR PLL ready interrupt clear 85 / 559 Nations Technologies Inc. Tel:+86-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 LSE ready interrupt enable Set and cleared by software to enable and disable LSE ready interrupt. 0: Disable LSE ready interrupt 86 / 559 Nations Technologies Inc. Tel:+86-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 This bit is cleared by software by setting the LSIRDICLR bit. 0: No clock ready interrupt caused by LSI oscillator 1: Clock ready interrupt caused by LSI oscillator 87 / 559 Nations Technologies Inc. Tel:+86-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: Apb2 Peripheral Reset Register (Rcc_Apb2Prst)

    1: Reset GPIO port F Reserved Reserved, the reset value must be maintained. IOPCRST GPIO port C reset 88 / 559 Nations Technologies Inc. Tel:+86-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: Apb1 Peripheral Reset Register (Rcc_Apb1Prst)

    Set and cleared by software. 0: Clear reset 1: Reset I2C2 I2C1RST I2C1 reset Set and cleared by software. 89 / 559 Nations Technologies Inc. Tel:+86-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: Ahb Peripheral Clock Enable Register (Rcc_Ahbpclken)

    Reserved, the reset value must be maintained. 4.3.7 AHB peripheral clock enable register (RCC_AHBPCLKEN) Address offset: 0x14 Reset value: 0x0000 0014 90 / 559 Nations Technologies Inc. Tel:+86-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 Reserved, the reset value must be maintained. DMAEN DMA clock enable Set and cleared by software. 0: Disable DMA clock 1: Enable DMA clock 91 / 559 Nations Technologies Inc. Tel:+86-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 Clock Enable Register (Rcc_Apb2Pclken)

    1: Enable the clock of GPIO port F Reserved Reserved, the reset value must be maintained. IOPCEN GPIO port C clock enable 92 / 559 Nations Technologies Inc. Tel:+86-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: Apb1 Peripheral Clock Enable Register (Rcc_Apb1Pclken)

    27:23 Reserved Reserved, the reset value must be maintained I2C2EN I2C2 clock enable Set and cleared by software. 93 / 559 Nations Technologies Inc. Tel:+86-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 Set and cleared by software. 0: Disable LPTIM timer clock 1: Enable LPTIM timer clock LPTIMPCLKEN LPTIM APB1 interface clock enable 94 / 559 Nations Technologies Inc. Tel:+86-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: Low Speed Clock Control Register (Rcc_Lsctrl)

    10: Select LSI oscillator as RTC clock 11: Select the HSE oscillator divided by 128 as the RTC clock 95 / 559 Nations Technologies Inc. Tel:+86-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: Control/Status Register (Rcc_Ctrlsts)

    Set by hardware when EMCCLAMP is reset. It is cleared by writing RMRSTF bit or por_rst_n reset. 0: No EMCCLAMP reset occurred 96 / 559 Nations Technologies Inc. Tel:+86-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 It is cleared by writing RMRSTF bit or por_rst_n reset. 0: No NRST pin reset occurred 1: NRST pin reset occurred 97 / 559 Nations Technologies Inc. Tel:+86-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: Ahb Peripheral Reset Register (Rcc_Ahbprst)

    Reserved, the reset value must be maintained. HSQRTRST HSQRT reset Set and cleared by software. 0: Clear reset 98 / 559 Nations Technologies Inc. Tel:+86-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: Clock Configuration Register 2(Rcc_Cfg2)

    Others: Not allowed, and no clock will be generated 20:16 Reserved Reserved, the reset value must be maintained. 99 / 559 Nations Technologies Inc. Tel:+86-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: Table 5-25 Adc

    0011: HCLK clock divided by 4 0100: HCLK clock divided by 6 0101: HCLK clock divided by 8 100 / 559 Nations Technologies Inc. Tel:+86-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: Emc Control Register 3 (Rcc_Emcctrl)

    1: Enable reset request GBNRST2 GBN2 reset Set and cleared by software. and reset by por_rst_n 0: Disable reset request 101 / 559 Nations Technologies Inc. Tel:+86-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 GB0 detection enble Set and cleared by software. and reset by por_rst_n 0: Disable detection 1: Enable detection 102 / 559 Nations Technologies Inc. Tel:+86-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 EMC Clamp0 detection enble Set and cleared by software. and reset by por_rst_n 0: Disable detection 1: Enable detection 103 / 559 Nations Technologies Inc. Tel:+86-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: Gpio And Afio

    8-bit byte access is not allowed). The following figure shows the basic structure of an I/O port. 104 / 559 Nations Technologies Inc. Tel:+86-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: 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 105 / 559 Nations Technologies Inc. Tel:+86-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: 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 106 / 559 Nations Technologies Inc. Tel:+86-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: 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. 107 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 108: Figure 5-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. 108 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 109: Figure 5-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 109 / 559 Nations Technologies Inc. Tel:+86-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: Status After Reset

    AFIO_EXTI_CFGx. 5.2.5 Alternate function When I/O ports are configured for alternate function mode. The port bit configuration register 110 / 559 Nations Technologies Inc. Tel:+86-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: 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 111 / 559 Nations Technologies Inc. Tel:+86-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: Table 5-5 Tim8 Alternate Function I/O Remapping

    5.2.5.3.3 TIM3 alternate function I/O remapping Table 5-6 TIM3 alternate function I/O remapping Alternate function Remapping AF10 TIM3_ETR PB10 112 / 559 Nations Technologies Inc. Tel:+86-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-7 Lptim Alternate Function I/O Remapping

    Table 5-8 USART1 alternate function I/O remapping Alternate function Remapping USART1_CTS PA11 USART1_RTS PA12 PA13 USART1_TX PA14 USART1_RX PA10 113 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 114: Table 5-9 Usart2 Alternate Function I/O Remapping

    5.2.5.6 LPUART alternate function I/O remapping Table 5-10 LPUART alternate function I/O remapping Alternate function Remapping LPUART_CTS PB13 PA15 LPUART_RTS PB14 AF10 LPUART_TX 114 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 115: Table 5-11 I2C1 Alternate Function I/O Remapping

    5.2.5.7.2 I2C2 alternate function I/O remapping Table 5-12 I2C2 alternate function I/O remapping Alternate function Remapping I2C2_SCL PA11 PB10 PB13 115 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 116: Table 5-13 Spi1/I2S Alternate Function I/O Remapping

    Table 5-13 SPI1/I2S alternate function I/O remapping Alternate function Remapping SPI1_I2S_NSS_WS PA15 PB12 SPI1_I2S_SCLK_CK PA13 PB13 SPI1_I2S_MISO_MCK PA14 PB14 SPI1_I2S_MOSI_SD PB10 PB15 116 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 117: Table 5-14 Spi2 Alternate Function I/O Remapping

    5.2.5.11 EVENTOUT alternate function I/O remapping Table 5-17 EVENTOUT alternate function I/O remapping Alternate function Remapping EVENTOUT PA6~PA8 PA11~PA12 117 / 559 Nations Technologies Inc. Tel:+86-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-18 Rtc Alternate Function I/O Remapping

    PC14 and PC15 can be used for GPIO or LSE (OSC32_IN, OSC32_OUT) pins.  Turn on the LSE function by setting the RCC_LSCTRL.LSEEN and RCC_LSCTRL.LSEBP bits. 118 / 559 Nations Technologies Inc. Tel:+86-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-21 Osc32 Alternate Function Remapping

    ADC external trigger injection conversion is EXTI (0-15), EXTIx can be selected by injection conversion connected to TIM8_CH4 AFIO_CFG.EXTI_ETRI[3:0] configuration 119 / 559 Nations Technologies Inc. Tel:+86-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: I/O Configuration Of Peripherals

    Alternate function push-pull USARTx_RTS Hardware flow control Alternate function push-pull Alternate function push-pull(no pull-down USARTx_CTS Hardware flow control or pull-up/pull-up) 120 / 559 Nations Technologies Inc. Tel:+86-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-30 Lpuart

    Unused, can be used as general I/O. Table 5-33 COMP COMP pin PAD configuration COMP_OUT Alternate function push-pull COMP_IN Analog function mode 121 / 559 Nations Technologies Inc. Tel:+86-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: Gpio Locking Mechanism

    If the lock sequence operation is wrong, then it must be redone (w1-> w0-> w1-> r0) to initiate the lock operation again. 122 / 559 Nations Technologies Inc. Tel:+86-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: Gpio Registers

    Reset Value Reserved Reserved Reserved Reserved GPIOx_POD x=A,B,C,F Reserved x=A,B Reserved 014h Reset Value Reserved Reserved Reserved Reserved 123 / 559 Nations Technologies Inc. Tel:+86-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: Gpio Port Mode Description Register (Gpiox_Pmode)

    Mode of port GPIOx (x = A,B,C,F) pin PINy: 29:28 00: Input mode 27:26 01: General output mode 124 / 559 Nations Technologies Inc. Tel:+86-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: Gpio Port Type Definition (Gpiox_Potype)

    5.3.4 GPIO slew rate configuration register (GPIOx_SR) Offset address : 0x08 Reset value : 0x0000 FFFF (x=A, B); 0x0000 E000 (x=C); 0x0000 00C7 (x=F) 125 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 126: Gpio Port Pull-Up/Pull-Down Register (Gpiox_Pupd)

    When x = F, y = 0, 1, 2, 6, 7, the remaining bits are reserved, and the reserved bits are 13:12 read-only. 11:10 126 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 127: Gpio Port Input Data Register (Gpiox_Pid)

    Output data of port GPIOx (x = A,B,C,F) pin PINy These bits are readable or writable by software, and the corresponding POD bits can be independently set/cleared. 127 / 559 Nations Technologies Inc. Tel:+86-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: Gpio Port Bit Set/Clear Register (Gpiox_Pbsc)

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

    Reset value : 0xFFFF FFFF (x = A,B); 0x0000 0000 (x = C); 0xFF00 0FFF (x = F) 129 / 559 Nations Technologies Inc. Tel:+86-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: Gpio Alternate Function High Register (Gpiox_Afh)

    Reset value : 0xF00F FFFF (x = A); 0xFFFF FFFF (x = B); 0xFFF0 0000 (x = C); 0x0000 0000 (x = F) 130 / 559 Nations Technologies Inc. Tel:+86-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: Gpio Port Bit Clear Register (Gpiox_Pbc)

    0: No effect on the corresponding PODy bit 1: Clear the corresponding PODy bit to 0 Note: when x = A,B, y = 0…15; 131 / 559 Nations Technologies Inc. Tel:+86-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: Gpio Driver Strength Configuration Register (Gpiox_ Ds)

    [3:0] [3:0] [3:0] 008h Reserved Reset Value EXTI7_CFG EXTI6_CFG EXTI5_CFG EXTI4_CFG 00Ch AFIO_EXTI_CFG2 Reserved [3:0] [3:0] [3:0] [3:0] 132 / 559 Nations Technologies Inc. Tel:+86-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: Afio Configuration Register (Afio_Cfg)

    Select EXTI Line injection to convert external trigger remapping 0000: select EXTI0 injection conversion external trigger 0001: Select EXTI1 injection to convert external trigger 133 / 559 Nations Technologies Inc. Tel:+86-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: Afio External Interrupt Configuration Register 1 (Afio_Exti_Cfg1)

    0010: reserved 0101: reserved Other: reserved 5.4.4 AFIO external interrupt configuration register 2 (AFIO_EXTI_CFG2) Offset address : 0x0C 134 / 559 Nations Technologies Inc. Tel:+86-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: Afio External Interrupt Configuration Register 3 (Afio_Exti_Cfg3)

    These bits are readable and writable by software and are used to select the input source for the EXTIx external interrupt. 135 / 559 Nations Technologies Inc. Tel:+86-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: 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 136 / 559 Nations Technologies Inc. Tel:+86-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: 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 137 / 559 Nations Technologies Inc. Tel:+86-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 DMA and USART1/2 in the interrupt vector scale have several pairs of vectors with repeated functions. The repeated vectors are divided into two groups below: 138 / 559 Nations Technologies Inc. Tel:+86-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 When using DMA and USART1/2 interrupts, you can choose either group arbitrarily, but only one group at a time. 139 / 559 Nations Technologies Inc. Tel:+86-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: 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 140 / 559 Nations Technologies Inc. Tel:+86-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: 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'. 141 / 559 Nations Technologies Inc. Tel:+86-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  Configure 24 interrupt/event line mask bits (EXTI_IMASK and EXTI_EMASK).  Configure the request bit of the software interrupt event register (EXTI_SWIE). 142 / 559 Nations Technologies Inc. Tel:+86-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: Exti Line Mapping

    8 EXTI lines is as follows:  EXTI line 16 is connected to the PVD output 143 / 559 Nations Technologies Inc. Tel:+86-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 EXTI line 22 is connected to the LPUART wake up event  EXTI line 23 is connected to the LPTIM wake up event 144 / 559 Nations Technologies Inc. Tel:+86-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: 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 145 / 559 Nations Technologies Inc. Tel:+86-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: Event Mask Register(Exti_Emask)

    1: open the event request from line x 6.3.4 Rising edge trigger selection register(EXTI_RT_CFG) Address offset : 0x08 Reset value : 0x00000000 146 / 559 Nations Technologies Inc. Tel:+86-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: Falling Edge Trigger Selection Register(Exti_Ft_Cfg)

    1: Enable falling edge trigger (interrupts and events) on input line x is allowed. 6.3.6 Software interrupt enable register(EXTI_SWIE) Address offset : 0x10 147 / 559 Nations Technologies Inc. Tel:+86-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: Interrupt Request Pending Register(Exti_Pend)

    Reserved,the reset value must be maintained. 23:22 PENDx Hang bit on line x. (x is 22,23) 0: No pending request occurred. 148 / 559 Nations Technologies Inc. Tel:+86-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: Rtc Timestamp Trigger Source Selection Register (Exti_Ts_Sel)

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

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

     Calculate the number of outstanding operations, perform a decrement operation of the DMA_TXNUMx register, 151 / 559 Nations Technologies Inc. Tel:+86-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: Channel Priority And Arbitration

    0x0 / 00B0 0x1 / B1 2: R B1 [7:0] @0x1, W 00B1 [15:0] @0x2 0x2 / 00B1 152 / 559 Nations Technologies Inc. Tel:+86-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 32 bits. E.g., source is 8 bits data 0x55 and destination size is 16 bits. DMA pads the source 153 / 559 Nations Technologies Inc. Tel:+86-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: Peripheral/Memory Address Incrementation

    If it is memory to memory, configure MEM2MEM mode (Note: to configure DMA to work in M2M mode, user 154 / 559 Nations Technologies Inc. Tel:+86-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: Flow Control

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

    Event flag bit Enable control bit Half transfer HTXF HTXIE Transfer complete TXCF TXCIE Transfer error ERRF ERRIE 156 / 559 Nations Technologies Inc. Tel:+86-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: Dma Request Mapping

    = 21 I2c2_tx sel = 45 Reserved sel = 22 I2c2_rx sel = 46 TIM6 sel = 23 Tim1_ch1 157 / 559 Nations Technologies Inc. Tel:+86-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: 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] 158 / 559 Nations Technologies Inc. Tel:+86-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 Interrupt Status Register (Dma_Intsts)

    1: One of transfer error, half transfer or transfer done event happen on channel x. 7.5.3 DMA interrupt flag clear register (DMA_INTCLR) Address offset: 0x04 Reset value: 0x0000 0000 159 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 160: Dma Channel X Configuration Register (Dma_Chcfgx)

    Memory to memory mode. Software can configure this channel to memory to memory transfer when it is not yet enabled. 160 / 559 Nations Technologies Inc. Tel:+86-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 0: Disable transfer error interrupt of channel x. 1: Enable transfer error interrupt of channel x. HTXIE Half transfer interrupt enable. 161 / 559 Nations Technologies Inc. Tel:+86-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: Dma Channel X Transfer Number Register (Dma_Txnumx)

    Reset value: 0x0000 0000 This register can only be written if the channel is disabled (DMA_CHCFGx.CHEN = 0). 162 / 559 Nations Technologies Inc. Tel:+86-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: Dma Channel X Memory Address Register (Dma_Maddrx)

    Note: The x is channel number, x = 1…5 Address offset: 0x18+20 * (x–1) Reset value: 0x0000 0000 163 / 559 Nations Technologies Inc. Tel:+86-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 For the mapping of peripheral DMA requests to DMA input request channel numbers, please refer to Table 7-4 164 / 559 Nations Technologies Inc. Tel:+86-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: 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. 165 / 559 Nations Technologies Inc. Tel:+86-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: Crc Function Description

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

    0 automatically. 8.4.5 CRC16 control register (CRC_CRC16CTRL) Address offset: 0x0C Reset value: 0x0000 0000 168 / 559 Nations Technologies Inc. Tel:+86-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: 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 169 / 559 Nations Technologies Inc. Tel:+86-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: 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. 170 / 559 Nations Technologies Inc. Tel:+86-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: 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 171 / 559 Nations Technologies Inc. Tel:+86-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: 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 172 / 559 Nations Technologies Inc. Tel:+86-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: Prescaler Description

    TIMx_STS.UDITF is set:  The repetition counter reloads the contents of the TIMx_REPCNT 173 / 559 Nations Technologies Inc. Tel:+86-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 The figure below shows some examples of the counter behavior and the update flags for different division factors in the up-counting mode. 174 / 559 Nations Technologies Inc. Tel:+86-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: 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) 175 / 559 Nations Technologies Inc. Tel:+86-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 Counter overflow Update event(UEV) Update interrupt flag(UDITF) Auto-reload preload register Write a new value in TIMx_AR Auto-reload shadow register 176 / 559 Nations Technologies Inc. Tel:+86-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: 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". 177 / 559 Nations Technologies Inc. Tel:+86-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: 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) 178 / 559 Nations Technologies Inc. Tel:+86-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: 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. 179 / 559 Nations Technologies Inc. Tel:+86-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: 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 180 / 559 Nations Technologies Inc. Tel:+86-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: 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 181 / 559 Nations Technologies Inc. Tel:+86-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: Clock Selection

    Counter clock = CK_CNT=CK_PSC Counter register 63 64 65 66 00 01 02 03 04 05 06 07 182 / 559 Nations Technologies Inc. Tel:+86-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: 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. 183 / 559 Nations Technologies Inc. Tel:+86-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-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 184 / 559 Nations Technologies Inc. Tel:+86-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: 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. 185 / 559 Nations Technologies Inc. Tel:+86-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: 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. 186 / 559 Nations Technologies Inc. Tel:+86-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-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) 187 / 559 Nations Technologies Inc. Tel:+86-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: 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. 188 / 559 Nations Technologies Inc. Tel:+86-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: 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. 189 / 559 Nations Technologies Inc. Tel:+86-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: Forced Output Mode

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

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

    192 / 559 Nations Technologies Inc. Tel:+86-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-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 193 / 559 Nations Technologies Inc. Tel:+86-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: 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. 194 / 559 Nations Technologies Inc. Tel:+86-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: One-Pulse Mode

    4. TIMx_CCDAT1 writes the count value to be delayed (t ), TIMx_AR - TIMx_CCDAT1 is the count value of DELAY 195 / 559 Nations Technologies Inc. Tel:+86-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: 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. 196 / 559 Nations Technologies Inc. Tel:+86-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: 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. 197 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 198: Figure 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 198 / 559 Nations Technologies Inc. Tel:+86-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: 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) ^ 199 / 559 Nations Technologies Inc. Tel:+86-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 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 200 / 559 Nations Technologies Inc. Tel:+86-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: 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); 201 / 559 Nations Technologies Inc. Tel:+86-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: 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. 202 / 559 Nations Technologies Inc. Tel:+86-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: 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. 203 / 559 Nations Technologies Inc. Tel:+86-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: 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); 204 / 559 Nations Technologies Inc. Tel:+86-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: Timer Synchronization

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

    The relationship between the counting direction and the encoder signal is shown in Table 9-1 Counting direction versus encoder signals 206 / 559 Nations Technologies Inc. Tel:+86-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: 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) 207 / 559 Nations Technologies Inc. Tel:+86-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: 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 208 / 559 Nations Technologies Inc. Tel:+86-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: 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. 209 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 210: Figure 9-35 Example Of Hall Sensor Interface

    Interfacing timer Counter(CNT) (CCDAT2) CCDAT1 TRGO=OC2REF Advanced-control timers(TIM1&TIM8) OC1N OC2N OC3N Write CCxEN、CCxNEN and OCxMD for next step 210 / 559 Nations Technologies Inc. Tel:+86-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: 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 211 / 559 Nations Technologies Inc. Tel:+86-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: 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 212 / 559 Nations Technologies Inc. Tel:+86-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 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 213 / 559 Nations Technologies Inc. Tel:+86-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: 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 214 / 559 Nations Technologies Inc. Tel:+86-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 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. 215 / 559 Nations Technologies Inc. Tel:+86-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: 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. 216 / 559 Nations Technologies Inc. Tel:+86-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 (via TRGO) and its slaves. This is useful when several timers are required to be synchronized to a single external event. 217 / 559 Nations Technologies Inc. Tel:+86-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: Table 9-3 Timx Internal Trigger Connection

    ITR0 (TSEL = 000) ITR1 (TSEL = 001) ITR2 (TSEL = 010) ITR3 (TSEL = 011) TIM1 TIM3 TIM8 TIM1 218 / 559 Nations Technologies Inc. Tel:+86-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: 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 219 / 559 Nations Technologies Inc. Tel:+86-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: 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. 220 / 559 Nations Technologies Inc. Tel:+86-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 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: 221 / 559 Nations Technologies Inc. Tel:+86-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: Event Generation Registers (Timx_Evtgen)

    This bit is automatically cleared by hardware. 0: No action 1: Generated a trigger event 222 / 559 Nations Technologies Inc. Tel:+86-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: Capture/Compare Mode Register 1 (Timx_Ccmod1)

    ICx describes the function of a channel in input mode. Hence, 223 / 559 Nations Technologies Inc. Tel:+86-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 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 224 / 559 Nations Technologies Inc. Tel:+86-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 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 225 / 559 Nations Technologies Inc. Tel:+86-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 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. 226 / 559 Nations Technologies Inc. Tel:+86-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: 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: 227 / 559 Nations Technologies Inc. Tel:+86-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: 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. 228 / 559 Nations Technologies Inc. Tel:+86-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 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. 229 / 559 Nations Technologies Inc. Tel:+86-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: 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, 230 / 559 Nations Technologies Inc. Tel:+86-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: 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 231 / 559 Nations Technologies Inc. Tel:+86-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: Auto-Reload Register (Timx_Ar)

    Setting the TIMx_EVTGEN.UDGN bit will reload the content of TIMx_REPCNT.REPCNT and generate an update event. 232 / 559 Nations Technologies Inc. Tel:+86-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: 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. 233 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 234: Capture/Compare Register 3 (Timx_Ccdat3)

    CC4 channel is configured as input: CCDAT4 contains the counter value transferred by the last input capture 4 event (IC4). 234 / 559 Nations Technologies Inc. Tel:+86-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: 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). 235 / 559 Nations Technologies Inc. Tel:+86-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 DTGN [then] = 111: dead time = (32 + DTGN [4:0]) × (16 × t value see TIMx_CTRL1.CLKD [1:0]. 236 / 559 Nations Technologies Inc. Tel:+86-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: Dma Control Register (Timx_Dctrl)

    00010: TIMx_SMCTRL, … ..10001:TIMx_BKDT 10010:TIMx_DCTRL 9.4.21 DMA transfer buffer register (TIMx_DADDR) Offset address: 0x4C Reset value: 0x0000 237 / 559 Nations Technologies Inc. Tel:+86-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: 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 238 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 239: Capture/Compare 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. 239 / 559 Nations Technologies Inc. Tel:+86-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: General-Purpose Timers (Tim3)

    Incremental (quadrature) encoder interface: used for tracking motion and resolving rotation direction and position  Hall sensor interface: used to do three-phase motor control 240 / 559 Nations Technologies Inc. Tel:+86-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: 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. 241 / 559 Nations Technologies Inc. Tel:+86-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: 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). 242 / 559 Nations Technologies Inc. Tel:+86-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: 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) 243 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 244: Figure 9-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 244 / 559 Nations Technologies Inc. Tel:+86-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: 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". 245 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 246: Figure 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) 246 / 559 Nations Technologies Inc. Tel:+86-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: Clock Selection

    10.3.3 Clock selection  The internal clock of timers :CK_INT  Two kinds of external clock mode : 247 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 248: Figure 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 248 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 249: Figure 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. 249 / 559 Nations Technologies Inc. Tel:+86-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: 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 250 / 559 Nations Technologies Inc. Tel:+86-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: 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. 251 / 559 Nations Technologies Inc. Tel:+86-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-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. 252 / 559 Nations Technologies Inc. Tel:+86-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 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 253 / 559 Nations Technologies Inc. Tel:+86-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: Input Capture Mode

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

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

    User should not modified TIMx_CTRL1.DIR by software, it is updated by hardware. 258 / 559 Nations Technologies Inc. Tel:+86-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-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. 259 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 260: Figure 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. 260 / 559 Nations Technologies Inc. Tel:+86-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: One-Pulse Mode

    4. TIMx_CCDAT1 writes the count value to be delayed (t ), TIMx_AR - TIMx_CCDAT1 is the count value of DELAY 261 / 559 Nations Technologies Inc. Tel:+86-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: 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. 262 / 559 Nations Technologies Inc. Tel:+86-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: 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. 263 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 264: Figure 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. 264 / 559 Nations Technologies Inc. Tel:+86-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: 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. 265 / 559 Nations Technologies Inc. Tel:+86-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: 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. 266 / 559 Nations Technologies Inc. Tel:+86-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: 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. 267 / 559 Nations Technologies Inc. Tel:+86-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: 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 268 / 559 Nations Technologies Inc. Tel:+86-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-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) 269 / 559 Nations Technologies Inc. Tel:+86-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: 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 270 / 559 Nations Technologies Inc. Tel:+86-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 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 271 / 559 Nations Technologies Inc. Tel:+86-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: 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 272 / 559 Nations Technologies Inc. Tel:+86-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 CNTEN Counter Enable 0: Disable counter 1: Enable counter 273 / 559 Nations Technologies Inc. Tel:+86-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: 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). 274 / 559 Nations Technologies Inc. Tel:+86-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: Slave Mode Control Register (Timx_Smctrl)

    01: ETRP frequency divided by 2 10: ETRP frequency divided by 4 11: ETRP frequency divided by 8 275 / 559 Nations Technologies Inc. Tel:+86-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 (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. 276 / 559 Nations Technologies Inc. Tel:+86-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: Dma/Interrupt Enable Registers (Timx_Dinten)

    0: Disable trigger DMA request 1: Enable trigger DMA request Reserved Reserved, the reset value must be maintained 277 / 559 Nations Technologies Inc. Tel:+86-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: 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 278 / 559 Nations Technologies Inc. Tel:+86-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 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. 279 / 559 Nations Technologies Inc. Tel:+86-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: 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. 280 / 559 Nations Technologies Inc. Tel:+86-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: 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 281 / 559 Nations Technologies Inc. Tel:+86-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 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. 282 / 559 Nations Technologies Inc. Tel:+86-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 0000: No filter, sampling at f frequency 0001: f , N = 2 SAMPLING CK_INT 0010: f , N = 4 SAMPLING CK_INT 283 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 284: Capture/Compare 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: 284 / 559 Nations Technologies Inc. Tel:+86-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 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. 285 / 559 Nations Technologies Inc. Tel:+86-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: 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: 286 / 559 Nations Technologies Inc. Tel:+86-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: 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 287 / 559 Nations Technologies Inc. Tel:+86-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: 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: 288 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 289: Capture/Compare Register 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 289 / 559 Nations Technologies Inc. Tel:+86-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 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 290 / 559 Nations Technologies Inc. Tel:+86-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: 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. 291 / 559 Nations Technologies Inc. Tel:+86-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 For the fourth time, DMA access to the TIMx_ DADDR register will be mapped to access TIMx_CCDAT4 register; 292 / 559 Nations Technologies Inc. Tel:+86-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: Basic Timers (Tim6)

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

    TIMx_STS.UDITF is set:  Update auto-reload shadow registers with preload value(TIMx_AR), when TIMx_CTRL1.ARPEN = 1. 294 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 295: Figure 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) 295 / 559 Nations Technologies Inc. Tel:+86-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: 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 296 / 559 Nations Technologies Inc. Tel:+86-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: 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). 297 / 559 Nations Technologies Inc. Tel:+86-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: 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 298 / 559 Nations Technologies Inc. Tel:+86-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: 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 299 / 559 Nations Technologies Inc. Tel:+86-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: 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 300 / 559 Nations Technologies Inc. Tel:+86-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: 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. 301 / 559 Nations Technologies Inc. Tel:+86-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: 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. 302 / 559 Nations Technologies Inc. Tel:+86-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: Low Power Timer (Lptim)

     Programmable digital filter for filtering glitch  Configurable output: Pulse, PWM  Configurable I/O polarity  Encoder mode 303 / 559 Nations Technologies Inc. Tel:+86-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: Block Diagram

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

    For the external inputs: The filter sensitivity is configured through the LPTIM_CFG.CLKFLT[1:0] bits.  For the internal trigger inputs: The filter sensitivity is configured through the LPTIM_CFG.RIGFLT[1:0] bits. 305 / 559 Nations Technologies Inc. Tel:+86-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: Timer Enable

    When timeout function is disabled, new trigger event will be ignored if the LPTIM is already started. Note: Any write to the LPTIM_CTRL.SNGMST/ LPTIM_CTRL.TSTCM bit will be discarded if the LPTIM is not 306 / 559 Nations Technologies Inc. Tel:+86-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: 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. 307 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 308: Figure 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. 308 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 309: Figure 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. 309 / 559 Nations Technologies Inc. Tel:+86-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: Waveform Generation

    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. 310 / 559 Nations Technologies Inc. Tel:+86-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: 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 311 / 559 Nations Technologies Inc. Tel:+86-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: Counter Mode

    LPTIM. The change of counting direction is updated by LPTIM_INTSTS.DOWN and LPTIM_INTSTS.UP flags. Also, an 312 / 559 Nations Technologies Inc. Tel:+86-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 ‘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’). 313 / 559 Nations Technologies Inc. Tel:+86-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: Non-Orthogonal Encoder Mode

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

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

    12.5 LPTIM registers 12.5.1 LPTIM register overview Table 12-5 LPTIM register overview Offset Register LPTIM_INTSTS 000h Reserved Reset Value 316 / 559 Nations Technologies Inc. Tel:+86-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: Lptim Interrupt And Status Register (Lptim_Intsts)

    Address offset: 0x00 Reset value: 0x0000 0000 Bit Field Name Description 31:7 Reserved Reserved, the reset value must be maintained. 317 / 559 Nations Technologies Inc. Tel:+86-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: Lptim Interrupt Clear Register (Lptim_Intclr)

    Direction change to UP Clear Flag Writing 1 to this bit clear the UP flag in the LPTIM_INTSTS register 318 / 559 Nations Technologies Inc. Tel:+86-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: Lptim Interrupt Enable Register (Lptim_Inten)

    0: EXTRIG interrupt disabled 1: EXTRIG interrupt enabled ARRMIE Auto reload match interrupt enable bit. 0: ARRM interrupt disabled 319 / 559 Nations Technologies Inc. Tel:+86-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: Lptim Configuration Register (Lptim_Cfg)

    LPTIM_COMP registers 1: The LPTIM output reflects the inverse of the compare results between LPTIM_ARR and LPTIM_COMP registers 320 / 559 Nations Technologies Inc. Tel:+86-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 111: / 128 Reserved Reserved, the reset value must be maintained. TRIGFLT[1:0] Configure the data filter trigger bit. 321 / 559 Nations Technologies Inc. Tel:+86-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: LPTIM is clocked by internal clock source (APB1 clock or any of the embedded oscillators) 1: LPTIM is clocked by an external clock source through the LPTIM external Input1 322 / 559 Nations Technologies Inc. Tel:+86-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: Lptim Control Register (Lptim_Ctrl)

    The LPTIMEN bit is set and cleared by software. 0: LPTIM is disabled 1: LPTIM is enabled 12.5.7 LPTIM compare register (LPTIM_COMP) Address offset: 0x14 323 / 559 Nations Technologies Inc. Tel:+86-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 Auto-Reload Register (Lptim_Arr)

    Reset value: 0x0000 0000 Reserved CNTVAL[15:0] Bit Field Name Description 31:16 Reserved Reserved, the reset value must be maintained. 324 / 559 Nations Technologies Inc. Tel:+86-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 If identical, the reading is reliable. 325 / 559 Nations Technologies Inc. Tel:+86-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: 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) 326 / 559 Nations Technologies Inc. Tel:+86-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: 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. 327 / 559 Nations Technologies Inc. Tel:+86-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: Debug Mode

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

    Reset value IWDG_STS 0x0C Reserved Reset value 13.5.2 IWDG key register (IWDG_KEY) Address offset: 0x00 Reset value: 0x00000000 329 / 559 Nations Technologies Inc. Tel:+86-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: 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 330 / 559 Nations Technologies Inc. Tel:+86-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: 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. 331 / 559 Nations Technologies Inc. Tel:+86-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: Window Watchdog (Wwdg)

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

    MCU. Counter count down from 0x7F to 0x3F using scaled APB1 333 / 559 Nations Technologies Inc. Tel:+86-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: 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. 334 / 559 Nations Technologies Inc. Tel:+86-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: 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 335 / 559 Nations Technologies Inc. Tel:+86-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: Wwdg Status Register (Wwdg_Sts)

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

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

    Signal types Annotations analog power supply and: 1.8V ≤ V ≤ Input, analog power supply Equivalent to V 338 / 559 Nations Technologies Inc. Tel:+86-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: Adc Clock

    The AHB_CLK frequency division can be configured as a working clock up to 18MHz. The AHB_CLK frequency division can be 1,2,3,4,6,8,10,12,16,32 339 / 559 Nations Technologies Inc. Tel:+86-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: Adc Switch Control

    The ADC_RSEQ1.LEN[23:20] bits specified regular channel sequence length. 340 / 559 Nations Technologies Inc. Tel:+86-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: 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. 341 / 559 Nations Technologies Inc. Tel:+86-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: 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[3:0]. 342 / 559 Nations Technologies Inc. Tel:+86-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: Scan Mode

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

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

    The total conversion time is calculated as follows: = Sampling time + 12 cycles CONV 345 / 559 Nations Technologies Inc. Tel:+86-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: 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 346 / 559 Nations Technologies Inc. Tel:+86-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: Dma Requests

    Not suitable for measuring absolute temperature. When accurate temperature measurement is required, an external temperature sensor should be used. 347 / 559 Nations Technologies Inc. Tel:+86-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: 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. 348 / 559 Nations Technologies Inc. Tel:+86-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 Interrupt

    Control OPA signal switching TIM_CC4 control The software sets the ADC_OPACTRL.JSQx_OPAEN register, and cooperates with ADC_JSEQ.JLEN [1:0] to select 349 / 559 Nations Technologies Inc. Tel:+86-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: Table 15-8 Opa Channel Selection

    The setup time is calculated as follows: T= ADC_OPACTRL.OPA_SETUP_TIME/adc clock frequency. If ADC clock frequency=16MHz, setup time is 5us, then OPA_SETUP_TIME=80 should be set. 350 / 559 Nations Technologies Inc. Tel:+86-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: Adc Registers

    038h Reset Value ADC_JSEQ JEQ4[3:0] JEQ3[3:0] JEQ2[3:0] JEQ1[3:0] 03Ch Reserved Reset Value ADC_JDAT1 JDAT1[15:0] 040h Reserved Reset Value 351 / 559 Nations Technologies Inc. Tel:+86-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: Adc Status Register (Adc_Sts)

    This bit is set by hardware at the start of regular channel conversion and cleared by software. 0: Regular channel conversion has not started. 352 / 559 Nations Technologies Inc. Tel:+86-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: Adc Control Register 1 (Adc_Ctrl1)

    This bit is set and cleared by the software. 0: Disables analog watchdog on regular channel. 1: Use analog watchdog on regular channels. 353 / 559 Nations Technologies Inc. Tel:+86-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 Note: If the ADC_CTRL1.ENDCIEN or ADC_CTRL1.JENDCIEN bits are set separately, ADC_STS.ENDC or ADC_STS.JENDC interrupts occur only after the last channel has been converted. 354 / 559 Nations Technologies Inc. Tel:+86-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: Adc Control Register 2 (Adc_Ctrl2)

    Address offset: 0x08 Reset value: 0x0000 0000 Bit field Name Description 31:24 Reserved Reserved,the reset value must be maintained 355 / 559 Nations Technologies Inc. Tel:+86-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 0: Start conversion without external events. 1: Use an external event to start the conversion. 356 / 559 Nations Technologies Inc. Tel:+86-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: Adc Sampling Time Register 1 (Adc_Sampt1)

    This is to prevent the wrong conversion from being triggered. 15.11.5 ADC sampling time register 1 (ADC_SAMPT1) Address offset: 0x0C Reset value: 0x0000 0000 357 / 559 Nations Technologies Inc. Tel:+86-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 Sampling Time Register 2 (Adc_ Sampt2)

    ADC analog channel 13 and channel 14 are internally connected to the temperature sensor and VREFINT, respectively. 15.11.7 ADC sampling time register 3 (ADC_SAMPT3) Address offset: 0x14 Reset value: 0x0000 0000 358 / 559 Nations Technologies Inc. Tel:+86-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 0101: 42 cycles 1101: 400 cycles 0110: 56 cycles 1110: 480 cycles 0111: 72 cycles 1111: 600 cycles 359 / 559 Nations Technologies Inc. Tel:+86-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 Injected Channel Data Offset Register X (Adc_Joffsetx) (X=1

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

    14th conversion in regular sequence Reserved Reserved,the reset value must be maintained SEQ13[3:0] 13th conversion in regular sequence 361 / 559 Nations Technologies Inc. Tel:+86-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: Adc Regular Sequence Register 2 (Adc_Rseq2)

    Address offset: 0x38 Reset value: 0x0000 0000 Bit field Name Description 31:29 Reserved Reserved,the reset value must be maintained 362 / 559 Nations Technologies Inc. Tel:+86-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 Injection Sequence Register (Adc_Jseq)

    Note: Different from regular conversion sequences, if the length of ADC_JSEQ.JLEN[1:0] is less than 4, the sequence of conversion starts from (4-JLEN). For example, ADC_JSEQ[21:0] = 10 363 / 559 Nations Technologies Inc. Tel:+86-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: Adc Injection Data Register X (Adc_Jdatx) (X= 1

    15.11.16 ADC regulars data register (ADC_DAT) Address offset: 0x50 Reset value: 0x0000 0000 Reserved DAT[15:0] 364 / 559 Nations Technologies Inc. Tel:+86-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 Control Register 3 (Adc_Ctrl3)

    Reserved,the reset value must be maintained VREFRDY VREFINT_READY ADC internal input buffer ready status, software must check this status bit before measuring 365 / 559 Nations Technologies Inc. Tel:+86-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 Test Register (Adc_Test)

    1: ADC works in test mode 15.11.19 ADC OPA control register (ADC_OPACTRL) Address offset: 0x5C Reset value: 0x0000 0000 366 / 559 Nations Technologies Inc. Tel:+86-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 Injected channel 1 for OPA mux enable 0: do not switch 1: Switch to the channel indicated by the JSQ1_OPASEL register 367 / 559 Nations Technologies Inc. Tel:+86-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: Comparator (Comp)

    Can be equipped with read-only or read-write, in the case of locking, it needs to be reset to unlock 368 / 559 Nations Technologies Inc. Tel:+86-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: Comp Configuration Process

    Comparator output, support trigger events, for example, it can be configured as timer 1, timer 8 brake function. Note: Refer to the comparator interconnection for specific configuration. 369 / 559 Nations Technologies Inc. Tel:+86-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: Comparator Interconnection

    COMP_CTRL register sets the polarity of the POL bit is not reversed and the interrupt is enabled. When INPSEL > INMSEL, the comparator interrupt will be generated when the OUT bit of the COMP_CTRL register 370 / 559 Nations Technologies Inc. Tel:+86-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: Comp Register

    Reserved Reset Value COMP_FILP CLKPSC[15:0] 018h Reserved Reset Value 01Ch Reserved 03Ch COMP_INVREF VREFSEL 040h Reserved Reset Value 371 / 559 Nations Technologies Inc. Tel:+86-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: Comp Interrupt Enable Register (Comp_Inten)

    COMP Write 0 to clear 16.7.4 COMP lock register(COMP_LOCK) Address offset : 0x0C Reset value : 0x0000 0000 372 / 559 Nations Technologies Inc. Tel:+86-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: Comp Control Register (Comp_Ctrl)

    010: TIM8 OC5 selected as blanking source Other values: reserved 13:12 HYST[1:0] These bits control the hysteresis level. 373 / 559 Nations Technologies Inc. Tel:+86-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 negative input select 00: VREF 01: PA0 10: PA4 11: PA5 This bit switches COMP ON/OFF. 0: disabled 1: enabled 374 / 559 Nations Technologies Inc. Tel:+86-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 Filter Control Register (Comp_Filc)

    System clock divider = CLK_PRE_CYCLE + 1, e.g. 0: Every cycle 1: Every 2 cycle 2: Every 3 cycle … 375 / 559 Nations Technologies Inc. Tel:+86-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 Reference Input Compare Voltage Register (Comp_Invref)

    Comparator reference input comparison voltage VREF gear selection 0~VDDA, a total of 64 gears VREFEN Comparator reference input compare voltage VREF enable 0: disable 1: enable 376 / 559 Nations Technologies Inc. Tel:+86-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: I2C Interface

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

    The block diagram of I C interface is shown in the figure below. 378 / 559 Nations Technologies Inc. Tel:+86-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: 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. 379 / 559 Nations Technologies Inc. Tel:+86-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 Each I2C device is identified by a unique address. According to the device function, they can be either a transmitter or a receiver. 380 / 559 Nations Technologies Inc. Tel:+86-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 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. 381 / 559 Nations Technologies Inc. Tel:+86-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: 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 382 / 559 Nations Technologies Inc. Tel:+86-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: Figure 17-4 Slave Receiver Transfer Sequence Diagram

    When the START condition is generated on the 383 / 559 Nations Technologies Inc. Tel:+86-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 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. 384 / 559 Nations Technologies Inc. Tel:+86-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: Figure 17-5 Master Transmitter Transfer Sequence Diagram

    The software sequence of EV8 must be completed before the end of the current byte transfer. 385 / 559 Nations Technologies Inc. Tel:+86-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 1, an acknowledge pulse will be sent. At this time, the software can read the first byte from the I2C_DAT 386 / 559 Nations Technologies Inc. Tel:+86-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: 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: 387 / 559 Nations Technologies Inc. Tel:+86-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: 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 388 / 559 Nations Technologies Inc. Tel:+86-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: Dma Application

    DMA ocurrs a interrrupt. Note: if DMA is used for transmission, do not set I2C_CTRL2.BUFINTEN bit. 389 / 559 Nations Technologies Inc. Tel:+86-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: 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. 390 / 559 Nations Technologies Inc. Tel:+86-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: 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. 391 / 559 Nations Technologies Inc. Tel:+86-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: 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, 392 / 559 Nations Technologies Inc. Tel:+86-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: Debug Mode

    ADDR10F Received stop (slave) STOPF Data byte transfer completed. Receive buffer is not empty. RXDATNE EVTINTEN and BUFINTEN 393 / 559 Nations Technologies Inc. Tel:+86-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: 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 394 / 559 Nations Technologies Inc. Tel:+86-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 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. 395 / 559 Nations Technologies Inc. Tel:+86-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 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; 396 / 559 Nations Technologies Inc. Tel:+86-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: 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. 397 / 559 Nations Technologies Inc. Tel:+86-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 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 398 / 559 Nations Technologies Inc. Tel:+86-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: 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 399 / 559 Nations Technologies Inc. Tel:+86-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: 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. 400 / 559 Nations Technologies Inc. Tel:+86-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 If a NACK is received, or the next byte to be sent is PEC(I2C_CTRL1.PEC=1), this bit will not be set. 401 / 559 Nations Technologies Inc. Tel:+86-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 (I2C_STS1.TXDATE=1). Note: After receiving a NACK, the BSF bit will not be set. 402 / 559 Nations Technologies Inc. Tel:+86-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: 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 403 / 559 Nations Technologies Inc. Tel:+86-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: I2C Clock Control Register (I2C_Clkctrl)

    10 MHz, so that a fast clock of 400KHz can be generated PCLK1 404 / 559 Nations Technologies Inc. Tel:+86-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: 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 405 / 559 Nations Technologies Inc. Tel:+86-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 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). 406 / 559 Nations Technologies Inc. Tel:+86-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: Universal Synchronous Asynchronous Receiver Transmitter (Usart)

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

    Among them, TX is the output pin for serial data transmission. When the transmitter is active 408 / 559 Nations Technologies Inc. Tel:+86-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: 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. 409 / 559 Nations Technologies Inc. Tel:+86-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: 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. 410 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 411: Table 18-1 Stop Bit Configuration

    9-bit data, the break frame consists of 11 bits of low level, 411 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 412: Figure 18-5 Transmisson Delay

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

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

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

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

    Received bits Data validity Effective be invalid be invalid be invalid be invalid be invalid be invalid Effective 417 / 559 Nations Technologies Inc. Tel:+86-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: 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 418 / 559 Nations Technologies Inc. Tel:+86-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: Receiver's Tolerance Clock Deviation

    The tolerance of the USART receiver is equal to the maximum tolerable variation. 419 / 559 Nations Technologies Inc. Tel:+86-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: 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. 420 / 559 Nations Technologies Inc. Tel:+86-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: Dma Application

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

    5. Start the channel. 422 / 559 Nations Technologies Inc. Tel:+86-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: 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. 423 / 559 Nations Technologies Inc. Tel:+86-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: 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 424 / 559 Nations Technologies Inc. Tel:+86-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: 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: 425 / 559 Nations Technologies Inc. Tel:+86-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-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. 426 / 559 Nations Technologies Inc. Tel:+86-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: 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. 427 / 559 Nations Technologies Inc. Tel:+86-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: 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 428 / 559 Nations Technologies Inc. Tel:+86-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: 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) 429 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 430: Figure 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. 430 / 559 Nations Technologies Inc. Tel:+86-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: Single-Wire Half-Duplex Mode

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

    RX line has gone back to high.An interrupt is generated if the LIN breaker detection interrupt (USART_CTRL2.LINBDIEN) is enabled. 433 / 559 Nations Technologies Inc. Tel:+86-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: 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 434 / 559 Nations Technologies Inc. Tel:+86-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: Smartcard Mode (Iso7816)

    In smart card mode, the data bits should be configured as 8 bits, and the parity bit should be configured. 435 / 559 Nations Technologies Inc. Tel:+86-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-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. 436 / 559 Nations Technologies Inc. Tel:+86-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: Interrupt Request

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

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

    Reset value : undefined (uncertain value) Bit field Name Description 31:9 Reserved Reserved, the reset value must be maintained 441 / 559 Nations Technologies Inc. Tel:+86-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: 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 442 / 559 Nations Technologies Inc. Tel:+86-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 1: IDLE line detection interrupt is enabled. TXEN Transmitter enable. 0: The transmitter is disabled. 1: the transmitter is enabled. RXEN Receiver enable 443 / 559 Nations Technologies Inc. Tel:+86-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: Usart Control Register 2 Register (Usart_Ctrl2)

    01:0.5 stop bit. 10:2 stop bit. 11:1.5 stop bit. CLKEN Clock enable 0:CK pin is disabled 1:CK pin enabled 444 / 559 Nations Technologies Inc. Tel:+86-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: Usart Control Register 3 Register (Usart_Ctrl3)

    18.7.7 USART control register 3 register (USART_CTRL3) Address offset : 0x14 Reset value : 0x0000 0000 445 / 559 Nations Technologies Inc. Tel:+86-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 IRDALP IrDA low-power mode. This bit is used to select the low power consumption mode for IrDA mode. 446 / 559 Nations Technologies Inc. Tel:+86-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: Usart Guard Time And Prescaler Register (Usart_Gtp)

    PSCV can only be set to 00000001. In Smartcard mode: PSCV[4:0] is used to set the frequency division of Smartcard clock generated by 447 / 559 Nations Technologies Inc. Tel:+86-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 0010: Divide the source clock by 4. … 1111: Divide the source clock by 62. In Smartcard mode, PSCV[7:5] is reserved. 448 / 559 Nations Technologies Inc. Tel:+86-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: Low Power Universal Asynchronous Receiver Transmitter (Lpuart)

     Start bit detection  Receive buffer non-empty detection  A configurable receive byte  A programmable 4-byte frame 449 / 559 Nations Technologies Inc. Tel:+86-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: 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: 450 / 559 Nations Technologies Inc. Tel:+86-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: 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. 451 / 559 Nations Technologies Inc. Tel:+86-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 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. 452 / 559 Nations Technologies Inc. Tel:+86-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: 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: 453 / 559 Nations Technologies Inc. Tel:+86-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 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. 454 / 559 Nations Technologies Inc. Tel:+86-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: Fractional Baud Rate Generation

    Baud rate frequency division coefficient (LPUARTDIV) has the following relationship with system clock (PCLK) : TX/RX baud rate = �� /(LPUARTDIV) 455 / 559 Nations Technologies Inc. Tel:+86-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 Note: The lower the clock frequency of the CPU, the lower the accuracy of a particular baud rate. 456 / 559 Nations Technologies Inc. Tel:+86-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: 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. 457 / 559 Nations Technologies Inc. Tel:+86-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: 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. 458 / 559 Nations Technologies Inc. Tel:+86-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: 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. 459 / 559 Nations Technologies Inc. Tel:+86-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: 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. 460 / 559 Nations Technologies Inc. Tel:+86-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: 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 461 / 559 Nations Technologies Inc. Tel:+86-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: 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 462 / 559 Nations Technologies Inc. Tel:+86-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: 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 463 / 559 Nations Technologies Inc. Tel:+86-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: Lpuart Control Register (Lpuart_Ctrl)

    10) 1: 1 sample bits, closed noise detection 13:12 WUSEL[1:0] Wake up event selection. 464 / 559 Nations Technologies Inc. Tel:+86-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 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 465 / 559 Nations Technologies Inc. Tel:+86-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: 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 466 / 559 Nations Technologies Inc. Tel:+86-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: 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 467 / 559 Nations Technologies Inc. Tel:+86-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: Serial Peripheral Interface/Inter-Ic Sound (Spi/ I2S)

     Steady state clock polarity programmable.  The data direction is always MSB first.  Supports DMA function. 468 / 559 Nations Technologies Inc. Tel:+86-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: 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. 469 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 470: Figure 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. 470 / 559 Nations Technologies Inc. Tel:+86-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: 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. 471 / 559 Nations Technologies Inc. Tel:+86-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: Data Format

    SPI_CTRL1.LSBFF bit, the data bits follow the MSB or LSB order is serially shifted to the MOSI pin. At the 472 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 473: Figure 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. 473 / 559 Nations Technologies Inc. Tel:+86-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 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. 474 / 559 Nations Technologies Inc. Tel:+86-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: 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. 475 / 559 Nations Technologies Inc. Tel:+86-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: 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 476 / 559 Nations Technologies Inc. Tel:+86-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 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 477 / 559 Nations Technologies Inc. Tel:+86-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: Status Flag

    SPI_DAT register. When the send buffer is not empty, the hardware will clear this flag to 0. 478 / 559 Nations Technologies Inc. Tel:+86-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: 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 479 / 559 Nations Technologies Inc. Tel:+86-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: 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. 480 / 559 Nations Technologies Inc. Tel:+86-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: 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, 481 / 559 Nations Technologies Inc. Tel:+86-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: 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 482 / 559 Nations Technologies Inc. Tel:+86-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: Crc Error (Crcerr)

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

    (MSB) is sent and will change on the falling edge of the clock signal. 485 / 559 Nations Technologies Inc. Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 486: Figure 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). 486 / 559 Nations Technologies Inc. Tel:+86-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 (MSB) are generated simultaneously. The standard data receiving and sending processing mode is the same as I S Philips standard. 487 / 559 Nations Technologies Inc. Tel:+86-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-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 488 / 559 Nations Technologies Inc. Tel:+86-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-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 489 / 559 Nations Technologies Inc. Tel:+86-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-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. 490 / 559 Nations Technologies Inc. Tel:+86-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: 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 491 / 559 Nations Technologies Inc. Tel:+86-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: Clock Generator

    ���� ������ [ ( 32 × 2 ) × ( ( 2 × �������� ) + ������_��������) × 4] When MCLKOEN = 1 and CHBITS = 1, �� = �� ⁄ �� 492 / 559 Nations Technologies Inc. Tel:+86-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: 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; 493 / 559 Nations Technologies Inc. Tel:+86-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_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. 494 / 559 Nations Technologies Inc. Tel:+86-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: 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. 495 / 559 Nations Technologies Inc. Tel:+86-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

    Interrupt event Event flag bit Enable control bit Send buffer empty flag TEINTEN Receive buffer non empty flag RNEINTEN 496 / 559 Nations Technologies Inc. Tel:+86-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: Dma Function

    LDIV[7:0] 020h Reserved Reset Value 20.5.2 SPI control register 1 (SPI_CTRL1) (not used in I2S mode) Address: 0x00 497 / 559 Nations Technologies Inc. Tel:+86-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 0: Full duplex (sending mode and receiving mode). 1: Disable output (receive-only mode). Note: Not used in I S mode. 498 / 559 Nations Technologies Inc. Tel:+86-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 0: In idle state, SCLK remains low. 1: In idle state, SCLK remains high. Note: This bit cannot be changed during communication. 499 / 559 Nations Technologies Inc. Tel:+86-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: 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. 500 / 559 Nations Technologies Inc. Tel:+86-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: Spi Status Register (Spi_Sts)

    1: Underflow occurred. Note:This bit is set by hardware and cleared according to the sequence of software operations. 501 / 559 Nations Technologies Inc. Tel:+86-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: 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 502 / 559 Nations Technologies Inc. Tel:+86-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: Spi Rx Crc Register (Spi_Crcrdat) (Not Used In I2S Mode)

    When CRC calculation is enabled, CRCTDAT[15:0] contains the CRC value calculated by the bytes sent subsequently. This register is reset when ‘1’ is written to the SPI_CTRL1.CRCEN bit. 503 / 559 Nations Technologies Inc. Tel:+86-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: Spi_ I2S Configuration Register(Spi_I2Scfg

    Reserved Reserved,the reset value must be maintained STDSEL Selection of I S standard 00: I S Philips standard. 504 / 559 Nations Technologies Inc. Tel:+86-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: Spi_I2S 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. 505 / 559 Nations Technologies Inc. Tel:+86-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 Note: For correct operation, this bit can only be set when I S is turned off. Note: not used in SPI mode. 506 / 559 Nations Technologies Inc. Tel:+86-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: Real-Time Clock (Rtc)

    SLEEP, STOP modes. 507 / 559 Nations Technologies Inc. Tel:+86-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 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 508 / 559 Nations Technologies Inc. Tel:+86-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: Rtc Function Description

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

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

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

    When RTC_CALIB or RTC_ALARM output is selected, the RTC_OUT pin (PC13) is automatically configured as open drain output. 513 / 559 Nations Technologies Inc. Tel:+86-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: Periodic Automatic Wakeup

    RTC_INITSTS.TISOVF flag to 1, and the timestamp registers (RTC_TST and RTC_TSD) will continue to hold the value of the previous event, which means timestamp registers(RTC_TST and RTC_TSD) data will not change when 514 / 559 Nations Technologies Inc. Tel:+86-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: Tamper Detection

    The internal pull-up resistance of tamper pin can be precharged before each sampling, and the precharge time is 515 / 559 Nations Technologies Inc. Tel:+86-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: Daylight Saving Time Configuration

    = �� ∗ (1 + ������������ + ������_����������.����[8:0] – ������_����������.���� ∗ 512 Note: n=20/19/18 Calibrated when RTC_PRE .DIVA[6:0]<3 516 / 559 Nations Technologies Inc. Tel:+86-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: 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. 517 / 559 Nations Technologies Inc. Tel:+86-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: 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 518 / 559 Nations Technologies Inc. Tel:+86-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: 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 519 / 559 Nations Technologies Inc. Tel:+86-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: 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 520 / 559 Nations Technologies Inc. Tel:+86-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 0: Disable Alarm B interrupt 1: Enable Alarm B Interrupt ALAIEN Alarm A interrupt enable 0: Disable Alarm A interrupt 521 / 559 Nations Technologies Inc. Tel:+86-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 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. 522 / 559 Nations Technologies Inc. Tel:+86-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 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 523 / 559 Nations Technologies Inc. Tel:+86-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 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. 524 / 559 Nations Technologies Inc. Tel:+86-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 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 525 / 559 Nations Technologies Inc. Tel:+86-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: 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 526 / 559 Nations Technologies Inc. Tel:+86-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: 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 527 / 559 Nations Technologies Inc. Tel:+86-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: 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) 528 / 559 Nations Technologies Inc. Tel:+86-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: 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 529 / 559 Nations Technologies Inc. Tel:+86-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: Rtc Timestamp Date Register (Rtc_Tsd)

    Describes which Week day 000: Forbidden 001: Monday 111: Sunday Describes the month tens value in BCD format 530 / 559 Nations Technologies Inc. Tel:+86-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 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 531 / 559 Nations Technologies Inc. Tel:+86-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 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. 532 / 559 Nations Technologies Inc. Tel:+86-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 TPFLT = 00, tamper detection is in edge mode: 0: Rising edge trigger a tamper detection event. 533 / 559 Nations Technologies Inc. Tel:+86-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 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. 534 / 559 Nations Technologies Inc. Tel:+86-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: 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]. 535 / 559 Nations Technologies Inc. Tel:+86-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 536 / 559 Nations Technologies Inc. Tel:+86-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: Operational Amplifier (Opamp)

    The output of OPAMP is connected to analog input Channel6 of ADC. Figure 22-1 Block diagram of OPAMP connection diagram 537 / 559 Nations Technologies Inc. Tel:+86-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: Opamp Working Mode

    OPAMP are all connected to the external port, and the amplification factor is determined by the external resistance-capacitance network. 538 / 559 Nations Technologies Inc. Tel:+86-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: 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. 539 / 559 Nations Technologies Inc. Tel:+86-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: 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. 540 / 559 Nations Technologies Inc. Tel:+86-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: Opamp Independent Write Protection

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

    1: Turn on automatic switching Reserve Reserved,the reset value must be maintained 11:9 VPSEL[2:0] OPAMP Non Inverted input selection Enumerated value OPAMP 542 / 559 Nations Technologies Inc. Tel:+86-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: Opamp Lock Register (Opamp_Lock)

    OPAMP Enable 0: Disable 1: Enable 22.3.3 OPAMP Lock Register (OPAMP_LOCK) Address offset: 0x4 Reset value: 0x0000 0000 543 / 559 Nations Technologies Inc. Tel:+86-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 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 544 / 559 Nations Technologies Inc. Tel:+86-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: Beeper

    Address offset: 0x00 Reset value: 0x0000 0000 Bit Field Name Description 31:14 Reserved Reserved, the reset value must be maintained. 545 / 559 Nations Technologies Inc. Tel:+86-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 01110: M7 (Alto 7) 01111: H1 (Treble 1) 10000: H2 (Treble 2) 10001: H3 (Treble 3) 10010: H4 (Treble 4) 546 / 559 Nations Technologies Inc. Tel:+86-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 Bit Field Name Description 10011: H5 (Treble 5) 10100: H6 (Treble 6) 10101: H7 (Treble 7) default: … 547 / 559 Nations Technologies Inc. Tel:+86-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: 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 548 / 559 Nations Technologies Inc. Tel:+86-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: 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 549 / 559 Nations Technologies Inc. Tel:+86-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: 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 550 / 559 Nations Technologies Inc. Tel:+86-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: 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 551 / 559 Nations Technologies Inc. Tel:+86-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: 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 552 / 559 Nations Technologies Inc. Tel:+86-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: 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 553 / 559 Nations Technologies Inc. Tel:+86-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: 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 554 / 559 Nations Technologies Inc. Tel:+86-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: Swd Function

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

    Modify 21.3.11 chapter,delete descriptions about RTC_OPT register Add note and figure 18-5 about transmisson delay in chapter 18.4.2.5 558 / 559 Nations Technologies Inc. Tel:+86-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: 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