Nations N32A455 Series User Manual

32-bit arm cortex-m4 microcontroller
Table of Contents

Advertisement

Quick Links

N32A455 series
®
®
32-bit ARM
Cortex
-M4 microcontroller
User manual V1.0.0

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Артём
February 17, 2025

как перевести Nation N32G455 в режим программирования

Summary of Contents for Nations N32A455 Series

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

    4.1.1 Power supply ..............................72 4.1.2 Power supply supervisor ............................ 74 ................................76 OWER MODES 4.2.1 SLEEP mode ............................... 80 Nations Technologies Inc. 2 / 701 Tel:+86-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 6.3.2 Clock Control Register (RCC_CTRL) ........................104 6.3.3 Clock Configuration Register (RCC_CFG) ......................105 6.3.4 Clock Interrupt Register (RCC_CLKINT) ......................108 Nations Technologies Inc. 3 / 701 Tel:+86-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 7.4.9 AFIO alternate remap configuration register 4 (AFIO_ RMP_CFG4 ) ............... 166 7.4.10 AFIO alternate remapping configuration register 5(AFIO_RMP_CFG5) ............169 Nations Technologies Inc. 4 / 701 Tel:+86-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 9.3.8 Analog watchdog .............................. 201 9.3.9 Scanning mode ..............................202 9.3.10 Injection channel management........................202 9.3.11 Discontinuous mode ............................203 Nations Technologies Inc. 5 / 701 Tel:+86-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 ................................233 NTRODUCTION ................................. 233 AIN FEATURES ....................235 FUNCTION DESCRIPTION AND OPERATION DESCRIPTION 10.3.1 DAC enable ..............................235 Nations Technologies Inc. 6 / 701 Tel:+86-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 11.3.1 Time-base unit ..............................256 11.3.2 Counter mode ..............................257 11.3.3 Repetition counter ............................262 11.3.4 Clock selection ..............................265 Nations Technologies Inc. 7 / 701 Tel:+86-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 11.4.24 Capture/compare register 6 (TIMx_CCDAT6) ....................321 GENERAL-PURPOSE TIMERS (TIM2, TIM3, TIM4 AND TIM5) ..................322 ........................322 ENERAL PURPOSE TIMERS INTRODUCTION Nations Technologies Inc. 8 / 701 Tel:+86-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 BASIC TIMERS (TIM6 AND TIM7) ..........................375 ................................375 NTRODUCTION ................................375 AIN FEATURES ............................375 ASIC TIMERS DESCRIPTION 13.3.1 Time-base unit ..............................375 Nations Technologies Inc. 9 / 701 Tel:+86-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 14.3.5 RTC Initial Status Register (RTC_INITSTS) ....................... 400 14.3.6 RTC Prescaler Register (RTC_PRE) ........................402 14.3.7 RTC Wakeup Timer Register (RTC_WKUPT)....................402 Nations Technologies Inc. 10 / 701 Tel:+86-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 16.5.1 IWDG register overview ..........................422 16.5.2 IWDG key register (IWDG_KEY) ........................422 16.5.3 IWDG pre-scaler register (IWDG_PREDIV) ..................... 422 Nations Technologies Inc. 11 / 701 Tel:+86-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 18.5.4 Command format ............................466 18.5.5 Response format ............................467 ............................470 ARDWARE FLOW CONTROL SDIO ................................. 470 REGISTER Nations Technologies Inc. 12 / 701 Tel:+86-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 19.7.1 Register Description ............................507 19.7.2 CAN register address overview ........................508 19.7.3 CAN control and status register ........................512 Nations Technologies Inc. 13 / 701 Tel:+86-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 21.3.1 SDA and SCL line control ..........................569 21.3.2 Software communication process ........................570 21.3.3 Error conditions description ........................... 580 Nations Technologies Inc. 14 / 701 Tel:+86-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 22.7.3 USART Data register (USART_DAT) ........................ 628 22.7.4 USART Baud rate register (USART_BRCF) ...................... 629 22.7.5 USART control register 1 register (USART_CTRL1) ..................629 Nations Technologies Inc. 15 / 701 Tel:+86-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 23.6.29 QSPI XIP INCR transfer opcode Register (QSPI_XIP_INCR_TOC) ..............661 23.6.30 QSPI XIP WRAP transfer opcode Register (QSPI_XIP_WRAP_TOC) .............. 661 Nations Technologies Inc. 16 / 701 Tel:+86-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 25.3.2 OPAMP Control Status Register (OPAMPx_CS) ....................689 25.3.3 OPAMP Lock register (OPAMP_LOCK) ......................691 DEBUG SUPPORT (DBG) ............................692 ................................692 VERVIEW Nations Technologies Inc. 17 / 701 Tel:+86-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 UNIQUE DEVICE SERIAL NUMBER (UID) ........................ 699 ................................699 NTRODUCTION ................................699 REGISTER UCID ................................. 699 REGISTER VERSION HISTORY ..............................700 NOTICE .................................. 701 Nations Technologies Inc. 18 / 701 Tel:+86-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 7-14 TIM3 alternate function remapping ....................140 Table 7-15 TIM2 alternate function remapping ....................141 Table 7-16 TIM1 alternate function remapping ....................141 Nations Technologies Inc. 19 / 701 Tel:+86-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 7-44 SDIO .............................. 148 Table 7-45 QSPI .............................. 148 Table 7-46 Other .............................. 148 Table 7-47 GPIO registers overview........................ 150 Nations Technologies Inc. 20 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 21 Table 13-1 Register overview .......................... 381 Table 14-1 RTC feature support ........................387 Table 14-2 RTC register overview ........................396 Nations Technologies Inc. 21 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 22 Table 18-23 Short response format ........................466 Table 18-24 Long response format ........................467 Table 18-25 R1 response..........................467 Table 18-26 R2 response..........................468 Nations Technologies Inc. 22 / 701 Tel:+86-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 Table 24-1 COMP register overview ....................... 672 Table 25-1 OPAMP register overview ......................688 Table 26-1 Debug port pin ..........................694 Nations Technologies Inc. 23 / 701 Tel:+86-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 Table 26-2 DBG register overview ........................695 Nations Technologies Inc. 24 / 701 Tel:+86-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 9-11 Schematic diagram of fast alternate mode conversion for continuous conversion of 1 channel ... 211 Figure 9-12 Schematic diagram of slow alternate mode conversion for 1 channel ........212 Nations Technologies Inc. 25 / 701 Tel:+86-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 11-16 Capture/compare channel (example: channel 1 input stage) ............269 Figure 11-17 Capture/compare channel 1 main circuit ..................270 Nations Technologies Inc. 26 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 27 Figure 12-13 Capture/compare channel (example: channel 1 input stage) ............334 Figure 12-14 Capture/compare channel 1 main circuit ..................335 Nations Technologies Inc. 27 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 28 Figure 18-5 SDIO continuous write operation....................433 Figure 18-6 SDIO block diagram ........................433 Figure 18-7 SDIO adapter ..........................434 Nations Technologies Inc. 28 / 701 Tel:+86-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 ............................540 Figure 20-9 Schematic diagram of TE/BUSY change during continuous transmission in slave unidirectional Nations Technologies Inc. 29 / 701 Tel:+86-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 Figure 22-4 configuration stop bit ........................602 Figure 22-5 TXC/TXDE changes during transmission ..................603 Figure 22-6 Start bit detection ......................... 604 Nations Technologies Inc. 30 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 31 Figure 25-8 Internal gain mode with filter ....................... 687 Figure 26-1 N32A455 level and Cortex -M4F level debugging block diagram ........... 692 Nations Technologies Inc. 31 / 701 Tel:+86-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 Nations Technologies Inc. 32 / 701 Tel:+86-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: Abbreviations In The Text

    For all models of N32A455 microcontroller series, the existence and number of a peripheral, please refer to the data sheet of the corresponding model. Nations Technologies Inc. 33 / 701 Tel:+86-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: Interrupts And Events

    Settable DebugMonitor (debug monitor) Debugging monitor 0x0000_0030 Reserved 0x0000_0034 Settable PendSV System services that can be suspended 0x0000_0038 Nations Technologies Inc. 34 / 701 Tel:+86-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 Settable I2C2_ER I2C2 error interrupt 0x0000_00C8 Settable SPI1 SPI1 global interrupt 0x0000_00CC Settable SPI2_I2S2 SPI2/I2S2 global interrupt 0x0000_00D0 Nations Technologies Inc. 35 / 701 Tel:+86-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 Settable I2C4_ER I2C4 error interrupt 0x0000_0164 Settable UART6 UART6 global interrupt 0x0000_0168 Settable UART7 UART7 global interrupt 0x0000_016C Nations Technologies Inc. 36 / 701 Tel:+86-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: External Interrupt/Event Controller (Exti)

    Three types of trigger events are supported: rising edge, falling edge or double edge.  Wake-up to exit power-saving mode Nations Technologies Inc. 37 / 701 Tel:+86-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: Functional Description

    In addition, by writing '1' in the software interrupt/event register, an interrupt/event request can also be generated by software. Nations Technologies Inc. 38 / 701 Tel:+86-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: Exti Line Mapping

    The general I/O port is connected to 16 external interrupt/event lines in the way shown above. The other 5 EXTI lines are connected as follows:  The EXTI line 16 is Reserved. Nations Technologies Inc. 39 / 701 Tel:+86-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: Exti Registers

    Address offset: 0x00 Reset value: 0x0000 0000 Bit field Name Description 31:21 Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 40 / 701 Tel:+86-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: Exti Event Mask Register (Exti_Emask)

    1: Rising trigger enabled (interrupts and events) for input line x. 2.3.5 Falling trigger selection register (EXTI_FT_CFG) Address offset: 0x0C Reset value: 0x0000 0000 Nations Technologies Inc. 41 / 701 Tel:+86-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: Exti Software Interrupt Event Register (Exti_Swie)

    Note: By writing '1' to clear the corresponding bit of EXTI_PEND, this bit can be cleared to '0'. 2.3.7 EXTI pending register (EXTI_PEND) Address offset: 0x14 Reset value: 0x0000 0000 Nations Technologies Inc. 42 / 701 Tel:+86-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: Exti 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 event. Nations Technologies Inc. 43 / 701 Tel:+86-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: Memory And Bus Architecture

     The DCode bus connects the DCode bus of Cortex™-M4FP core with the data interface of flash memory Nations Technologies Inc. 44 / 701 Tel:+86-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: Bus Address Mapping

    Atomic accesses can be made through the bit-band Alias to performed read-modify-write operations on the target bits of the bit-band region. The specific mapping is as follows: Nations Technologies Inc. 45 / 701 Tel:+86-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: Bit Banding

    The following mapping formula shows how each byte in the alias area corresponds to the corresponding bit in the bit Nations Technologies Inc. 46 / 701 Tel:+86-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: Boot Management

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

    The information area is 20KB, including 10 Page, and consists of system storage area (16KB), system configuration area (2KB) and option byte area (2KB). Nations Technologies Inc. 48 / 701 Tel:+86-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: Table 3-2 Flash Bus Address List

     Option byte area, writing to main memory and information block is managed by embedded flash programming/erasing controller. Nations Technologies Inc. 49 / 701 Tel:+86-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  Set the FLASH_CTRL.PER bit to' 1';  Select the page to be erased with the FLASH_ADD register; Nations Technologies Inc. 50 / 701 Tel:+86-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 Check the FLASH_ STS.BUSY bit to confirm that there are no other flash operations in progress;  Unlock the FLASH_CTRL.OPTWE bit; Nations Technologies Inc. 51 / 701 Tel:+86-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: Option Byte

    After each system reset, the option byte data is read out from the option byte block of Flash and stored in the option byte register (FLASH_OB/FLASH_WRP) with read-only property. At the same time, the option byte complement Nations Technologies Inc. 52 / 701 Tel:+86-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: Table 3-3 Option Byte List

     WRP0: write protection of pages 0-15, bit [0] corresponds to Page0 / 1,., bit [7] corresponds to page14 / Nations Technologies Inc. 53 / 701 Tel:+86-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: Write Protect

     In unprotected state, corresponding (RDP1 == 0xA5 & nRDP1 == 0x5A) && (RDP2!= 0xCC | nRDP2!= 0x33); Nations Technologies Inc. 54 / 701 Tel:+86-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 RDP2. No matter what the value of RDP1 is, as long as it satisfies (RDP2==0xCC & nRDP2==0x33), it is L2 level. Nations Technologies Inc. 55 / 701 Tel:+86-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: Table 3-5 Flash Read-Write-Erase (1) Permission Control Table

    Before 4KB of flash No modification is JTAG/SWD Read-only Read-only Read-only level main memory area allowed. interface is Nations Technologies Inc. 56 / 701 Tel:+86-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 When changed to L0, level the main memory area Prohibit Read-write-erase Prohibit After 4KB of flash Read-write- Nations Technologies Inc. 57 / 701 Tel:+86-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 Change to L1 or L2 is level allowed After 4KB of flash Read-write- Read-write- Read-write- Read-write-erase main memory area erase erase erase Nations Technologies Inc. 58 / 701 Tel:+86-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 Read-only Read-only Flash system memory Prohibit Read-write-erase Prohibit area SRAM (All) Read and write Read and Read and Nations Technologies Inc. 59 / 701 Tel:+86-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: Icache

    After iCache is reset, the FLASH_CAHR register automatically returns to the reset value. See for detailed usage method of 3.2.2.3.3 ICache locking. Nations Technologies Inc. 60 / 701 Tel:+86-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: Sram

    SRAM data cannot be retained in Stop2, Standby and VBAT modes; data in other working modes (Run/Sleep/Stop0) can be retained normally. Nations Technologies Inc. 61 / 701 Tel:+86-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: R-Sram(Retention Sram

    Retention is possible, data still needs to be retained in STOP2 and STANDBY modes (can be configured not to retain) 3.2.5 FLASH register These peripheral registers must be operated as words (32 bits). Nations Technologies Inc. 62 / 701 Tel:+86-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: Table 3-7 Flash Register Overview

    See for abbreviations in register descriptions 1.1 section. 3.2.5.2.1 The FLASH access control register (FLASH_AC) Address offset: 0x00 Reset value: 0x0000 0030 Nations Technologies Inc. 63 / 701 Tel:+86-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 011: three cycle delay, when 128MHz < SYSCLK <= 144MHz Other values: reserved 3.2.5.2.2 The FLASH key register (FLASH_KEY) Address offset: 0x04 Reset value: 0xXXXX XXXX Nations Technologies Inc. 64 / 701 Tel:+86-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 '1', and writing '1' can clear this bit status. Note: Every successful programming or erasing will set the EOP state. Nations Technologies Inc. 65 / 701 Tel:+86-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 This bit allows an interrupt to be generated when the FLASH_STS.EVERR/PVERR bit goes to '1'. 0: Interrupt generation is prohibited; Nations Technologies Inc. 66 / 701 Tel:+86-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 0: disable mass erase mode; 1: enable mass erase mode. Page erase. 0: disable page erase mode; 1: enable page erase mode Nations Technologies Inc. 67 / 701 Tel:+86-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 Note: This bit is read-only. 17:10 Data0[7:0] Data0 Note: This bit is read-only. Reserved Not used, the hardware remains at 1. Nations Technologies Inc. 68 / 701 Tel:+86-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: Write protection is invalid. Note: These bits are read-only. 3.2.5.2.9 ECC register(FLASH_ECC) Address offset: 0x24 Reset value: 0x0000 0000 Nations Technologies Inc. 69 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 70 Reserved, the reset value must be maintained. LOCKSTOP[3:0] iCache lock stop (see for detailed operation instructions 3.2.2.3.3 iCache locking Nations Technologies Inc. 70 / 701 Tel:+86-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 Bit field Name Description Chapter). 0: disable 1: enable LOCKSTRT[3:0] iCache lock start. 0: disable 1: enable Nations Technologies Inc. 71 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 72: Power Control (Pwr)

    The main modules of the digital backup area include PWR, IO (PA0_WAKUP, PC13_TAMPER, PC14, PC15), R-SRAM, RTC, BKR and RCC_BDCTRL registers. When the SW3 switch is on, the CPU goes Nations Technologies Inc. 72 / 701 Tel:+86-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 PC14 and PC15 can only be used for LSE pins.  PC13 is used for TAMPER pin, RTC alarm or periodic wake-up output Nations Technologies Inc. 73 / 701 Tel:+86-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: Power Supply Supervisor

    ), the chip will remain in reset state. POR/PDR For more information on switching power supply reset thresholds, see the Electrical Characteristics section of the Nations Technologies Inc. 74 / 701 Tel:+86-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: Figure 4-2 Waveforms Of Power-On Reset And Power-Down Reset

    Notice: MCU PVD threshold needs to be configured with the PWR_CTRL3.EXMODE bit. For details, please refer to the registers PWR_CTRL.MSB and PWR_CTRL.PRS[2:0], their combination can form a 4-bit PVD threshold configuration. Nations Technologies Inc. 75 / 701 Tel:+86-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: Power Modes

    No interrupt waiting, CPU external interrupt line exits returns from ISR STOP0 CPU deep sleep mode: WFI/WFE: wake: Nations Technologies Inc. 76 / 701 Tel:+86-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 VBAT HSE/HSI/PLL off. Except for NRST/PC13- VDD disable VDD enable TAMPER/PC14-OSC32_IN/PC15- OSC32_OUT, most IO ports are in high Nations Technologies Inc. 77 / 701 Tel:+86-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 Sleep VBAT Wakeup Wakeup Wakeup capability capability capability BKPOR/PDR HCLK HCLK (O) (O) Flash SRAM R-SRAM Backup Registers Nations Technologies Inc. 78 / 701 Tel:+86-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 Number of RTC Tamper pins USART1/2/3 UART4/5/6/7 I2C1/2/3/4 SPI1/2/3 CAN1/2 QSPI SDMMC OPAMP COMP Tempsensor TIMx IWDG Nations Technologies Inc. 79 / 701 Tel:+86-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: Sleep Mode

    If WFI instruction is used to enter the SLEEP mode, any NVIC interrupts can wake up the device from the SLEEP mode. Nations Technologies Inc. 80 / 701 Tel:+86-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: Stop0 Mode

    Note: If the application needs to disable the external clock before entering stop mode, it must first disable the RCC_CTRL.HSEEN bit and then switch the system clock to HSI. Otherwise, if the RCC_CTRL.HSEEN bit remains Nations Technologies Inc. 81 / 701 Tel:+86-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: Stop2 Mode

    STANDBY mode is a Cortex®-M4 based Deep-Sleep mode. The core domain is completely closed, and the backup region is open to supply power to BKR. Nations Technologies Inc. 82 / 701 Tel:+86-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: Vbat Mode

    MCU will be completely executed according to the power-on sequence. After waking up from VBAT Nations Technologies Inc. 83 / 701 Tel:+86-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: Low-Power Auto-Wakeup(Awu)Mode

    Reset Value PWR_CTRLSTS 004h Reserved Reserved Reset Value PWR_CTRL2 LSITRIM[4:0] 008h Reserved Reset Value PWR_CTRL3 00Ch Reserved Reset Value Nations Technologies Inc. 84 / 701 Tel:+86-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: Power Control Register (Pwr_Ctrl)

    1: Enable access to RTC and backup registers Note: This bit must remain 1 if the RTC clock is HSE/128. Nations Technologies Inc. 85 / 701 Tel:+86-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: Power Control Status Register(Pwr_Ctrlsts)

    Bit field Name Description 31:9 Reserved Reserved, the reset value must be maintained. WKUPEN Enable WKUP pin bit Nations Technologies Inc. 86 / 701 Tel:+86-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: Power Control Register 2 (Pwr_Ctrl2)

    4.4.4 Power control register 2 (PWR_CTRL2) Address offset: 0x08 Reset value: 0x0000 06E4 (reset by wakeup from STANDBY mode) Nations Technologies Inc. 87 / 701 Tel:+86-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: Power Control Register 3 (Pwr_Ctrl3)

    Reserved, the reset value must be maintained. EXMODE Extended mode control bits. 0: Normal mode 1: Extended mode Nations Technologies Inc. 88 / 701 Tel:+86-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: Backup Registers (Bkp)

    TAMPER pin. Therefore, the TAMPER pin should be connected to the correct level off-chip. Nations Technologies Inc. 89 / 701 Tel:+86-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: Bkp Registers

    Reserved Reset Value BKP_CTRLSTS 034h Reserved Reset Value 038h Reserved 03Ch Reserved BKP_DAT11 DAT[15:0] 040h Reserved Reset Value Nations Technologies Inc. 90 / 701 Tel:+86-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 Reset Value BKP_DAT32 DAT[15:0] 094h Reserved Reset Value BKP_DAT33 DAT[15:0] 098h Reserved Reset Value 09Ch BKP_DAT34 Reserved DAT[15:0] Nations Technologies Inc. 91 / 701 Tel:+86-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: Backup Data Register X (Bkp_Datx) (X = 1

    Address offset: 0x30 Reset value: 0x0000 0000 Bit field Name Description 15:2 Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 92 / 701 Tel:+86-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: Backup Control/Status Register (Bkp_Ctrlsts)

    1: Tamper detection interrupt is enabled (the TP_EN bit of the BKP_CTRL register must also be set to 1) Note 1: Intrusive interrupts cannot wake up the system core from low power modes. Nations Technologies Inc. 93 / 701 Tel:+86-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 This bit can only be written, and the read value is 0. 0: invalid 1: Clear the TEF tamper detection event flag (and reset the tamper detector). Nations Technologies Inc. 94 / 701 Tel:+86-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: Reset And Clock Control (Rcc)

     RAM parity error reset  Backup domain EMC reset  Retention domain EMC reset  BOR reset Nations Technologies Inc. 95 / 701 Tel:+86-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: Software Reset

    The backup domain has two dedicated resets that only affect the backup domain (see Figure 2-2 Power Supply Block Diagram). Nations Technologies Inc. 96 / 701 Tel:+86-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: Clock Control Unit

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

    The high-speed external clock signal (HSE) can be generated from the following two clock sources:  HSE external crystal/ceramic resonator  HSE user external clock Nations Technologies Inc. 98 / 701 Tel:+86-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: External Crystal/Ceramic Resonator (Hse Crystal)

    If the user application is subject to voltage or temperature variations, this may affect the accuracy of the RC oscillator. The HSI frequency can be trimmed by using the RCC_CTRL.HSITRIM[4:0] bits. Nations Technologies Inc. 99 / 701 Tel:+86-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: Pll Clock

    LSI). Calibration can be achieved by measuring the LSI clock frequency using the TIM5's input clock (TIM5_CLK). The Nations Technologies Inc. 100 / 701 Tel:+86-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: System Clock (Sysclk) Selection

    By programming RCC_BDCTRL.RTCSEL[1:0] bits, the RTCCLK clock source can be either the HSE/128, LSE, or LSI clocks. This selection cannot be changed unless the backup domain is reset. Nations Technologies Inc. 101 / 701 Tel:+86-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: Watchdog Clock

    The RCC registers are accessible through AHB bus. The register description is as follows. 6.3.1 RCC register overview Table 6-1 RCC register overview Offset Register 000h RCC_CTRL Reserved Reserved HSICAL[7:0] HSITRIM[4:0] Nations Technologies Inc. 102 / 701 Tel:+86-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 ADCHPRES RCC_CFG2 RNGCPRES[4:0] ADC1MPRES[4:0] ADCPLLPRES[4:0] 02Ch Reserved [3:0] Reset Value RCC_CFG3 TRNG1MPRES[4:0] 030h Reserved Reserved Reserved Reset Value Nations Technologies Inc. 103 / 701 Tel:+86-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: Clock Control Register (Rcc_Ctrl)

    External high-speed clock enable Set and cleared by software. When entering the stop0/stop2 or standby mode, it is Nations Technologies Inc. 104 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 105: Clock Configuration Register (Rcc_Cfg)

    0011: Divide PLL clock by 3 as MCO clock 0100: Divide PLL clock by 4 as MCO clock Nations Technologies Inc. 105 / 701 Tel:+86-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 01001: PLL input clock × 11 01010: PLL input clock × 12 01011: PLL input clock × 13 Nations Technologies Inc. 106 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 107 Set and cleared by software to configure the division factor of APB1 clock (PCLK1). Make sure that PCLK1 does not exceed 36MHz. Nations Technologies Inc. 107 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 108: Clock Interrupt Register (Rcc_Clkint)

    10: Select PLL output as system clock 11: Unavailable 6.3.4 Clock Interrupt Register (RCC_CLKINT) Address offset: 0x08 Reset value: 0x0000 0000 Nations Technologies Inc. 108 / 701 Tel:+86-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 LSE ready interrupt enable Set and cleared by software to enable and disable LSE ready interrupt. 0: Disable LSE ready interrupt Nations Technologies Inc. 109 / 701 Tel:+86-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: Apb2 Peripheral Reset Register (Rcc_Apb2Prst)

    1: Clock ready interrupt caused by LSI oscillator 6.3.5 APB2 Peripheral Reset Register (RCC_APB2PRST) Address offset: 0x0c Reset value: 0x0000 0000 Nations Technologies Inc. 110 / 701 Tel:+86-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 1: Reset TIM1 timer 10:7 Reserved Reserved, the reset value must be maintained. IOPERST GPIO port E reset. Nations Technologies Inc. 111 / 701 Tel:+86-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: Apb1 Peripheral Reset Register (Rcc_Apb1Prst)

    DACRST DAC interface reset. Set or cleared by software. 0: Clear the reset 1: Reset the DAC interface Nations Technologies Inc. 112 / 701 Tel:+86-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 Set and cleared by software. 0: Clear the reset 1: Reset USART2 Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 113 / 701 Tel:+86-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: Ahb Peripheral Clock Enable Register (Rcc_Ahbpclken)

    0: Clear the reset 1: Reset TIM2 timer 6.3.7 AHB Peripheral Clock Enable Register (RCC_AHBPCLKEN) Address offset: 0x14 Nations Technologies Inc. 114 / 701 Tel:+86-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 1: SAC clock enabled RNGCEN RNGC clock enable Set and cleared by software. 0: RNGC clock disabled 1: RNGC clock enabled Nations Technologies Inc. 115 / 701 Tel:+86-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: Apb2 Peripheral Clock Enable Register (Rcc_Apb2Pclken)

    Reserved, the reset value must be maintained. I2C4EN I2C4 clock enable Set and cleared by software. 0: I2C4 clock disabled 1: I2C4 clock enabled Nations Technologies Inc. 116 / 701 Tel:+86-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 IO Port C clock enable Set and cleared by software. 0: IO Port C clock disabled 1: IO Port C clock enabled Nations Technologies Inc. 117 / 701 Tel:+86-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: Apb1 Peripheral Clock Enable Register (Rcc_Apb1Pclken)

    0: Power interface clock disabled 1: Power interface clock enable BKPEN Backup interface clock enable Set and cleared by software. Nations Technologies Inc. 118 / 701 Tel:+86-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 Set and cleared by software. 0: SPI3 clock disabled 1: SPI3 clock enabled SPI2EN SPI2 clock enable Set and cleared by software. Nations Technologies Inc. 119 / 701 Tel:+86-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 TIM2EN TIM2 timer clock enable Set and cleared by software. 0: TIM2 clock disabled 1: TIM2 clock enabled Nations Technologies Inc. 120 / 701 Tel:+86-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: Backup Domain Control Register (Rcc_Bdctrl)

    LSEEN bit is cleared, LSERD goes low after 6 cycles of the LSE clock. 0: External low-speed oscillator not ready 1: External low-speed oscillator ready LSEEN External low-speed clock oscillator enable Nations Technologies Inc. 121 / 701 Tel:+86-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: Clock Control/Status Register (Rcc_Ctrlsts)

    0: No software reset occurred 1: Software reset occurred PORRSTF Power-on/power-down reset flag Set by hardware when a power-on/power-down reset occurs Nations Technologies Inc. 122 / 701 Tel:+86-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 Set and cleared by hardware to indicate if the internal RC 40 KHz oscillator is ready. After LSIEN is cleared, LSIRD goes low after 3 internal RC 40 KHz Nations Technologies Inc. 123 / 701 Tel:+86-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: Ahb Peripheral Reset Register (Rcc_Ahbprst)

    1: Reset ADC2 ADC1RST ADC1 reset Set and cleared by software. 0: Clear the reset 1: Reset ADC1 Nations Technologies Inc. 124 / 701 Tel:+86-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: Clock Configuration Register 2 (Rcc_Cfg2)

    ADC 1M clock prescaler Set and cleared by software to configure the division factor of ADC 1M clock source. Nations Technologies Inc. 125 / 701 Tel:+86-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 0111: HCLK clock divided by 16 1000: HCLK clock divided by 32 Others: HCLK clock divided by 32 Nations Technologies Inc. 126 / 701 Tel:+86-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: Clock Configuration Register 3 (Rcc_Cfg3)

    Set and cleared by software. 0: Disable BOR reset 1: Enable BOR reset Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 127 / 701 Tel:+86-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 And Afio

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

    Input 00: reserved Input pull-down Input pull-up I/O characteristics under different configurations are shown in the following table: Nations Technologies Inc. 129 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 130: Table 7-2 I/O Characteristics Of Different I/O Configurations

    ■ Schmidt trigger input is activated. ■ Weak pull-up and pull-down resistors are connected according to the input configuration (pull-up, pull-down or floating). Nations Technologies Inc. 130 / 701 Tel:+86-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: Figure 7-2 Input Float/Pull-Up/Pull-Down Configuration

    Read access to the input data register can get I/O status.  The read access to the output data register gets the last written value. Nations Technologies Inc. 131 / 701 Tel:+86-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: Figure 7-3 Output Mode Configuration

    I/O status can be obtained by reading and accessing the input data register.  The read access to the output data register gets the last written value. Nations Technologies Inc. 132 / 701 Tel:+86-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: Analog Mode

    Schmidt trigger input is disabled and output value is forced to '0' (zero consumption on each analog I / O pin is achieved) Nations Technologies Inc. 133 / 701 Tel:+86-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: Status After Reset

     PD0 and PD1 default to analog mode in 80 and above pin packages.  PD0 and PD1 are multiplexed to OSC_IN/OUT for pin packages with less than 80 pins. Nations Technologies Inc. 134 / 701 Tel:+86-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: Individual Bit Setting And Bit Clearing

    Output alternate function: The port must be configured to alternate output mode (push-pull or open-drain).  Bidirectional alternate function: The port bit must be configured with the alternate function output mode (push- Nations Technologies Inc. 135 / 701 Tel:+86-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 For the convenience of measurement, the RTC clock can be divided by 64 and output to the intrusion detection pin TAMPER. Turn on this function by setting the RTC_CTRL.COEN bit. Nations Technologies Inc. 136 / 701 Tel:+86-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 PD0/PD1 of GPIO, which is realized by setting the alternate remapping and debugging I/O configuration register (AFIO_RMP_CFG), as described below: Nations Technologies Inc. 137 / 701 Tel:+86-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: Table 7-3 Debug Port Image

    Turn off JTAG-DP and SW-DP. I/O available I/O available I/O available I/O available available other Forbidden Nations Technologies Inc. 138 / 701 Tel:+86-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: Table 7-4 Adc1 External Trigger Injection Conversion Alternate Function Remapping

    ADC2 external trigger regular conversion is connected ADC2 external trigger regular conversion is rule conversion to EXTI11. connected to TIM8_TRGO Nations Technologies Inc. 139 / 701 Tel:+86-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: Table 7-8 Adc3 External Trigger Injection Conversion Alternate Function Remapping

    TIM3_RMP[1:0] = 00 TIM3_RMP[1:0] = 10 TIM3_RMP[1:0] = 11 (No remapping) (partial remapping) (Full remapping) TIM3_ETR TIM3_CH1 TIM3_CH2 TIM3_CH3 TIM3_CH4 Nations Technologies Inc. 140 / 701 Tel:+86-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: Table 7-15 Tim2 Alternate Function Remapping

    Table 7-18 CAN1 alternate function remapping Alternate function CAN1_RMP[1:0] = 00 CAN1_RMP[1:0] = 01 CAN1_RMP[1:0] = 10 CAN1_RMP[1:0] = 11 CAN1_RX PA11 Nations Technologies Inc. 141 / 701 Tel:+86-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: Table 7-19 Can2 Alternate Function Remapping

    USART3_RTS PB14 PD12 UARTx alternate function remapping UART4/5/6/7 interfaces have remapping function. See the alternate remapping configuration register Nations Technologies Inc. 142 / 701 Tel:+86-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: Table 7-23 Uart4 Alternate Function Remapping

    See alternate remapping configuration register (AFIO_RMP_CFG3). Table 7-28 I2C2 pin remapping Alternate function I2C2_RMP[1:0] = 00 I2C2_RMP[1:0] = 11 I2C2_SCL PB10 Nations Technologies Inc. 143 / 701 Tel:+86-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: Table 7-29 I2C3 Pin Remapping

    PB13 PE11 SPI2_MISO PB14 PE12 SPI2_MOSI/I2S2_SD PB15 PE13 7.2.5.12.3 SPI3/I2S3 pin remapping See alternate remapping configuration register (AFIO_RMP_CFG3). Nations Technologies Inc. 144 / 701 Tel:+86-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: I/O Configuration Of Peripherals

    QSPI_ IO3 7.2.6 I/O configuration of peripherals Table 7-36 ADC/DAC ADC/DAC pin GPIO configuration Analog mode Analog mode Nations Technologies Inc. 145 / 701 Tel:+86-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: Table 7-37 Tim1/Tim8

    Push-pull alternate output USARTx_RTS Hardware flow Push-pull alternate output control USARTx_CTS Hardware flow Input floating or input pull- Nations Technologies Inc. 146 / 701 Tel:+86-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: Table 7-41 I2C

    Push-pull alternate output I2Sx_WS Slave mode Floating input Master mode Push-pull alternate output I2Sx_CK Slave mode Input floating Nations Technologies Inc. 147 / 701 Tel:+86-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: Gpio Locking Mechanism

    Refer to the port configuration Nations Technologies Inc. 148 / 701 Tel:+86-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: Gpio Registers

    GPIOA base address: 0x40010800 GPIOB base address: 0x40010C00 GPIOC base address: 0x40011000 GPIOD base address: 0x40011400 GPIOE base address: 0x40011800 Nations Technologies Inc. 149 / 701 Tel:+86-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: Gpio Port Low Configuration Register (Gpiox_Pl_Cfg)

    7.3.2 GPIO port low configuration register (GPIOx_PL_CFG) Address offset: 0x00 Reset value: 0x0000 0000 (x=A, C, D, E); 0x0008 0800 (x=B) Nations Technologies Inc. 150 / 701 Tel:+86-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: Gpio Port High Configuration Register (Gpiox_Ph_Cfg)

    Port x configuration bit (y = 8…15) 31:30 PCFGy[1:0] 27:26 PMODE[1:0]=00 In input mode: 23:22 00: analog function mode (state after reset) Nations Technologies Inc. 151 / 701 Tel:+86-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: Gpio Port Input Data Register (Gpiox_Pid)

    7.3.5 GPIO port output data register (GPIOx_POD) Address offset: 0x0C Reset value: 0x0000 A000(x=A); 0x0000 0010(x=B); 0x0000 0000(x=C,D,E) Nations Technologies Inc. 152 / 701 Tel:+86-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: Gpio Port Bit Setting/Clearing Register (Gpiox_Pbsc)

    1: Set the corresponding PODy bit to 1 7.3.7 GPIO port bit clear register (GPIOx_PBC) Address offset: 0x14 Reset value: 0x0000 0000 Nations Technologies Inc. 153 / 701 Tel:+86-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: Gpio Port Lock Configuration Register (Gpiox_Plock_Cfg )

    0. 0: Do not lock the configuration of the port 1: Lock the configuration of the port Nations Technologies Inc. 154 / 701 Tel:+86-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: Gpio Driver Capability Configuration Register (Gpiox_Ds_Cfg )

    These bits can only be read or written in the form of 16-bit words. 0: fast flip 1: Slow flip Nations Technologies Inc. 155 / 701 Tel:+86-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: Afio Registers

    Reset Value 01Ch Reserved AFIO_RMP_CFG3 020h Reset Value AFIO_RMP_CFG4 024h Reserved Reset Value AFIO_RMP_CFG5 028h Reserved Reset Value Nations Technologies Inc. 156 / 701 Tel:+86-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: Afio Event Control Register (Afio_Ectrl)

    1100: select Px12 1101: select Px13 1110: select Px14 1111: select Px15 7.4.3 AFIO alternate remap configuration register (AFIO_RMP_CFG ) Address offset: 0x04 Reset value: 0x0000 0000 Nations Technologies Inc. 157 / 701 Tel:+86-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 This bit can be set to '1' or set to '0' by software. It controls the internal image of Nations Technologies Inc. 158 / 701 Tel:+86-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 These bits can be set to '1' or set to '0' by software to control the image of Timer 2 channels 1 to 4 and external trigger (ETR) on the GPIO port. Nations Technologies Inc. 159 / 701 Tel:+86-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 SCL and SDA alternate functions on the GPIO port. 0: No remapping (SCL/PB6, SDA/PB7); 1: Remapping (SCL/PB8, SDA/PB9). Nations Technologies Inc. 160 / 701 Tel:+86-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: Afio External Interrupt Configuration Register 1(Afio_Exti_Cfg1)

    0011: PD3 pin 0100: PE3 pin 7.4.5 AFIO external interrupt configuration register 2(AFIO_EXTI_CFG2) Address offset: 0x0C Reset value: 0x0000 0000 Nations Technologies Inc. 161 / 701 Tel:+86-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: Afio External Interrupt Configuration Register 3(Afio_Exti_Cfg3)

    EXTIx external interrupt. EXTI8 configuration: 0000: PA8 pin 0001: PB8 pin 0010: PC8 pin 0011: PD8 pin 0100: PE8 pin Nations Technologies Inc. 162 / 701 Tel:+86-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: Afio External Interrupt Configuration Register 4(Afio_Exti_Cfg4)

    0011: PD14 pin 0100: PE14 pin EXTI15 configuration: 0000: PA15 pin 0001: PB15 pin 0011: PC15 pin 0011: PD15 pin 0100: PE15 pin Nations Technologies Inc. 163 / 701 Tel:+86-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: Afio Alternate Remapping Configuration Register 3(Afio_Rmp_Cfg3)

    RX alternate functions of UART5 on the GPIO port. 00: No remapping (TX/PC12, RX/PD2); 01: Remapping (TX/PB13, RX/PB14); 10: Remapping (TX/PE8, RX/PE9); 11: Remapping (TX/PB8, RX/PB9). Nations Technologies Inc. 164 / 701 Tel:+86-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 This bit can be set to '1' or set to '0' by software to control the image of I2C4's SDA and SCL alternate functions on the GPIO port. Nations Technologies Inc. 165 / 701 Tel:+86-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: Afio Alternate Remap Configuration Register 4 (Afio_ Rmp_Cfg4 )

    1: Remapping (DO/PE8, D1/PE9, D2/PE10, D3/PE11, CK/PE12, CMD/PE13); 7.4.9 AFIO alternate remap configuration register 4 (AFIO_ RMP_CFG4 ) Address offset: 0x24 Reset value: 0x0000 0000 Nations Technologies Inc. 166 / 701 Tel:+86-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 0: ADC3 regular conversion external trigger is connected to EXTI10 1: ADC3 regular conversion external trigger is connected to TIM5_CH3 ADC3_ETRI ADC3 injection conversion external trigger remapping Nations Technologies Inc. 167 / 701 Tel:+86-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 Remapping of COMP1_OUT This bit can be set to '1' or '0' by software. 00: No remapping (COMP1_OUT/PA0); Nations Technologies Inc. 168 / 701 Tel:+86-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: Afio Alternate Remapping Configuration Register 5(Afio_Rmp_Cfg5)

    EGBN1_DET_EN EMC GBN1 detection enable bit. 0: Disable 1: Enable ECLAMP4_DET_EN EMC CLAMP4 detection enable bit for VDD_4. Nations Technologies Inc. 169 / 701 Tel:+86-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 When EMC CLAMP3 detects, the system resets the enable bit. 0: Disable 1: Enable ECLAMP2_RST_EN When EMC CLAMP2 detects, the system resets the enable bit. Nations Technologies Inc. 170 / 701 Tel:+86-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 0: Disable 1: Enable ECLAMP1_RST_EN When EMC CLAMP1 detects, the system resets the enable bit. 0: Disable 1: Enable Nations Technologies Inc. 171 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 172: Dma Controller

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

    Nations Technologies Inc. 173 / 701 Tel:+86-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: Channel Priority And Arbitration

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

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

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

    DMA channel, and then write 0 to DMA_CHCFGx.CIRC (when DMA_CHCFGx.CHEN is 1, other bits in the DMA_CHCFGx register cannot be rewritten). Nations Technologies Inc. 177 / 701 Tel:+86-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: Error Management

    DMA requests of each peripheral can be turned on or off independently, and according to the channel priority, only one request is valid at the same time. Nations Technologies Inc. 178 / 701 Tel:+86-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: Table 8-4 Dma1 Request Mapping Table For Each Channel

    UART5_TX USART3_TX USART3_RX USART1_TX USART1_RX USART2_RX USART2_TX UART5_RX I2C3_TX I2C3_RX I2C2_TX I2C2_RX I2C1_TX I2C1_RX TIM1_CH4 TIM1 TIM1_CH1 TIM1_CH2 TIM1_TRIG TIM1_UP TIM1_CH3 TIM1_COM Nations Technologies Inc. 179 / 701 Tel:+86-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 DMA requests of each peripheral can be turned on or off independently, and according to the channel priority, only one request is valid at the same time. Nations Technologies Inc. 180 / 701 Tel:+86-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: Table 8-5 Dma2 Request Mapping Table For Each Channel

    QSPI_TX I2C4 I2C4_TX I2C4_RX UART UART6_RX UART6_TX UART4_RX UART4_TX UART7_RX UART7_TX SDIO SDIO TIM5 TIM5_CH4 TIM5_CH3 TIM5_CH2 TIM5_CH1 Nations Technologies Inc. 181 / 701 Tel:+86-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: Dma Registers

    02Ch Reserved Reset Value DMA_CHCFG3 030h Reserved Reset Value DMA_TXNUM3 NDTX[15:0] 034h Reserved Reset Value 038h DMA_PADDR3 ADDR[31:0] Nations Technologies Inc. 182 / 701 Tel:+86-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 ADDR[31:0] 09Ch Reset Value DMA_MADDR8 ADDR[31:0] 0A0h Reset Value DMA_CHSEL8 CH_SEL[5:0] 0A4h Reserved Reset Value 0A8h DMA_CHMAPEN Reserved Nations Technologies Inc. 183 / 701 Tel:+86-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: Dma Interrupt Status Register (Dma_Intsts)

    1: One of transfer error, half transfer or transfer done event happen on channel x. 8.5.3 DMA interrupt flag clear register (DMA_INTCLR) Address offset: 0x04 Reset value: 0x0000 0000 Nations Technologies Inc. 184 / 701 Tel:+86-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: Dma Channel X Configuration Register (Dma_Chcfgx)

    Software can configure this channel to memory to memory transfer when it is not yet enabled. 0: Channel transfer between memory and peripheral. Nations Technologies Inc. 185 / 701 Tel:+86-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 Half transfer interrupt enable. Software can enable/disable half transfer interrupt. 0: Disable half transfer interrupt of channel x. Nations Technologies Inc. 186 / 701 Tel:+86-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: 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). Nations Technologies Inc. 187 / 701 Tel:+86-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: Dma Channel X Memory Address Register (Dma_Maddrx)

    Note: After the channel MAP is enabled, DMA channel selection register will change to the default value. It is Nations Technologies Inc. 188 / 701 Tel:+86-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 27:TIM4_CH3 26:TIM2_CH1 25:SPI2/I2S2_TX 24:TIM1_UP 23:USART1_RX 22:I2C2_TX 21:SPI2/I2S2_RX 20:TIM4_CH2 19:TIM1_COM 18:TIM1_TRIG 17:TIM1_CH4 16:USART1_TX 15:SPI1_TX 14:TIM3_UP 13:TIM3_CH4 12:TIM1_CH2 11:USART3_RX 10:SPI1_RX Nations Technologies Inc. 189 / 701 Tel:+86-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: Dma2 Channel X Channel Request Select Register (Dma2_Chselx)

    Reserved, the reset value must be maintained. CH_SEL[5:0] DMA2 channel request selection 31:ADC4 30:UART7_TX 29:I2C4_RX 28:QSPI_TX 27:UART7_RX 26:I2C4_TX 25:QSPI_RX 24:UART4_TX 23:TIM5_CH1 22:TIM8_CH2 Nations Technologies Inc. 190 / 701 Tel:+86-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: Dma Channel Map Enable Register (Dma_Chmapen)

    Reserved, the reset value must be maintained. MAP_EN Channel MAP enable. 0: Disable channel MAP 1: Enable channel MAP Nations Technologies Inc. 191 / 701 Tel:+86-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 Nations Technologies Inc. 192 / 701 Tel:+86-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: Analog To Digital Conversion (Adc)

     Support 2 conversion modes.  Single conversion.  Continuous conversion.  Support discontinuous mode.  Support self-calibration. Nations Technologies Inc. 193 / 701 Tel:+86-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: Function Description

    ADCx_ETRI bit ADCx_ETRR bit ADCx_ETRR bit Trigger signal for ADC1 and ADC2 Trigger signal for ADC3 and ADC4 Nations Technologies Inc. 194 / 701 Tel:+86-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: Adc Clock

    1,2,4,6,8,10,12,16,32 When switching the ADC_1M clock source, you need to ensure that the HSI clock is turned on Nations Technologies Inc. 195 / 701 Tel:+86-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: Adc Switch Control

    Injection sequence consists of multiple conversions, up to a maximum of 4. The ADC_JSEQ register specifies the injection channel and the conversion order of the injection channel. The ADC_JSEQ.JLEN[1:0] bits specified injection sequence length. Nations Technologies Inc. 196 / 701 Tel:+86-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: Figure 9-3 Adc1 And Adc2 Channel Pin Connections

    Note: During conversion, changes to the ADC_RSEQx or ADC_JSEQ registers are prohibited; the ADC_RSEQx or ADC_JSEQ registers can only be changed when the ADC is idle. Figure 9-3 ADC1 and ADC2 channel pin connections Nations Technologies Inc. 197 / 701 Tel:+86-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 [16] Slow Channel VREF+ [16] VREF- [17] Slow Channel OPAMP2 [17] VREF- [18] Slow Channel REFINT [18] VREF- Nations Technologies Inc. 198 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 199: Figure 9-4 Adc3 And Adc4 Channel Pin Connections

    [16] Slow Channel VREF+ [16] VREF- [17] Slow Channel OPAMP4 [17] VREF- [18] Slow Channel REFINT [18] VREF- Nations Technologies Inc. 199 / 701 Tel:+86-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: 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. Nations Technologies Inc. 200 / 701 Tel:+86-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: Timing Diagram

    ADC_CTRL1.AWDGSGLEN and ADC_CTRL1.AWDGCH[4:0]. Table 9-2 Analog watchdog channel selection ADC_CTRL1 register control bit Channel AWDGSGLEN AWDGERCH AWDGEJCH Nations Technologies Inc. 201 / 701 Tel:+86-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: Scanning Mode

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

    When the trigger signal is generated, it will convert 1 channel of the injection sequence and then stop. Until the next Nations Technologies Inc. 203 / 701 Tel:+86-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: Calibration

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

    AFIO_RMP_CFG.ADC1_ETRR or AFIO_RMP_CFG.ADC2_ETRR bit to implement; If you select EXTI line 10 or TIM5_CC3 as the external trigger source, you can set the AFIO_RMP_CFG4.ADC3_ETRR or Nations Technologies Inc. 205 / 701 Tel:+86-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: Table 9-5 External Trigger For Regular Channels Of Adc1 And Adc2

    TIM2_CC1 event TIM3_CC4 event TIM4_TRGO event EXTI line15/TIM8_CC4 event External pin/internal signal from on-chip timer SWSTRJCH Software control bit Nations Technologies Inc. 206 / 701 Tel:+86-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: Dma Requests

    ADC software trigger, the master ADC and the slave ADC external trigger must be Nations Technologies Inc. 207 / 701 Tel:+86-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: Independent Mode

    1. Do not convert the same channel on 2 ADCs (the sampling times of two ADCs on the same channel cannot overlap). Nations Technologies Inc. 208 / 701 Tel:+86-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: Synchronous Injection Mode

    If the interval between the trigger signals is smaller than the conversion of the longer sequence, the shorter sequence may start to convert again when the longer sequence is not completed. Nations Technologies Inc. 209 / 701 Tel:+86-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: Fast Alternate Mode

    2. The sampling time must be less than 7 ADC clock cycles to avoid overlapping sampling cycles when ADC1 and ADC2 convert the same channel. Nations Technologies Inc. 210 / 701 Tel:+86-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: Slow Alternate Mode

    2. The sampling time must be less than 14 ADC clock cycles to avoid overlapping sampling cycles when ADC1 and ADC2 convert the same channel. Nations Technologies Inc. 211 / 701 Tel:+86-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: Rotation Trigger Mode

    Conversion Injection Injection Injection ADC1 sequence sequence sequence Injection Injection Injection ADC2 sequence sequence sequence Trigger JENDC(ADC1) JENDC(ADC2) Nations Technologies Inc. 212 / 701 Tel:+86-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: Mixed Synchronous Regular Mode + Synchronous Injection Mode

    If the interval Nations Technologies Inc. 213 / 701 Tel:+86-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: Mixed Synchronous Injection Mode + Alternate Mode

    Note: When the ADC clock prescale factor is set to 4, the sampling time will not be evenly distributed after the Nations Technologies Inc. 214 / 701 Tel:+86-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: Temperature Sensor

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

    There are 2 status flags in the ADC_STS register: injection sequence channel conversion started (JSTR) and regular Nations Technologies Inc. 216 / 701 Tel:+86-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: Adc Registers

    02Ch ADC_RSEQ1 LEN[3:0] SEQ16[4:0] SEQ15[4:0] SEQ14[4:0] SEQ13[4:0] Reserved Reset Value 030h ADC_RSEQ2 SEQ12[4:0] SEQ11[4:0] SEQ10[4:0] SEQ9[4:0] SEQ8[4:0] SEQ7[4:0] Nations Technologies Inc. 217 / 701 Tel:+86-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: Adc Status Register (Adc_Sts)

    This bit is set by hardware at the end of any channel (regular or injection) conversion and cleared by software. Nations Technologies Inc. 218 / 701 Tel:+86-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: Adc Control Register 1 (Adc_Ctrl1)

    Analog watchdog enable on regular channels This bit is set and cleared by the software. 0: Disables analog watchdog on regular channel. Nations Technologies Inc. 219 / 701 Tel:+86-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 This bit is set and cleared by the software to enable or disable automatic injection sequence channel conversion after regular sequence channel conversion is complete Nations Technologies Inc. 220 / 701 Tel:+86-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 10000: ADC analog input channel 16 10001: ADC analog input channel 17 10010: ADC analog input channel 18 Reserved all other values. Nations Technologies Inc. 221 / 701 Tel:+86-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: Adc Control Register 2 (Adc_Ctrl2)

    000: TIM1_CC1 event; 100: TIM3_TRGO event; 001: TIM1_CC2 event; 101: TIM4_CC4 event; 010: TIM1_CC3 event; 110: EXTI line 11/TIM8_TRGO event; Nations Technologies Inc. 222 / 701 Tel:+86-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 This bit is set and cleared by the software. If this bit is set, the conversion continues until the bit is cleared. 0: Single conversion mode. Nations Technologies Inc. 223 / 701 Tel:+86-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: Adc Sampling Time Register 1 (Adc_Sampt1)

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

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

    These bits are software-defined as the number of channels in the regular sequence channel conversion. 0000: 1 conversion 0001: 2 conversions Nations Technologies Inc. 226 / 701 Tel:+86-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: Adc Regular Sequence Register 2 (Adc_Rseq2)

    7th conversion in regular sequence 9.12.12 ADC regular sequence register 3 (ADC_RSEQ3) Address offset: 0x34 Reset value: 0x0000 0000 Nations Technologies Inc. 227 / 701 Tel:+86-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: Adc Injection Sequence Register (Adc_Jseq)

    JSEQ3[4:0] 3rd conversion in injected sequence JSEQ2[4:0] 2nd conversion in injected sequence JSEQ1[4:0] 1st conversion in injected sequence Nations Technologies Inc. 228 / 701 Tel:+86-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: Adc Injection Data Register X (Adc_Jdatx) (X= 1

    Table 9-3 and Table 9-4. 9.12.16 ADC differential mode selection register (ADC_DIFSEL) Address offset: 0x50 Reset value: 0x0000 0000 Nations Technologies Inc. 229 / 701 Tel:+86-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: Adc Calibration Factor (Adc_Calfact)

    ADC, the coefficient will be applied after a new single-ended calibration is initiated. Nations Technologies Inc. 230 / 701 Tel:+86-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: Adc Control Register 3 (Adc_Ctrl3)

    1: Get ready CKMOD Clock mode 0: Select AHB for synchronization clock 1: Select PLL for asynchronous clock Nations Technologies Inc. 231 / 701 Tel:+86-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: Adc Sampling Time Register 3 (Adc_Sampt3)

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

    External event triggers the conversion.  Two DAC channels are synchronized or converted independently. DAC block diagram and pins are shown below. Nations Technologies Inc. 233 / 701 Tel:+86-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: Table 10-1 Dac Pins

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

    [7:0], and the 8-bit data is right-aligned. (Actually stored in the register DACCHxD[11:4] bits, DACCHxD is the internal data storage register) Nations Technologies Inc. 235 / 701 Tel:+86-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: Figure 10-2 Data Format When Dac Independent Output

    DAC2 data is written to DAC_DR8DCH [15:8] (Actually stored in the register DACCH2D [11:4] bits, DACCH2D is the internal data storage register). Nations Technologies Inc. 236 / 701 Tel:+86-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: Dac Trigger

    DAC_DATOx register. This data transfer process takes 3 APB1 clock cycles. Nations Technologies Inc. 237 / 701 Tel:+86-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: Dac Conversion

    .The output voltage of DAC is calculated as follows: REF+ DAC output = V X (DATO / 4095). Nations Technologies Inc. 238 / 701 Tel:+86-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: Dma Requests

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

    Figure 10-7 Triangle wave generation of DAC ADC_CTRL.MAx SEL[3:0]+DAC aligned data holding register reference increase decrease DAC aligned data holding register reference Nations Technologies Inc. 240 / 701 Tel:+86-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: Dac Dual-Channel Conversion

    The configuration process is as follows:  Configure DAC_CTRL.T1EN and DAC_CTRL.T2EN to enable trigger enable of DAC1 and DAC2. Nations Technologies Inc. 241 / 701 Tel:+86-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: Independent Triggers That Generate Different Noises

    Configure DAC_CTRL.T1SEL[2:0] and DAC_CTRL.T2SEL[2:0] as different values to select different trigger sources.  Configure DAC_CTRL.W1EN[1:0] and DAC_CTRL.W2EN[1:0] as “1x” to select the triangle wave generation enable. Nations Technologies Inc. 242 / 701 Tel:+86-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: Independent Trigger To Generate Different Triangle Waves

    The value of the aligned data holding register of DAC2 will be transferred to register DAC_DATO2 after a delay of 1 APB1 clock cycle. Nations Technologies Inc. 243 / 701 Tel:+86-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: Synchronous Trigger Without Waveform Generator

    Configure DAC_CTRL.MA1SEL3:0] and DAC_CTRL.MA2SEL3:0] to the same value to get the same LFSR register mask bit.  Put the data to be converted into the corresponding alignment data holding register. Nations Technologies Inc. 244 / 701 Tel:+86-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: Synchronous Trigger To Generate The Same Triangle Wave

    The added value is transferred to the Nations Technologies Inc. 245 / 701 Tel:+86-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: Dac Register

    DAC_DATO2 DACCH2DO[11:0] 030h Reserved Reset Value 10.5.2 DAC control register (DAC_CTRL) Offset address: 0x00 Reset value: 0x0000 0000 Nations Technologies Inc. 246 / 701 Tel:+86-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 Enable the DAC2 output buffer. This bit is set to 1 and cleared by the software to enable/disable the DAC2's output buffer. Nations Technologies Inc. 247 / 701 Tel:+86-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 100: TIM2 TRGO event; 101: TIM4 TRGO event; 110: External interrupt line 9; 111: Software trigger. T1EN DAC1 trigger on Nations Technologies Inc. 248 / 701 Tel:+86-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: Dac Software Trigger Register (Dac_Sottr)

    APB1 clock. 10.5.4 12 bit right aligned data hold register for DAC1 (DAC_DR12CH1) Offset address: 0x08 Nations Technologies Inc. 249 / 701 Tel:+86-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: Bit Left Aligned Data Hold Register For Dac1 (Dac_Dl12Ch1)

    Offset address: 0x10 Reset value: 0x0000 0000 Bit field Name Description 31:8 Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 250 / 701 Tel:+86-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: Bit Right Aligned Data Hold Register For Dac2 (Dac_Dr12Ch2)

    Reserved, the reset value must be maintained. 10.5.9 8-bit right-aligned data hold register for DAC2 (DAC_DR8CH2) Offset address: 0x1C Reset value: 0x0000 0000 Nations Technologies Inc. 251 / 701 Tel:+86-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: Bit Right Aligned Data Hold Register For Dual Dac (Dac_Dr12Dch)

    Offset address: 0x24 Reset value: 0x0000 0000 Bit field Name Description 31:20 DACCH2D[11:0] 12-bit left- aligned data for DAC2 Nations Technologies Inc. 252 / 701 Tel:+86-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: Bit Right Aligned Data Hold Register For Dual Dac (Dac_Dr8Dch)

    Reserved, the reset value must be maintained. 11:0 DACCH1DO[11:0] DAC1 data output. These bits are read-only and represent the output data of the DAC1. Nations Technologies Inc. 253 / 701 Tel:+86-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: Dac2 Data Output Register (Dac_Dato2)

    Reserved, the reset value must be maintained. 11:0 DACCH2DO[11:0] DAC2 data output. These bits are read-only and represent the output data of the DAC2. Nations Technologies Inc. 254 / 701 Tel:+86-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: Advanced-Control Timers (Tim1 And Tim8)

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

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

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

    Internal clock CK_PSC divided by N Timer clock = CK_CNT Counter register Counter overflow Update interrupt flag(UDITF) Update event(UEV) Nations Technologies Inc. 258 / 701 Tel:+86-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 Counter overflow Update event(UEV) Update interrupt flag(UDITF) Auto-reload preload register Write a new value in TIMx_AR Auto-reload shadow register Nations Technologies Inc. 259 / 701 Tel:+86-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: Down-Counting Mode

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

    Update interrupt flag(UDITF) Figure 11-7 A center-aligned sequence diagram that includes counter overflows and underflows (ARPEN = 1) Nations Technologies Inc. 261 / 701 Tel:+86-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: Counter Underflow

    This means that data is transferred from the preload registers to the shadow registers every N+1 counter overflow or Nations Technologies Inc. 262 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 263: Figure 11-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 Nations Technologies Inc. 263 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 264: Figure 11-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 Nations Technologies Inc. 264 / 701 Tel:+86-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: Clock Selection

    Counter clock = CK_CNT=CK_PSC Counter register 63 64 65 66 00 01 02 03 04 05 06 07 Nations Technologies Inc. 265 / 701 Tel:+86-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 11-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. Nations Technologies Inc. 266 / 701 Tel:+86-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 11-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 Nations Technologies Inc. 267 / 701 Tel:+86-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: 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. Nations Technologies Inc. 268 / 701 Tel:+86-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 11-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. Nations Technologies Inc. 269 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 270: Figure 11-17 Capture/Compare Channel 1 Main Circuit

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

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

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

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

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

     If the value written into the counter is 0 or is the value of TIMx_AR, the direction will be updated but the update event will not be generated. Nations Technologies Inc. 276 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 277: Figure 11-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 Nations Technologies Inc. 277 / 701 Tel:+86-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: One-Pulse Mode

    TIMx_CCEN.CC2P= ‘0’; 3. TI2FP2 acts as the trigger (TRGI) of the slave mode controller and starts the counter, TIMx_SMCTRL.TSEL= Nations Technologies Inc. 278 / 701 Tel:+86-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: Clearing The Ocxref Signal On An External Event

    Here is an example for the case that when ETRF input becomes high, the behavior of OCxREF signal for different value of OCxCEN. Timer is set to be in PWM mode in this case. Nations Technologies Inc. 279 / 701 Tel:+86-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: Complementary Outputs With Dead-Time Insertion

    The relationships between the output signals of the dead-time generator and the reference signal OCxREF are as follow. Assume that TIMx_CCEN.CCxP=0, TIMx_CCEN.CCxNP=0, TIMx_BKDT.MOEN=1, TIMx_CCEN.CCxEN=1, Nations Technologies Inc. 280 / 701 Tel:+86-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: Figure 11-25 Complementary Output With Dead-Time Insertion

    TIMx_CCEN.CCxNEN=1, OCx will become active when OCxREF is high. On the contrary, OCxN will become active when OCxREF is low. Nations Technologies Inc. 281 / 701 Tel:+86-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: Break Function

    Note that the dead-time will be longer than usual because of the resynchronization on MOEN (almost 2 cycles of ck_tim). Nations Technologies Inc. 282 / 701 Tel:+86-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: Figure 11-26 Output Behavior In Response To A Break

    Break in OCxREF =OIx Delay Delay Delay =OIxN OCxN (CCxENN=1,CCxNEN=1,CCxP=0,CCxNP=0,OIx= ~OIxN) =OIx Delay =OIxN OCxN (CCxEN=1,CCxNEN=0,CCxP=0,CCxNP=0,OIx=~OIxN) OCxN (CCxEN=1,CCxNEN=0,CCxP=0,CCxNP=0,OIx=OIxN) Nations Technologies Inc. 283 / 701 Tel:+86-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: Debug Mode

    Counter register 60 61 62 63 64 65 66 00 01 02 03 01 02 03 UDGN TITF Nations Technologies Inc. 284 / 701 Tel:+86-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: Slave Mode: Trigger Mode

    The delay between the rising edge on TI1 and the actual stop of the counter is due to the resynchronization circuit on Nations Technologies Inc. 285 / 701 Tel:+86-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: Figure 11-29 Control Circuit In Gated Mode

    When TI1 detects a rising edge, the counter starts counting on the rising edge of ETR, and the trigger flag is set (TIMx_STS.TITF=1); Nations Technologies Inc. 286 / 701 Tel:+86-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: Timer Synchronization

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

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

    The following figure shows the example of counter behavior when IC1FP1 polarity is inverted (CC1P= '1', other configurations are the same as above) Nations Technologies Inc. 289 / 701 Tel:+86-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: Figure 11-33 Encoder Interface Mode Example With Ic1Fp1 Polarity Inverted

    Figure 11-33 Encoder interface mode example with IC1FP1 polarity inverted forward jitter backward jitter Counter down Nations Technologies Inc. 290 / 701 Tel:+86-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: Interfacing With Hall Sensor

    (TIMx_CTRL2.CCPCTL=1) and support the rising edge of TRGI Trigger an update (TIMx_CTRL2.CCUSEL=1). This example is shown in the following figure. Nations Technologies Inc. 291 / 701 Tel:+86-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: Advanced-Control

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

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

    TIMx_CCDAT6 CCDAT6[15:0] 058h Reserved Reset Value 11.4.2 Control register 1 (TIMx_CTRL1) Offset address: 0x00 Reset value: 0x0000 0000 Nations Technologies Inc. 294 / 701 Tel:+86-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 01: Center-aligned mode 1. The counter counts in center-aligned mode, and the output compare interrupt flag bit is set to 1 when down-counting. Nations Technologies Inc. 295 / 701 Tel:+86-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 Note: external clock, gating mode and encoder mode can only work after TIMx_CTRL1.CNTEN bit is set in the software. Trigger mode can automatically set TIMx_CTRL1.CNTEN bit by hardware. Nations Technologies Inc. 296 / 701 Tel:+86-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: Control Register 2 (Timx_Ctrl2)

    The counter enable signal is set when TIMx_CTRL1.CNTEN bit is set or the trigger input in gated mode is high. Nations Technologies Inc. 297 / 701 Tel:+86-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: Slave Mode Control Register (Timx_Smctrl)

    0: ETR active at high level or rising edge. 1: ETR active at low level or falling edge. EXCEN External clock enable Nations Technologies Inc. 298 / 701 Tel:+86-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 0: No action 1: Events on the trigger input (TRGI) are delayed to allow a perfect synchronization between the Nations Technologies Inc. 299 / 701 Tel:+86-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: Table 11-3 Timx Internal Trigger Connection

    ITR0 (TSEL = 000) ITR1 (TSEL = 001) ITR2 (TSEL = 010) ITR3 (TSEL = 011) TIM5 TIM2 TIM3 TIM4 TIM1 TIM8 TIM1 TIM2 TIM4 TIM5 Nations Technologies Inc. 300 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 301: Dma/Interrupt Enable Registers (Timx_Dinten)

    0: Disable COM interrupt 1: Enable COM interrupt CC4IEN Capture/Compare 4 interrupt enable 0: Disable capture/compare 4 interrupt Nations Technologies Inc. 301 / 701 Tel:+86-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: 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. Nations Technologies Inc. 302 / 701 Tel:+86-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 This bit is set by hardware when the capture event occurs. This bit is cleared by software or by reading TIMx_CCDAT1. Nations Technologies Inc. 303 / 701 Tel:+86-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: Event Generation Registers (Timx_Evtgen)

    OCxMD bits are allowed to be updated. This bit is automatically cleared by hardware. 0: No action 1: Generated a COM event Nations Technologies Inc. 304 / 701 Tel:+86-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: Capture/Compare Mode Register 1 (Timx_Ccmod1)

    Output compare mode: Nations Technologies Inc. 305 / 701 Tel:+86-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 Note 1: In PWM mode 1 or PWM mode 2, the OC1REF level changes only when the comparison result changes or when the output compare mode is switched from frozen mode to PWM mode. Nations Technologies Inc. 306 / 701 Tel:+86-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 11: CC2 channel is configured as input, IC2 is mapped on TRC. This mode is only active when the internal trigger input is selected by TIMx_SMCTRL.TSEL. Nations Technologies Inc. 307 / 701 Tel:+86-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 TIMx_SMCTRL.TSEL. Note: CC1SEL is writable only when the channel is off (TIMx_CCEN.CC1EN = 0). Nations Technologies Inc. 308 / 701 Tel:+86-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: 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: Nations Technologies Inc. 309 / 701 Tel:+86-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: Capture/Compare Enable Registers (Timx_Ccen)

    Capture/Compare 6 output enable See TIMx_CCEN.CC1EN description. 19:18 Reserved Reserved, the reset value must be maintained CC5P Capture/Compare 5 output polarity Nations Technologies Inc. 310 / 701 Tel:+86-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 At this time, this bit is used to select whether IC1 or the inverse signal of IC1 is used as the trigger or capture signal. Nations Technologies Inc. 311 / 701 Tel:+86-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: Table 11-4 Output Control Bits Of Complementary Ocx And Ocxn Channels With Break Function

    Asynchronously: OCx=CCxP, OCx_EN=0, OCxN=CCxNP,OCxN_EN=0; Then if the clock is present:OCx=OIx and OCxN=OIxN after a dead-time, when (CCxP ^ Nations Technologies Inc. 312 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 313: Counters (Timx_Cnt)

    Each time an update event occurs, the PSC value is loaded into the active prescaler register. 11.4.13 Auto-reload register (TIMx_AR) Offset address: 0x2C Reset values: 0xFFFF Nations Technologies Inc. 313 / 701 Tel:+86-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: Repeat Count Registers (Timx_Repcnt)

    CC1 channel is configured as output: CCDAT1 contains the value to be compared to the counter TIMx_CNT, signaling on the OC1 output. Nations Technologies Inc. 314 / 701 Tel:+86-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: Capture/Compare Register 2 (Timx_Ccdat2)

    When configured as output mode, register CCDAT2 and CCDDAT2 are readable and writable. 11.4.17 Capture/compare register 3 (TIMx_CCDAT3) Offset address: 0x3C Reset value: 0x0000 Nations Technologies Inc. 315 / 701 Tel:+86-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: Capture/Compare Register 4 (Timx_Ccdat4)

    AOEN, BKP, BKEN, OSSI, OSSR, and DTGN [7:0] bits can all be write protected depending on the LOCK Nations Technologies Inc. 316 / 701 Tel:+86-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 Lock Configuration These bits offer a write protection against software errors. – No write protected. – LOCK Level 1 Nations Technologies Inc. 317 / 701 Tel:+86-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: Dma Control Register (Timx_Dctrl)

    This bit field defines the number DMA will accesses (write/read) TIMx_DADDR register. 00000:1 time transfer 00001: 2 times transfers Nations Technologies Inc. 318 / 701 Tel:+86-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: Dma Transfer Buffer Register (Timx_Daddr)

    For the first time, DMA access to the TIMx_ DADDR register will be mapped to access TIMx_CCDAT1 register; Nations Technologies Inc. 319 / 701 Tel:+86-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: Capture/Compare Mode Registers 3(Timx_Ccmod3)

    Reserved, the reset value must be maintained 11.4.23 Capture/compare register 5 (TIMx_CCDAT5) Offset address: 0x58 Reset value: 0x0000 CCDAT5[15:0] Nations Technologies Inc. 320 / 701 Tel:+86-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: Capture/Compare Register 6 (Timx_Ccdat6)

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

     Hall sensor interface: used to do three-phase motor control;  Supports capture of internal comparator output signal. Nations Technologies Inc. 322 / 701 Tel:+86-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: 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. Nations Technologies Inc. 323 / 701 Tel:+86-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: 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). Nations Technologies Inc. 324 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 325: Figure 12-3 Timing Diagram Of Up-Counting. The Internal Clock Divider Factor = 2/N

    Internal clock CK_PSC divided by N Timer clock = CK_CNT Counter register Counter overflow Update interrupt flag(UDITF) Update event(UEV) Nations Technologies Inc. 325 / 701 Tel:+86-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: Figure 11-4 Timing Diagram Of The Up-Counting, Update Event When Arpen=0/1

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

    Center-aligned mode is valid when the TIMx_CTRL1. CAMSEL bit is not equal to "00". The update events can be generated each time the counter overflows and each time the counter underflows. Nations Technologies Inc. 327 / 701 Tel:+86-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: Figure 12-6 Timing Diagram Of The Center-Aligned, Internal Clock Divided Factor =2/N

    Internal clock divided by N CK_PSC Timer clock = CK_CNT Counter register Counter underflow Update event(UEV) Update interrupt flag(UDITF) Nations Technologies Inc. 328 / 701 Tel:+86-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: Clock Selection

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

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

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

    Select the polarity on ETR pin by setting TIMx_SMCTRL.EXTP equal to ‘0’, The rising edge of ETR is valid  External clock mode 2 is selected by setting TIMx_SMCTRL .EXCEN equal to ‘1’ Nations Technologies Inc. 332 / 701 Tel:+86-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: 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. Nations Technologies Inc. 333 / 701 Tel:+86-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: Figure 12-13 Capture/Compare Channel (Example: Channel 1 Input Stage)

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

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

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

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

    User should not modified TIMx_CTRL1.DIR by software, it is updated by hardware. Examples of center-aligned PWM waveforms is as follow, and the setting of the waveform are: TIMx_AR=8, PWM Nations Technologies Inc. 340 / 701 Tel:+86-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: Figure 12-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. Nations Technologies Inc. 341 / 701 Tel:+86-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: Figure 12-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. Nations Technologies Inc. 342 / 701 Tel:+86-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: One-Pulse Mode

    4. TIMx_CCDAT1 writes the count value to be delayed (t ), TIMx_AR - TIMx_CCDAT1 is the count value of DELAY the pulse width t PULSE Nations Technologies Inc. 343 / 701 Tel:+86-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: Clearing The Ocxref Signal On An External Event

    Here is an example for the case that when ETRF input becomes high, the behavior of OCxREF signal for different value of OCxCEN. Timer is set to be in PWM mode in this case. Nations Technologies Inc. 344 / 701 Tel:+86-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: 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. Nations Technologies Inc. 345 / 701 Tel:+86-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: Figure 12-22 Block Diagram Of Timer Interconnection

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

    Setting TIM2_CTRL1.CNTEN= ‘1’ to start TIM2.  Setting TIM1_CTRL1.CNTEN= ‘1’ to start TIM1.  Setting TIM1_CTRL1.CNTEN= ‘0’ to stop TIM1. Nations Technologies Inc. 347 / 701 Tel:+86-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: Figure 12-24 Tim2 Gated By Enable Signal Of Tim1

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

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

    The relationship between the counting direction and the encoder signal is shown in Table 12-1 Table 12-1 Counting direction versus encoder signals Level on opposite signals TI1FP1 signal TI2FP2 signal Nations Technologies Inc. 350 / 701 Tel:+86-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: Figure 12-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) Nations Technologies Inc. 351 / 701 Tel:+86-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: Interfacing With Hall Sensor

    Table 12-2 Register map and reset value Offset Register TIMx_CTRL1 000h Reset Value TIMx_CTRL2 004h Reset Value TIMx_SMCTRL 008h Reset Value Nations Technologies Inc. 352 / 701 Tel:+86-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 040h Reserved Reset Value 044h Reserved TIMx_DCTRL DBLEN[4:0] DBADDR[4:0] 048h Reset Value TIMx_DADDR BURST[15:0] 04Ch Reserved Reset Value Nations Technologies Inc. 353 / 701 Tel:+86-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: Control Register 1 (Timx_Ctrl1)

    Note:Before operating this bit, the extended mode of the chip must be turned on (set PWR_CTRL3.EXMODE) Reserved Reserved, the reset value must be maintained Nations Technologies Inc. 354 / 701 Tel:+86-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 1: If update interrupt or DMA request is enabled, only counter overflow/underflow will generate update interrupt or DMA request Nations Technologies Inc. 355 / 701 Tel:+86-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: Control Register 2 (Timx_Ctrl2)

    0: TIMx_CH1 pin connected to TI1 input. 1: TIMx_CH1, TIMx_CH2, and TIMx_CH3 pins are XOR connected to the TI1 input. Nations Technologies Inc. 356 / 701 Tel:+86-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: 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. Nations Technologies Inc. 357 / 701 Tel:+86-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 (via TRGO) and its slaves. This is useful when several timers are required to be synchronized to a single external event. Nations Technologies Inc. 358 / 701 Tel:+86-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: Table 12-3 Timx Internal Trigger Connection

    TIM8 TIM3 TIM4 TIM1 TIM2 TIM5 TIM4 TIM3 TIM1 TIM2 TIM3 TIM8 TIM4 TIM5 TIM2 TIM3 TIM4 TIM8 Nations Technologies Inc. 359 / 701 Tel:+86-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: Dma/Interrupt Enable Registers (Timx_Dinten)

    1: Enable capture/compare 4 interrupt CC3IEN Capture/Compare 3 interrupt enable 0: Disable capture/compare 3 interrupt 1: Enable capture/compare 3 interrupts Nations Technologies Inc. 360 / 701 Tel:+86-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: Status Registers (Timx_Sts)

    This bit is cleared by software. 0: No trigger event occurred 1: Trigger interrupt occurred Reserved Reserved, the reset value must be maintained Nations Technologies Inc. 361 / 701 Tel:+86-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: Event Generation Registers (Timx_Evtgen)

    Offset address: 0x14 Reset values: 0 x0000 Bit field Name Description 15:7 Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 362 / 701 Tel:+86-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: Capture/Compare Mode Register 1 (Timx_Ccmod1)

    ICx describes the function of a channel in input mode. Hence, Nations Technologies Inc. 363 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 364 Note 1: In PWM mode 1 or PWM mode 2, the OC1REF level changes only when the comparison result changes or when the output compare mode is switched from frozen mode to PWM mode. Nations Technologies Inc. 364 / 701 Tel:+86-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 11: CC2 channel is configured as input, IC2 is mapped on TRC. This mode is only active when the internal trigger input is selected by TIMx_SMCTRL.TSEL. Nations Technologies Inc. 365 / 701 Tel:+86-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: Capture/Compare Mode Register 2 (Timx_Ccmod2)

    12.4.9 Capture/compare mode register 2 (TIMx_CCMOD2) Offset address: 0x1C Reset value: 0x0000 See the description of the CCMOD1 register above Nations Technologies Inc. 366 / 701 Tel:+86-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 Input capture mode: Bit field Name Description 15:12 IC4F[3:0] Input Capture 4 filter 11:10 IC4PSC[1:0] Input Capture 4 Prescaler Nations Technologies Inc. 367 / 701 Tel:+86-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: Capture/Compare Enable Registers (Timx_Ccen)

    See TIMx_CCEN.CC1P description. CC3EN Capture/Compare 3 output enable See TIMx_CCEN.CC1EN description. Reserved Reserved, the reset value must be maintained Nations Technologies Inc. 368 / 701 Tel:+86-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: Counters (Timx_Cnt)

    Note: The state of external I/O pins connected to standard OCx channels depends on the OCx channel state and GPIO and AFIO registers. 12.4.11 Counters (TIMx_CNT) Offset address: 0x24 Reset value: 0x0000 Nations Technologies Inc. 369 / 701 Tel:+86-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: Prescaler (Timx_Psc)

    When the TIMx_AR.AR [15:0] value is null, the counter does not work. 12.4.14 Capture/compare register 1 (TIMx_CCDAT1) Offset address: 0x34 Reset value: 0x0000 Nations Technologies Inc. 370 / 701 Tel:+86-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: Capture/Compare Register 2 (Timx_Ccdat2)

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

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

    When a read or write operation is assigned to this register, the register located at the address range (DMA base address + DMA burst length × 4) will be accessed. Nations Technologies Inc. 373 / 701 Tel:+86-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 For the fourth time, DMA access to the TIMx_ DADDR register will be mapped to access TIMx_CCDAT4 register; Nations Technologies Inc. 374 / 701 Tel:+86-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: Basic Timers (Tim6 And Tim7)

    13.3.1 Time-base unit The time-base unit mainly includes: prescaler, counter and auto-reload. When the time base unit is working, the Nations Technologies Inc. 375 / 701 Tel:+86-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: Counter Mode

    DMA requests are generated. This setting is used in scenarios where you want to clear the counter but do not want to Nations Technologies Inc. 376 / 701 Tel:+86-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 The figure below shows some examples of the counter behavior and the update flags for different division factors in the up-counting mode. Nations Technologies Inc. 377 / 701 Tel:+86-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: Figure 13-3 Timing Diagram Of Up-Counting. The Internal Clock Divider Factor = 2/N

    Internal clock CK_PSC divided by N Timer clock = CK_CNT Counter register Counter overflow Update interrupt flag(UDITF) Update event(UEV) Nations Technologies Inc. 378 / 701 Tel:+86-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 13-4 Timing Diagram Of The Up-Counting, Update Event When Arpen=0/1

    Counter overflow Update event(UEV) Update interrupt flag(UDITF) Auto-reload preload register Write a new value in TIMx_AR Auto-reload shadow register Nations Technologies Inc. 379 / 701 Tel:+86-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: 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). Nations Technologies Inc. 380 / 701 Tel:+86-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: Register Overview

    Offset address: 0x00 Reset value: 0x0000 Bit field Name Description 15:8 Reserved Reserved, the reset value must be maintained Nations Technologies Inc. 381 / 701 Tel:+86-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: Control Register 2 (Timx_Ctrl2)

    If the TIMx_EVTGEN.UDGN bit is set, the counter and prescaler are reinitialized. CNTEN Counter Enable 0: Disable counter 1: Enable counter 13.4.3 Control Register 2 (TIMx_CTRL2) Offset address:0x04 Nations Technologies Inc. 382 / 701 Tel:+86-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: Dma/Interrupt Enable Registers (Timx_Dinten)

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

    Offset address: 0x14 Reset values: 0 x0000 Bit field Name Description 15:1 Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 384 / 701 Tel:+86-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: Counter (Timx_Cnt)

    PSC + 1. 13.4.9 Automatic reload register (TIMx_AR) Offset address: 0x2C Reset values: 0xFFFF Nations Technologies Inc. 385 / 701 Tel:+86-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 These bits define the value that will be loaded into the actual auto-reload register. See 13.3.1 for more details. When the TIMx_AR.AR [15:0] value is null, the counter does not work. Nations Technologies Inc. 386 / 701 Tel:+86-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: Real-Time Clock (Rtc)

    Wakeup Timer can be configured as an interrupt/event to wake up the system from SLEEP, STOP0 ,STOP2 modes. Nations Technologies Inc. 387 / 701 Tel:+86-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: Rtc Function Description

     Timestamp event/interrupt  RTC output functions  256 Hz or 1Hz clock output (LSE frequency is 32.768 kHz). Nations Technologies Inc. 388 / 701 Tel:+86-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: 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 �� ������������ ck_apre ������_������.��������[6:0]+1 Nations Technologies Inc. 389 / 701 Tel:+86-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: Rtc Calendar

    1. Reading calendar value when RTC_CTRL.BYPS=0 Calendar value is read from shadow registers if RTC_CTRL.BYPS=0. In order to read RTC calendar registers Nations Technologies Inc. 390 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 391: Calibration Clock Output

    Note: When the RTC_CALIB or RTC_ALARM output is selected, the RTC_OUT pin (PC13) is automatically configured as output. Nations Technologies Inc. 391 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 392: Programmable Alarms

    Assume RTCCLK comes from LSE (32.768KHz), wake-up interrupt period can be configured range from 122us to 32s under the resolution down to 61us.  Internal clock ck_spre. Nations Technologies Inc. 392 / 701 Tel:+86-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: Wakeup Timer Configuration

    Calendar will subtract one hour when set RTC_CTRL.SU1H bit to 1, and add one hour when set RTC_CTRL.AD1H to 1. RTC_CTRL.BAKP can be used to remember this adjustment or not. Nations Technologies Inc. 393 / 701 Tel:+86-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: Rtc Sub-Second Register Shift

    When RTC_PRE .DIVA[6:0] =0, RTC_PRE.DIVS[14:0]=32759. The effective calibrated frequency (f ) can be calculated by using the formula given below: Nations Technologies Inc. 394 / 701 Tel:+86-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: Rtc Low Power Mode

    Normal work when the clock source of RTC is LSE STANDBY Alarm A, Alarm B and Timestamp event or LSI Nations Technologies Inc. 395 / 701 Tel:+86-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: Rtc Registers

    DAU[3:0] 034h Reserved Reset Value RTC_TSSS SSE[15:0] 038h Reserved Reset Value RTC_CALIB CM[8:0] 03Ch Reserved Reserved Reset Value Nations Technologies Inc. 396 / 701 Tel:+86-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: Rtc Calendar Time Register (Rtc_Tsh)

    Describes the second units value in BCD format 14.3.3 RTC Calendar Date Register (RTC_DATE) Address offset: 0x04 Reset value: 0x0000 2101 Nations Technologies Inc. 397 / 701 Tel:+86-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: Rtc Control Register (Rtc_Ctrl)

    0: Outputs high level when the selected output triggers(see OUTSEL[1:0]) 1: Outputs low level when the selected output triggers(see OUTSEL[1:0]) CALOSEL Calibration output selection Nations Technologies Inc. 398 / 701 Tel:+86-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 1: Enable Alarm A Reserved Reserved, the reset value must be maintained HFMT Hour format bit 0: 24 hour format Nations Technologies Inc. 399 / 701 Tel:+86-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: Rtc Initial Status Register (Rtc_Initsts)

    This flag is set to ‘1’by hardware when a time-stamp event happens when TISF bit is set. This flag can be cleared by software writing 0. It is advised to check and clear Nations Technologies Inc. 400 / 701 Tel:+86-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 This flag is set to ‘1’ by hardware as soon as a shift operation is initiated by a write to Nations Technologies Inc. 401 / 701 Tel:+86-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: Rtc Prescaler Register (Rtc_Pre)

    Synchronous prescaler factor /(DIVS[14:0]+1) ck_spre ck_apre 14.3.7 RTC Wakeup Timer Register (RTC_WKUPT) Address offset: 0x14 Reset value: 0x0000 FFFF Nations Technologies Inc. 402 / 701 Tel:+86-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: Rtc Alarm A Register (Rtc_Alarma)

    Describes the date units value in BCD format MASK3 Alarm hours mask 0: Hours match 1: Hours not match AM/PM notation Nations Technologies Inc. 403 / 701 Tel:+86-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: Rtc Alarm B Register (Rtc_ Alarmb)

    0: AM or 24 hours format 1: PM format 21:20 HOT[1:0] Describes the hour tens value in BCD format Nations Technologies Inc. 404 / 701 Tel:+86-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: Rtc Write Protection Register (Rtc_Wrp)

    For detail on how to unlock RTC register write protection, see chapter RTC write protection register. 14.3.11 RTC Sub-second Register (RTC_SUBS) Address offset: 0x28 Reset value: 0x0000 0000 Nations Technologies Inc. 405 / 701 Tel:+86-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: Rtc Shift Control Register (Rtc_ Sctrl)

    Note: Before writing ADFS[14:0], need to read the RTC_SUBS register to ensure that ADFS[14:0] < RTC_SUBS.SS[15:0]; 14.3.13 RTC Timestamp Time Register (RTC_TST) Address offset: 0x30 Reset value: 0x0000 0000 Nations Technologies Inc. 406 / 701 Tel:+86-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: Rtc Timestamp Date Register (Rtc_Tsd)

    Describes the month tens value in BCD format 11:8 MOU[3:0] Describes the month units value in BCD format Nations Technologies Inc. 407 / 701 Tel:+86-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: 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 Nations Technologies Inc. 408 / 701 Tel:+86-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: Rtc Alarm A Sub-Second Register (Rtc_ Alrmass)

    0xE: Only SSV[13:0] are compared and other bits are not compared. 0xF: SSV[14:0] are compared Synchronization counter RTC_SUBS.SS[15] bit is never compared. Nations Technologies Inc. 409 / 701 Tel:+86-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: Rtc Alarm B Sub-Second Register (Rtc_ Alrmbss)

    MASKSSB[3:0]. 14.3.19 RTC Option Register (RTC_ OPT) Address offset: 0x4C Reset value: 0x0000 0000 Nations Technologies Inc. 410 / 701 Tel:+86-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 Reserved, the reset value must be maintained TYPE RTC_ALARM output type on PC13 0: Open-drain output 1: Push-pull output Nations Technologies Inc. 411 / 701 Tel:+86-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: Crc Calculation Unit

    The verification initial value can be configured, and the size end of the data to be verified can be configured.  Support 8bit LRC check value generation The following figure is the block diagram of CRC unit. Nations Technologies Inc. 412 / 701 Tel:+86-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: Function Description

    If the initial value needs to be set, the LRC register should be configured first. Nations Technologies Inc. 413 / 701 Tel:+86-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: Crc Registers

    Only 32-bit operations are supported. 15.4.3 CRC32 independent data register (CRC_CRC32IDAT) Address offset: 0x04 Reset value: 0x0000 0000 Nations Technologies Inc. 414 / 701 Tel:+86-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: Crc32 Control Register (Crc_Crc32Ctrl)

    1, and hardware will clear to 0 automatically. 15.4.5 CRC16 control register (CRC_CRC16CTRL) Address offset: 0x0C Reset value: 0x0000 0000 Nations Technologies Inc. 415 / 701 Tel:+86-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: Crc16 Input Data Register (Crc_Crc16Dat)

    Address offset: 0x14 Reset value: 0x0000 0000 Bit field Name Description 31:16 Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 416 / 701 Tel:+86-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: Lrc Result Register (Crc_Lrc)

    CRC_CRC16DAT will be XOR with CRC_LCR register value. The result will be stored in CRC_LRC. Software read the result. It should be cleared before next use. Nations Technologies Inc. 417 / 701 Tel:+86-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: Independent Watchdog (Iwdg)

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

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

    Pre-scale register and reload register controls the time that generates reset, as shown in Table 16-1. Nations Technologies Inc. 420 / 701 Tel:+86-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: Iwdg Configuration Flow

    If user wants change pre-scale and reload value, repeat step 1~5. If not, just feed the dog with step 5. Nations Technologies Inc. 421 / 701 Tel:+86-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: Iwdg Registers

    0xAAAA: Reload counter with REL value in IWDG_RELV register to prevent reset. 0x5555: Disable write protection of IWDG_PREDIV and IWDG_RELV register 16.5.3 IWDG pre-scaler register (IWDG_PREDIV) Address offset: 0x04 Nations Technologies Inc. 422 / 701 Tel:+86-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: Iwdg Reload Register (Iwdg_Relv)

    Address offset: 0x08 Reset value: 0x00000FFF Bit field Name Description 31:12 Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 423 / 701 Tel:+86-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: 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. Nations Technologies Inc. 424 / 701 Tel:+86-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: Window Watchdog (Wwdg)

    Therefore, before enabling the watchdog, you need to set WWDG_CTRL.T [6] bit to 1, preventing reset right after enable. The pre-scaler value set by the clock APB1 and WWDG_CFG.TIMERB[1:0] bits determine the Nations Technologies Inc. 425 / 701 Tel:+86-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: Timing For Refresh Watchdog And Interrupt Generation

    Table 17-1 (assuming APB1 clock 36 MHz) with calculate equation: Nations Technologies Inc. 426 / 701 Tel:+86-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: 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. Nations Technologies Inc. 427 / 701 Tel:+86-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: Wwdg Registers

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

    ‘0’. A write of ‘1’ has no effect. This bit is also set if the interrupt is not enabled. Nations Technologies Inc. 429 / 701 Tel:+86-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: Sdio Interface(Sdio

    SDIO supports only one SD/SDIO/MMC 4.2 card or CE-ATA device at a time, but can support multiple MMC version 4.1 or earlier cards. Nations Technologies Inc. 430 / 701 Tel:+86-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: Sdio Bus Topology

    Each transmission type is shown in the following figure: Nations Technologies Inc. 431 / 701 Tel:+86-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: Figure 18-1 Sdio "No Response" And "No Data" Operations

    SDIO_DATA The data flow Data read operation 数据停止操作 Data stop operation Nations Technologies Inc. 432 / 701 Tel:+86-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: Sdio Function Description

    FIFO HCLK/2 SDIOCLK 18.3.1 SDIO adapter The following figure is a simplified block diagram of the SDIO adapter: Nations Technologies Inc. 433 / 701 Tel:+86-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-7 Sdio Adapter

     SD or SD I/O card, optional clock frequency between 0MHz and 25MHz. The following table is the MMC/SD/SD I/O card bus pin definition: Nations Technologies Inc. 434 / 701 Tel:+86-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: Adapter Register Block

    (8 clock cycles after the command channel and data channel subunits enter the idle phase). Nations Technologies Inc. 435 / 701 Tel:+86-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: Command Unit

    SDIO_RESPONSE0~SDIO_RESPONSE 3 registers. The command unit can also generate command status flags, which are defined in the SDIO_STS register. Nations Technologies Inc. 436 / 701 Tel:+86-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: Figure 18-9 Sdio Adapter Command Unit

    Response received in CE-ATA mode without interruption Wait for the CE-ATA command completion signal to be turned off Nations Technologies Inc. 437 / 701 Tel:+86-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 (Send) state, which will trigger the data counter to stop sending function of the command. Nations Technologies Inc. 438 / 701 Tel:+86-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: Data Channel

    M(x) = (start bit) * x119 + ... + (last bit before CRC) * x0. Data channel The data between the host and the card is transmitted through the data channel. Nations Technologies Inc. 439 / 701 Tel:+86-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: Data Path State Machine (Dpsm)

    The data channel state machine (DPSM) operates at the SDIO_CLK frequency, and the card bus signal is synchronized with the rising edge of SDIO_CLK. DPSM has 6 states, as shown in the following figure: Nations Technologies Inc. 440 / 701 Tel:+86-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: Figure 18-13 Data Path State Machine (Dpsm)

    FIFO, and the DPSM enters the Wait_R state. If a FIFO overflow error occurs, the DPSM sets the FIFO error flag and enters the idle state. Nations Technologies Inc. 441 / 701 Tel:+86-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: Table 18-3 Data Token Format

    Data is transmitted over the data line. Data is stored in a 32-word depth FIFO, each word is 32 bits wide. Table 18-3 Data Token Format Description Start bit Data CRC16 End bit Block Data Stream Data Nations Technologies Inc. 442 / 701 Tel:+86-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: Table 18-4 Transmit Fifo Status Flags

    This flag is set high when the transmit FIFO contains valid data. The meaning of this flag is just the opposite of TFIFOE. Nations Technologies Inc. 443 / 701 Tel:+86-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: Sdio Ahb Interface

    SDIO_CMDCTRL.CMDRESP is set to 1 (SDIO card host waits for a short response); SDIO_CMDCTRL.CPSMEN is set to 1 (enable SDIO card host sends commands), other fields are their reset values. Nations Technologies Inc. 444 / 701 Tel:+86-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: Card Function Description

    The CMD lines of all cards are in input mode, waiting for the start bit of the next command, while Nations Technologies Inc. 445 / 701 Tel:+86-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: Card Identification Mode

    (CID) and enter the identification state. The SDIO card host sends a CMD3 (SET_RELATIVE_ADDR) command and an address to an activated card, Nations Technologies Inc. 446 / 701 Tel:+86-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: Write Data Block

    SDIO_DAT signal line low. Nations Technologies Inc. 447 / 701 Tel:+86-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: Read Data Block

    ADDRESS_OUT_OF_RANGE; it should be noted that the data stream write command is only applicable to 1-bit bus configuration (SDIO_DAT0 signal on-line). It is considered an illegal command if CMD20 is Nations Technologies Inc. 448 / 701 Tel:+86-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 If the host tries to use a higher frequency, the card will not be able to process the data transfer, at this time the card Nations Technologies Inc. 449 / 701 Tel:+86-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: Erase

    The host supports three card protection methods to protect data from being erased or rewritten: Internal write protection of the card Physical write protection switch Card lock operation for password management Nations Technologies Inc. 450 / 701 Tel:+86-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: Password Protection

    Bit4 Bit3 Bit2 Bit1 Bit0 Reserved (Remains at 0) ERASE LOCK_UNLOCK CLR_PWD SET_PWD PWDS_LEN Password Data (PWD) …… Nations Technologies Inc. 451 / 701 Tel:+86-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: Set Password

    PWDS_LEN (in bytes), and the number of bytes of the currently used password. On the data line, send the CMD42 (LOCK/UNLOCK) command with a suitable data block length and include Nations Technologies Inc. 452 / 701 Tel:+86-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 Attempting to unlock an already unlocked card will cause the operation to fail and set the LOCK_UNLOCK_FAILED error bit in the status register. Nations Technologies Inc. 453 / 701 Tel:+86-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: Card Status Register

    Nations Technologies Inc. 454 / 701 Tel:+86-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 An attempt was made to reverse the copy or permanent write protection, i.e. restore or release write protection. Nations Technologies Inc. 455 / 701 Tel:+86-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 S: Status bit. These bits serve only as information fields and do not change in response to commands. These bits are persistent, they are set or cleared depending on the card state. Nations Technologies Inc. 456 / 701 Tel:+86-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: Sd Status Register

    (each Card bit can be used to '0001'= SD ROM Card define a different SD type). The Nations Technologies Inc. 457 / 701 Tel:+86-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 B: Always relative to the previous command. Cleared when the correct command is received, this method has a delay of one command.  C: Read clear Nations Technologies Inc. 458 / 701 Tel:+86-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: Table 18-9 Speed Type Codes

    These 4 bits indicate the length of the AU, value is (16K bytes) × 2 Table 18-11 AU_SIZE Codes AU_SIZE Value definition Undefined 16KB Nations Technologies Inc. 459 / 701 Tel:+86-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: Table 18-12 Maximum Au Size

    ERASE_SIZE field is set to 0, then ERASE_TIMEOUT should also be set is 0. Table 18-14 Erase Timeout Code ERASE_TIMEOUT Value definition Erase timeout calculation is not supported. 1 sec Nations Technologies Inc. 460 / 701 Tel:+86-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: Sd I/O Mode

    Nations Technologies Inc. 461 / 701 Tel:+86-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: Commands And Responses

    The card returns a response to the multimedia/SD card module, the response indicates that the APP_CMD bit is set, and the received command has been correctly parsed according to the ACMD command; if the received Nations Technologies Inc. 462 / 701 Tel:+86-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: Commands Of Multimedia Card/Sd Card Module

    If the card is write-protected, this CMD29 [31:0]= Data Address CLR_WRITE_PROT command clears the write-protect bit of the specified group. Nations Technologies Inc. 463 / 701 Tel:+86-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: Table 18-17 Block-Based Write-Protect Commands

    Type Parameter Abbreviation Description Index Format CMD39 [31:16] =RCA FAST_IO Used to write and read 8-bit (register) data Nations Technologies Inc. 464 / 701 Tel:+86-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: Command Type

    18.5.3 Command type ACMD and GEN_CMD contain four different types: Broadcast Command (BC): Sent to all cards, no response. Nations Technologies Inc. 465 / 701 Tel:+86-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: Command Format

    CRC failure status. Table 18-23 Short response format Width Value Description Start bit Transmission bit [45:40] Command index Nations Technologies Inc. 466 / 701 Tel:+86-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: Response Format

    CMD9 is saved in the CSD register and sent. The card only responds and transmits bits [127...1] of CID Nations Technologies Inc. 467 / 701 Tel:+86-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: Table 18-26 R2 Response

    R4b is only available for SD I/O cards, and the code length is 48 bits. The SDIO card will return a unique SDIO response R4 after receiving the CMD5 command. Nations Technologies Inc. 468 / 701 Tel:+86-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: Table 18-29 R4B Response

    CMD3 command. Table 18-31 R6 response Width Value Description Start bit Transmission bit Nations Technologies Inc. 469 / 701 Tel:+86-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: Hardware Flow Control

    AHB bus. Note that these peripheral registers must be manipulated in word (32 bits). Nations Technologies Inc. 470 / 701 Tel:+86-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: Sdio Register Overview

    Reset Value SDIO_INTEN 03Ch Reserved Reset Value SDIO_FIFOCOUNT FIFOCOUNT[23:0] 048h Reserved Reset Value SDIO_DATFIFO FIFIDAT[31:0] 080h Reset Value Nations Technologies Inc. 471 / 701 Tel:+86-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: Sdio Power Control Register (Sdio_Pwrctrl)

    After hardware flow control is enabled, please refer to the definition of SDIO status register in Section 0 for the meaning of SDIO_STS.TFIFOE and SDIO_STS.RFIFOF interrupt signals. CLKEDGE SDIO_CLK dephasing selection bit. Nations Technologies Inc. 472 / 701 Tel:+86-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: Sdio Command Argument Register (Sdio_Cmdarg)

    SDIO_CMDARG register contains the 32-bit command parameter, which will be sent to the card as part of the command. Nations Technologies Inc. 473 / 701 Tel:+86-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: Sdio Command Register (Sdio_Cmdctrl)

    If this bit is set, the CPSM turns off the command timeout control and waits for an interrupt request. CMDRESP Wait for response bits. Nations Technologies Inc. 474 / 701 Tel:+86-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: Sdio Command Response Register(Sdio_Cmdresp)

    Reset value: 0x0000 0000 SDIO_ RESPONSE1/2/3/4 registers contain the status of the card, i.e. the part of the response received. Nations Technologies Inc. 475 / 701 Tel:+86-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: Sdio Data Timer Register (Sdio_Dtimer)

    Note: Before writing to the data control register for data transfer, the data timer register and data length register must be written first. Nations Technologies Inc. 476 / 701 Tel:+86-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: Sdio Data Length Register (Sdio_Datlen)

    If this bit is set, the DPSM performs SD I/O card specific operations. RWAITMOD Read wait mode. 0: Stop SDIO_CLK control read wait; Nations Technologies Inc. 477 / 701 Tel:+86-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 SDIO_DATCTRL must be changed to allow a new data transfer. Note: This register cannot be written within 7 HCLK clock cycles after writing data. Nations Technologies Inc. 478 / 701 Tel:+86-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: Sdio Data Counter Register (Sdio_Datcount)

    Description 31:24 Reserved Reserved, the reset value must be maintained. CEATAF CE-ATA command completion signal received for CMD61. Nations Technologies Inc. 479 / 701 Tel:+86-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: Sdio Interrupt Clear Register (Sdio_Intclr)

    SDIO_INTCLR is a write-only register, writing '1' in the corresponding register bit will clear the corresponding bit in the SDIO_STS status register. Nations Technologies Inc. 480 / 701 Tel:+86-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: Sdio Interrupt Enable Register (Sdio_Inten)

    Reset value: 0x0000 0000 In the corresponding bit '1', the SDIO_INTEN interrupt enable register determines which status bit generates the interrupt. Nations Technologies Inc. 481 / 701 Tel:+86-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 0: No interrupt will be generated when the transmit FIFO is full 1: Transmit FIFO full generates an interrupt RFIFOHFEN Rx FIFO half full interrupt enable. Nations Technologies Inc. 482 / 701 Tel:+86-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 Setting/clearing this bit by software to enable/disable the receive FIFO overflow error interrupt. 0: Receive FIFO overflow error does not generate an interrupt Nations Technologies Inc. 483 / 701 Tel:+86-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: Sdio Fifo Counter Register (Sdio_Fifocount)

    Reserved, the reset value must be maintained. 23:0 FIFOCOUNT The number of data words to be written to or read from the FIFO. Nations Technologies Inc. 484 / 701 Tel:+86-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: Sdio Data Fifo Register (Sdio_Datfifo)

    The FIFO data occupies 32 entries of 32-bit words at the address: (SDIO base address + 0x80) to (SDIO base address + 0xFC) Nations Technologies Inc. 485 / 701 Tel:+86-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: Controller Area Network (Can)

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

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

    CAN_MCTRL.SLPRQ bit to exit the sleep state. If the wake-up interrupt (set the CAN_INTE.WKUITE bit) is enabled, the wake-up interrupt will be generated once Nations Technologies Inc. 488 / 701 Tel:+86-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: Send Mailbox

    Each CAN has two receiving FIFOs, each of which can store three complete messages. No application program is needed to manage it, and it is managed by hardware. Nations Technologies Inc. 489 / 701 Tel:+86-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 19-3 Dual Can Block Diagram

    Mailbox 0 Mailbox 1 Mailbox 2 CAN2 Acceptance Filter CAN2 Receive FIFO1 Mailbox 0 Mailbox 1 Mailbox 2 Nations Technologies Inc. 490 / 701 Tel:+86-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: Can Test Mode

    CAN bus, without affecting the bus because dominant bits is not actually sent to the bus. To enter silent mode, the CAN_BTIM.SLM bit should be set and the CAN_BTIM.LBM bit should be cleared. Nations Technologies Inc. 491 / 701 Tel:+86-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: Figure 19-5 Silent Mode

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

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

    CAN_TSTS.RQCPM bit. At the same time, the transmission result can query the CAN_TSTS.TXOKM, CAN_TSTS.ALSTM and CAN_TSTS.TERRM bits. Nations Technologies Inc. 494 / 701 Tel:+86-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: Receiving Management

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

    When the FIFO overrun, the FFOVR bit will be set. If the FIFO overrun interrupt is currently enabled (the Nations Technologies Inc. 496 / 701 Tel:+86-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: Identifier Filtering

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

    The filter ID is used to store the identifier format, and the filter MASK is used to indicate which bits must be checked and which bits can be ignored. Identifier list mode Nations Technologies Inc. 498 / 701 Tel:+86-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: Table 19-1 Examples Of Filter Numbers

    32 bit list mode 16 bit list mode 2/3/4/5 FIFO1 32 bit mask mode 16 bit mask mode Nations Technologies Inc. 499 / 701 Tel:+86-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: Message Storage

    Message should be written into an empty sending mailbox by software before enable the sending request. You can query the sending status through the CAN_TSTS register. Nations Technologies Inc. 500 / 701 Tel:+86-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: Bit Time Characteristic

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

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

    13. send pause: applies to error passive nodes only. End Of Frame or Inter-Frame Space Error Delimiter or Overload Frame or Overload Frame Overload Delimiter Nations Technologies Inc. 503 / 701 Tel:+86-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: Can Interrupt

    When FIFO1 becomes full, and the CAN_RFF1.FFULL1 bit is set. When FIFO1 overruns, and the CAN_ RFF1.FFOVR1 bit is set.  Send interrupts(CAN_TX_IRQn): Nations Technologies Inc. 504 / 701 Tel:+86-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: Error Management

    CAN configuration flow can divided into serval phases. Nations Technologies Inc. 505 / 701 Tel:+86-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 For Reception: User can also change a filter value (CAN_FiRx) when the corresponding filter is deactivated. To deactivate Nations Technologies Inc. 506 / 701 Tel:+86-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: Can Register File

    In addition, only when the whole filter is set to the initialization mode (that is, CAN_FMC.FINITM=1), the settings of the filter can be modified, that is, the CAN_FM1,CAN_FS1 and CAN_FFA1 registers can be modified. Nations Technologies Inc. 507 / 701 Tel:+86-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: Can Register Address Overview

    DATA2[7:0] DATA1[7:0] DATA0[7:0] 188h Reset Value CAN_TMDH0 DATA7[7:0] DATA6[7:0] DATA5[7:0] DATA4[7:0] 18Ch Reset Value 190h CAN_TMI1 STDID[10:0]/EXTID[28:18] EXTID[17:0] Nations Technologies Inc. 508 / 701 Tel:+86-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 1C0h Reset Value CAN_RMDT1 MTIM[15:0] FMI[7:0] DLC[3:0] 1C4h Reset Value CAN_RMDL1 DATA3[7:0] DATA2[7:0] DATA1[7:0] DATA0[7:0] 1C8h Reset Value Nations Technologies Inc. 509 / 701 Tel:+86-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 240h Reset Value CAN_F0B2 FBC[31:0] 244h Reset Value CAN_F1B1 FBC[31:0] 248h Reset Value CaN_F1B2 FBC[31:0] 24Ch Reset Value Nations Technologies Inc. 510 / 701 Tel:+86-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 Offset Register CAN_F13B1 FBC[31:0] 2A8h Reset Value CAN_F13B2 FBC[31:0] 2ACh Reset Value Nations Technologies Inc. 511 / 701 Tel:+86-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: Can Control And Status Register

    Notes: For more information about bus-off status, please refer to 19.5.1: Error management. Nations Technologies Inc. 512 / 701 Tel:+86-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 CAN activity (sending or receiving) is over, the hardware sets the CAN_MSTS.INIAK bit and CAN enters initialization mode. Nations Technologies Inc. 513 / 701 Tel:+86-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 If the CAN_INTE.ERRITE bit is set, a state change interrupt is generated. This bit is cleared by software. SLPAK Sleep acknowledge Nations Technologies Inc. 514 / 701 Tel:+86-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 Transmit mailbox 2 empty When there is no message waiting to be sent in mailbox 2, hardware sets this bit. Nations Technologies Inc. 515 / 701 Tel:+86-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 When the mailbox 1 fails to send due to the loss of arbitration, set this bit TXOKM1 Transmission OK of mailbox 1 Nations Technologies Inc. 516 / 701 Tel:+86-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 CAN_TSTS.ALSTM0 and CAN_TSTS.TERRM0 bits) of mailbox 0 are also cleared. CAN receive FIFO 0 register (CAN_RFF0) Address offset: 0x0c Reset value: 0x0000 0000 Nations Technologies Inc. 517 / 701 Tel:+86-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 Release FIFO 1 output mailbox. The software releases the output mailbox of the receive FIFO by setting this bit. If Nations Technologies Inc. 518 / 701 Tel:+86-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 0: When there is an error registration in the CAN_ESTS register, no interrupt is generated; 1: When there is an error registration in the CAN_ESTS register, an interrupt is generated. Nations Technologies Inc. 519 / 701 Tel:+86-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 Notes: Please refer to 19.5 Section CAN interrupt. CAN error status register (CAN_ESTS) Address offset: 0x18 Reset value: 0x0000 0000 Nations Technologies Inc. 520 / 701 Tel:+86-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 (The value of the receiving error counter or the sending error counter is > 127). Nations Technologies Inc. 521 / 701 Tel:+86-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 Baud rate prescaler This bit field defines the time length of the time unit (tq) =(BRTP[9:0]+1) x t PCLK Nations Technologies Inc. 522 / 701 Tel:+86-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: Can Mailbox Register

    When the mailbox is not empty, all bits in this register are write-protected. Address offset: 0x184, 0x194, 0x1A4 Reset value: undefined Nations Technologies Inc. 523 / 701 Tel:+86-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 Name Description 31:24 DATA3[7:0] Data byte 3 Data byte 3 of the message. 23:16 DATA2[7:0] Data byte 2 Nations Technologies Inc. 524 / 701 Tel:+86-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 Receive FIFO mailbox identifier register (CAN_RMIx) (x=0..1) Address offset: 0x1B0, 0x1C0 Reset value: undefined Notes: All receiving mailbox registers are read-only. Nations Technologies Inc. 525 / 701 Tel:+86-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 DLC is always 0. Receive FIFO mailbox low byte data register(CAN_RMDLx)( x=0..1) Address offset: 0x1B8, 0x1C8 Reset value: undefined Nations Technologies Inc. 526 / 701 Tel:+86-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 Data byte 5 Data byte 5 of the message. DATA4[7:0] Data byte 4 Data byte 4 of the message. Nations Technologies Inc. 527 / 701 Tel:+86-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: Can Filter Register

    1: Two 32-bit registers of CAN_FiRx work in identifier list mode. CAN filter scale register (CAN_FS1) Address offset: 0x20C Nations Technologies Inc. 528 / 701 Tel:+86-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 1: the filter is associated to FIFO1. CAN filter activation register (CAN_FA1) Address offset: 0x21C Reset value: 0x0000 0000 Nations Technologies Inc. 529 / 701 Tel:+86-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 Notes: According to the different settings of filter bit width and mode, the functions of the two registers in the filter Nations Technologies Inc. 530 / 701 Tel:+86-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 Mask/identifier register in mask mode has the same definition as register bit in identifier list mode. See for the address of the filter bank register Table 19-4. Nations Technologies Inc. 531 / 701 Tel:+86-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: Serial Peripheral Interface/Inter-Ic Sound (Spi/ I 2 S)

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

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

    Figure 20-2 Selective management of hardware/software The following figure is an example of the interconnection of single master and single slave devices Nations Technologies Inc. 534 / 701 Tel:+86-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: 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. Nations Technologies Inc. 535 / 701 Tel:+86-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: Data Format

    MOSI pin. At the same time, the data received on the MISO pin is serially shifted into the shift register in the same Nations Technologies Inc. 536 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 537: Figure 20-5 Schematic Diagram Of The Change Of Te/Rne/Busy When The Host Is Continuously Transmitting In Full Duplex Mode

    Set SPI_CTRL1.SPIEN = 1, Enable SPI module. Write the first data to be sent into SPI_DAT register (this operation will clear SPI_STS.TE bit). Nations Technologies Inc. 537 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 538: Figure 20-6 Schematic Diagram Of Te/Busy Change When The Host Transmits Continuously In One-Way Only Mode

    Figure 20-7 Schematic diagram of RNE change when continuous transmission occurs in receive-only mode (BIDIRMODE = 0 and Nations Technologies Inc. 538 / 701 Tel:+86-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 The data transfer process begins when the slave device receives the first clock edge. Before the master starts data transfer, software must ensure that the data to be send is written to the SPI_DAT register. Nations Technologies Inc. 539 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 540: Figure 20-8 Schematic Diagram Of The Change Of Te/Rne/Busy When The Slave Is Continuously Transmitting In

    The received data bits are sequentially and consecutively shifted serially into an shift register and then loaded into the SPI_DAT register (receive buffer) in parallel. Nations Technologies Inc. 540 / 701 Tel:+86-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 In slave mode, the NSS pin is low, and when the first clock edge arrives, the transmission process begins. In order to avoid accidental data transmission, software must write data to the transmit buffer before data transmission (it is Nations Technologies Inc. 541 / 701 Tel:+86-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: Status Flag

    After reading the SPI_DAT register, the hardware will set this flag to 0. BUSY flag bit (BUSY) Nations Technologies Inc. 542 / 701 Tel:+86-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: Disabling The Spi

    2. If you want to enter the shutdown mode, you must wait for the BUSY flag (SPI_STS.BUSY) to be set to 0 before Nations Technologies Inc. 543 / 701 Tel:+86-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: Spi Communication Using Dma

    DMA tansfer is DMA writes 0x22 into Configure the DMA complete SPI_DAT Tx channel and enable the SPI Wait TX=1 Nations Technologies Inc. 544 / 701 Tel:+86-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: Crc Calculation

    When the SPI hardware CRC check is enabled (SPI_CTRL1.CRCEN = 1) and the DMA is enabled, the hardware automatically completes the sending and receiving of CRC bytes when the communication ends. Nations Technologies Inc. 545 / 701 Tel:+86-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: Error Flag

    Receive buffer non empty flag RNEINTEN Master mode failure event MODERR Overflow error OVER ERRINTEN CRC error flag CRCERR Nations Technologies Inc. 546 / 701 Tel:+86-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: I 2 Sfunction Description

     MCLK: master clock (independent mapping, optional), output 256 × Fs clock signal to ensure better Nations Technologies Inc. 547 / 701 Tel:+86-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: Supported Audio Protocols

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

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

    Figure 20-19 MSB-aligned 16-bit data is extended to 32-bit packet frame, CLKPOL = 0 Receive Send 16-bit remaining 0 forced 16-bit data Right channel Left channel 32-bit Nations Technologies Inc. 551 / 701 Tel:+86-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: Figure 20-20 Lsb Alignment 16-Bit Or 32-Bit Full Precision, Clkpol = 0

    0x95AA66, the CPU will first read the SPI_DAT register to get 0x0095 (only the lower 8 bits are valid, the upper 8 bits are always 0), and then read the SPI_DAT register to get 0xAA66. Nations Technologies Inc. 552 / 701 Tel:+86-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: Figure 20-22 Lsb Aligned 16-Bit Data Is Extended To 32-Bit Packet Frame, Clkpol = 0

    1 bit. The standard data receiving and sending processing mode is the same as I S Philips standard. Nations Technologies Inc. 553 / 701 Tel:+86-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: Clock Generator

    In the master mode, the linear divider needs to be set correctly in order to obtain the desired audio frequency. Nations Technologies Inc. 554 / 701 Tel:+86-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: Figure 20-25 I 2 S Clock Generator Structure

    �� The exact audio frequency can be obtained by referring to the clock configuration in the table below. Nations Technologies Inc. 555 / 701 Tel:+86-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: I 2 S Transmission And Reception Sequence

    When I2S works in master mode, the CLK pin outputs the serial clock, the WS pin generates the channel selection Nations Technologies Inc. 556 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 557: Master Mode

    When I2S function is turned off, different audio standards, data length and channel length adopt different operation steps: Nations Technologies Inc. 557 / 701 Tel:+86-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: Status Flag

    (SPI_STS.BUSY) is set to 0 by hardware (software operation is invalid). In master receiving mode (SPI_I2SCFG.MODCFG = 11), the BUSY flag (SPI_STS.BUSY) is set to 0 during Nations Technologies Inc. 558 / 701 Tel:+86-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: Error Flag

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

    BIDIRMODE Bidirectional data mode enable 0: Select the "two-wire one-way" mode. 1: Select the "one-wire bidirectional " mode. Nations Technologies Inc. 560 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 561 0: Disable software slave device management. 1: Enable software slave device management. Note: Not used in I S mode. Nations Technologies Inc. 561 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 562 1: Data is sampled on the second clock edge. Note: This bit cannot be changed during communication. Note: Not used in I S mode. Nations Technologies Inc. 562 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 563: Spi Control Register 2 (Spi_Ctrl2)

    0: Disable receive buffer DMA. 1: Enable receive buffer DMA. 20.5.4 SPI status register (SPI_STS) Address: 0x08 Reset value: 0x0002 Nations Technologies Inc. 563 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 564 Receive buffer is not empty 0: The receive buffer is empty. 1: The receive buffer is not empty. Nations Technologies Inc. 564 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 565: Spi Data Register (Spi_Dat)

    20.5.7 SPI RX CRC register (SPI_CRCRDAT) (not used in I S mode) Address offset: 0x14 Reset value: 0x0000 Nations Technologies Inc. 565 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 566: Spi_ I 2 S Configuration Register ( Spi_I2Scfg

    Note: not used in I s mode. 20.5.9 SPI_ I S configuration register(SPI_I2SCFG) Address offset: 0x1c Reset value: 0x0000 Nations Technologies Inc. 566 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 567 Length of data to be transmitted 00: 16-bit data length. 01: 24-bit data length; 10: 32-bit data length; Nations Technologies Inc. 567 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 568: Spi_I S Prescaler Register (Spi_I2Sprediv)

    Note: For correct operation, this bit can only be set when I S is turned off. Use this bit only in S master mode. Not used in SPI mode. Nations Technologies Inc. 568 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 569: I 2 C Interface

    I2C module has two interface lines: serial data line (SDA) and serial clock line (SCL). Devices connected to the bus Nations Technologies Inc. 569 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 570: Software Communication Process

    The block diagram of I C interface is shown in the figure below. Nations Technologies Inc. 570 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 571: Start And Stop Conditions

    SDA line when SCL is high. as shown in the figure below. Figure 21-2 I2C bus protocol Start Stop condition condition Nations Technologies Inc. 571 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 572: Clock Synchronization And Arbitration

    SDA line is low, it considers that it has lost arbitration and shuts down its SDA output driver, while the other host continues to complete its own transmission. Nations Technologies Inc. 572 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 573 5. After the first byte is sent, I2C_STS1.TXDATE is set again, and the software writes the third byte to I2C_DAT, Nations Technologies Inc. 573 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 574: Figure 21-3 Slave Transmitter Transfer Sequence Diagram

    2. After receiving the START condition and the matched 7-bit or 10-bit address, I2C hardware will set I2C_STS1.ADDRF bit(the address received and matched with its own address) to 1. This bit should be detected Nations Technologies Inc. 574 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 575: Figure 21-4 Slave Receiver Transfer Sequence Diagram

    When the START condition is generated on the Nations Technologies Inc. 575 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 576 In the process of sending the penultimate byte, the software writes the last byte of data to I2C_DAT to clear the Nations Technologies Inc. 576 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 577: Figure 21-5 Master Transmitter Transfer Sequence Diagram

    The software sequence of EV8 must be completed before the end of the current byte transfer. c) When I2C_STS1.TXDATE or I2C_STS1.BSF bit is set, stop condition should be arranged when EV8_2 occurs. Nations Technologies Inc. 577 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 578 In this mode, the I2C interface receives data bytes from the SDA line and sends them to the DAT register Nations Technologies Inc. 578 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 579: Figure 21-6 Master Receiver Transfer Sequence Diagram

    I2C_STS1.ADDRF), the generation bits for acknowledge and stop condition should be cleared. 4. EV7: I2C_STS1.RXDATNE=1, read the DAT register to clear this event. Nations Technologies Inc. 579 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 580: Error Conditions Description

    Hardware release the bus. Overrun/Underrun Error (OVERRUN) In slave mode, disable clock extend prone to Overrun/Underrun Error: Nations Technologies Inc. 580 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 581: Dma Application

    When DMA transfer data is done, DMA need send a EOT/EOT_1 signal to I2C indicate this transfer is done. If Nations Technologies Inc. 581 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 582: 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. Nations Technologies Inc. 582 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 583: 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. Nations Technologies Inc. 583 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 584 0001100x). Only those devices that pull SMBALERT low can respond to ARA. This state is identified Nations Technologies Inc. 584 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 585: Debug Mode

    Receive buffer is not empty. RXDATNE EVTINTEN and BUFINTEN Send buffer is empty. TXDATE I2C error interrupt Bus error BUSERR ERRINTEN Nations Technologies Inc. 585 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 586: I2C Registers

    Reset Value I2C_DAT DATA[7:0] 010h Reserved Reset Value I2C_STS1 014h Reserved Reset Value I2C_STS2 PECVAL[7:0] 018h Reserved Reset Value Nations Technologies Inc. 586 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 587: I2C Control Register 1 (I2C_Ctrl1)

    Note ACKPOS bit can only be used in 2-byte receiving configuration and must be configured before receiving data. Nations Technologies Inc. 587 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 588 If I2C_CTRL1.SMBTYPE=0, the default address of SMBus device is used. If I2C_CTRL1.SMBTYPE=1, the host address of SMBus is used. Nations Technologies Inc. 588 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 589: I2C Control Register 2 (I2C_Ctrl2)

    0:Disable event interrupt; 1:Enable event interrupt This interrupt is generated when: I2C_STS1.STARTBF = 1 (Master) I2C_STS1.ADDR F = 1 (Master/Slave) Nations Technologies Inc. 589 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 590: I2C Own Address Register 1 (I2C_Oaddr1)

    Must always be kept as' 1' by the software. 13:10 Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 590 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 591: I2C Own Address Register 2 (I2C_Oaddr2)

    Note: In the slave mode, the address will not be copied into the data register; Note: if I2C_STS1.TXDATE =0, data can still be written into the data register; Nations Technologies Inc. 591 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 592: I2C Status Register 1 (I2C_Sts1)

    Set by hardware in slave mode when I2C_CTRL1.NOEXTEND=1, and when receiving a new byte in receiving mode, if the data within DAT register has not been read yet, over-run occurs,the Nations Technologies Inc. 592 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 593 During receiving data, this bit is set to' 1' when the data register is not empty, and it is not set at the address receiving stage. RXDATNE is not set when the ARLOST event occurs. Nations Technologies Inc. 593 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 594 1' after receiving the ACK of the second byte of the address. In slave mode: Nations Technologies Inc. 594 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 595: I2C Status Register 2 (I2C_Sts2)

    Hardware clears this bit when a stop condition or a repeated start condition is generated, or when I2C_CTRL1.EN=0. 0: No general call address was received; Nations Technologies Inc. 595 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 596: I2C Clock Control Register (I2C_Clkctrl)

    Clock control register in Fast/Standard mode (Master mode) This division factor is used to set the SCL clock in the master mode. Nations Technologies Inc. 596 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 597: I2C Rise Time Register (I2C_Tmrise)

    If the result is not an integer, write the integer part to TMRISE[5:0] to ensure the t parameter. HIGH Nations Technologies Inc. 597 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 598: Universal Synchronous Asynchronous Receiver Transmitter (Usart)

    LIN break frame detection, noise flag/overflow error/frame error in multi-buffer communication Nations Technologies Inc. 598 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 599: Functional Block Diagram

    The data packets of serial communication are transmitted from the sending device to the RX interface of the receiving Nations Technologies Inc. 599 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 600: Usart Frame Format

    Start Stat Stop bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7 Start Idle frame Start Stop Break frame Nations Technologies Inc. 600 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 601: Transmitter

    Receiving in Smartcard mode General USART mode, single-wire mode and modem mode. Transmitting and receiving in Smartcard mode Nations Technologies Inc. 601 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 602: Figure 22-4 Configuration Stop Bit

    USART_DAT register will clear USART_STS.TXDE; After writing the last data word in the USART_DAT register, wait for USART_STS.TXC =1, which indicates Nations Technologies Inc. 602 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 603: Single Byte Communication

    The samples at the 3rd, 5th, and 7th bits, and the samples at the 8th, 9th, and 10th bits are all '0' (that is, 6 '0'), then confirm the receipt of the start bit, the USART_STS.RXDNE flag bit is set, and if USART_CTRL1.RXDNEIEN=1, Nations Technologies Inc. 603 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 604: Figure 22-6 Start Bit Detection

    1.5 stop bit (Smartcard mode): when sending in Smartcard mode, the device must check whether the data is sent correctly. So the receiver function block must be activated (USART_CTRL1.RXEN=1) and sample the signal Nations Technologies Inc. 604 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 605: Framing Error

    USART_STS.RXDNE and the hardware will generate an interrupt when the USART_STS.RXDNE flag is set. In multi-buffer communication mode, an interrupt will be generated if the USART_CTRL3.ERRIEN bit Nations Technologies Inc. 605 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 606: Overrun Error

    PCLK  PCLK1 is used for USART2, USART3, UART4, UART5, up to 36MHz; Nations Technologies Inc. 606 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 607: Table 22-3 Error Calculation When Setting Baud Rate

    234.375 468.75 19.2 19.2 117.1875 19.2 234.375 57.6 57.6 39.0625 57.6 78.125 115.2 115.384 19.5 0.15% 115.2 39.0625 Nations Technologies Inc. 607 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 608: Receiver's Tolerance Clock Deviation

    When the parity bit is enabled for transmission, A parity bit is generated, parity check is performed on reception. Table 22-6 Frame format WL bit PCEN bit USART frame Nations Technologies Inc. 608 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 609: Dma Application

    5. Start the channel. 6. After the data transfer is completed, the transfer complete flag (DMA_INTSTS.TXCFx) is set to 1. Nations Technologies Inc. 609 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 610: Figure 22-7 Transmission Using Dma

    5. Start the channel. Nations Technologies Inc. 610 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 611: Hardware Flow Control

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

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

    As shown in the Figure 22-12 below, when an idle frame is detected, USART is woken up, and then USART_CTRL1.RCVWU is cleared by hardware. At this time, USART_STS.IDLEF is not set. Nations Technologies Inc. 613 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 614: Figure 22-12 Mute Mode Using Idle Line Detection

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

    The transmitter in synchronous mode works the same as in asynchronous mode. Data on the TX pin is sent out synchronously with CK. Nations Technologies Inc. 615 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 616: Figure 22-14 Usart Synchronous Transmission Example

    Clock(CLKPOL=0,CLKPHA=0) Clock(CLKPOL=0,CLKPHA=1) Clock(CLKPOL=1,CLKPHA=0) Clock(CLKPOL=1,CLKPHA=1) Data on TX (from master) MSB Stop Start LSB Data on RX (from slave) Nations Technologies Inc. 616 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 617: Single-Wire Half-Duplex Mode

    Communication conflicts are managed by software. Nations Technologies Inc. 617 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 618: Irda Sir Endec Mode

    For the receiver, the requirement for a valid signal is that the duration of the low level signal must be greater than 2 cycles of the IrDA low power baud rate clock. Nations Technologies Inc. 618 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 619: Lin Mode

    Whether the bus is idle or during the transmission of a data frame, as long as the break frame appears, it can be Nations Technologies Inc. 619 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 620 If a '1' is sampled before the 10th or 11th sample point, the current detection is canceled and the start bit is searched again. Nations Technologies Inc. 620 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 621: Figure 22-20 Break Detection In Lin Mode (11-Bit Break Length-The Linbdl Bit Is Set)

    Idle Bit0 Bit1 Bit2 Bit6 Bit7 Bit8 Bit9 Bit10 Bit3 Bit4 Bit5 wait delimiter Sample Sample data LINBDF Nations Technologies Inc. 621 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 622: Smartcard Mode (Iso7816)

    The example given in the following figure illustrates the signal on the data line with and without parity errors. Nations Technologies Inc. 622 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 623: Figure 22-22 Iso7816-3 Asynchronous Protocol

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

    RXDNEIEN Data overrun error detected. ORERR IDLEF Idle line detected IDLEIEN Parity error PEIEN Disconnect flag LINBDF LINBDIEN Nations Technologies Inc. 624 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 625: 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 Nations Technologies Inc. 625 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 626: 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. Nations Technologies Inc. 626 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 627 USART_STS.RXDNE, and the hardware will generate an interrupt when setting the USART_STS.RXDNE flag. In the multi-buffer communication mode, if the Nations Technologies Inc. 627 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 628: Usart Data Register (Usart_Dat)

    If parity is enabled, when the transmitted data is written into the register, the highest bit of the data (the 7th or 8th bit depends on USART_CTRL1.WL bit) will be replaced by Nations Technologies Inc. 628 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 629: Usart Baud Rate Register (Usart_Brcf)

    Software can set or clear this bit. 0:USART is disabled. Nations Technologies Inc. 629 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 630 RXEN Receiver enable 0: The receiver is disabled. 1: the receiver is enabled. RCVWU The receiver wakes up Nations Technologies Inc. 630 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 631: Usart Control Register 2 Register (Usart_Ctrl2)

    Note: This bit cannot be used for UART4/5/6/7. CLKPOL Clock polarity. This bit is used to set the polarity of CK pin in synchronous mode. Nations Technologies Inc. 631 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 632: Usart Control Register 3 Register (Usart_Ctrl3)

    USART will be awakened. 22.7.7 USART control register 3 register (USART_CTRL3) Address offset : 0x14 Reset value : 0x0000 0000 Nations Technologies Inc. 632 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 633 Note: This bit cannot be used for UART4/5/6/7 HDMEN Half-duplex mode enable. This bit is used to enable half-duplex mode. 0: Half-duplex mode is disabled. Nations Technologies Inc. 633 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 634: Usart Guard Time And Prescaler Register (Usart_Gtp)

    00000001: divide the source clock by 1. … 11111111: divide the source clock by 255. In IrDA normal mode: Nations Technologies Inc. 634 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 635 0010: Divide the source clock by 4. … 1111: Divide the source clock by 62. Note: This bit is invalid for UART4/5/6/7. Nations Technologies Inc. 635 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 636: Quad Serial Peripheral Interface (Qspi)

    Note: In XIP mode, only read operations are supported to external memory, and write operations are not supported. Note: Only big endian mode is supported when reading external memory data in XIP mode. Nations Technologies Inc. 636 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 637: Function Description

    Instruction phase, Address phase, Mode bits phase or the Data phase. Note: The Mode bits phase is only used in XIP mode. Nations Technologies Inc. 637 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 638: Operating Procedures

    Note: EEPROM read mode is only available in Single SPI mode (QSPI_CTRL0.SPI_FRF[1:0] = 00) The number of bytes to read is specified in QSPI_CTRL1.NDF[15:0]. Nations Technologies Inc. 638 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 639: Qspi Indirect Send Operation

     The instruction is sent in standard SPI mode, and the address is sent in the CTRL0.SPI_FRF mode. Nations Technologies Inc. 639 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 640 Regardless of the QSPI_ENH_CTRL0.TRANS_TYPE[1:0] configuration. When QSPI_CTRL0.SPI_FRF[1:0] is configured as 0x02 (Quad mode), N=3; when QSPI_CTRL0.SPI_FRF[1:0] is configured as 0x01 (Dual mode), N=1. Nations Technologies Inc. 640 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 641: Qspi Indirect Receive Operation

    The instruction is sent in standard SPI mode, and the address is received in the mode specified by QSPI_CTRL0.SPI_FRF. Nations Technologies Inc. 641 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 642 0x02 (Quad mode), N=3; when QSPI_CTRL0.SPI_FRF[1:0] is configured as 0x01 (Dual mode), N=1.  Only the receive timing of the Wait cycles phase WAIT IO[N:0](TX) CYCLES DATA IO[N:0](RX) Nations Technologies Inc. 642 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 643: Qspi Register

    Reset Value QSPI_RXFT RXFT_TFI[4:0] 01Ch Reserved Reset Value QSPI_TXFN TXFN[5:0] 020h Reserved Reset Value 024h QSPI_RXFN Reserved RXFN[5:0] Nations Technologies Inc. 643 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 644 054h CTRL Reserved Reset Value 060h+004h*x(x QSPI_DATx DATx[31:0] =0~31) Reset Value QSPI_RS_DELA SDCN[7:0] 0F0h Reserved Reserved Reset Value Nations Technologies Inc. 644 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 645: Qspi Control 0 Register (Qspi_Ctrl0)

    Note: This register cannot be written when the QSPI_EN.QEN = 1. Address offset: 0x00 Reset value: 0x0080 4407 Nations Technologies Inc. 645 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 646 1: Toggles one cycle after activation of the select line and captures data on the second edge of the serial clock. Nations Technologies Inc. 646 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 647: Qspi Control 1 Register (Qspi_Ctrl1)

    When QSPI_CTRL0.TMOD[1:0] = 10 or 11, this register configures the number of consecutively received data frames 23.6.4 QSPI Enable Register (QSPI_EN) Address offset: 0x08 Reset value: 0x0000 0000 Nations Technologies Inc. 647 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 648: Qspi Microwire Control Register (Qspi_Mw_Ctrl)

    23.6.6 QSPI Slave Enable Register (QSPI_SLAVE_EN) Note: Enable the QSPI_EN register, the QSPI_SLAVE_EN register will be enabled for external slave device selection Nations Technologies Inc. 648 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 649: Qspi Baud Rate Select Register (Qspi_Baud)

    2 and 65534. 23.6.8 QSPI Transmit FIFO Threshold Level Register (QSPI_TXFT) Address offset: 0x18 Reset value: 0x0000 0000 Nations Technologies Inc. 649 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 650: Qspi Receive Fifo Threshold Level Register (Qspi_Rxft)

    1, a full interrupt is triggered. 23.6.10 QSPI Transmit FIFO Level Register (QSPI_TXFN) Address offset: 0x20 Reset value: 0x0000 0000 Nations Technologies Inc. 650 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 651: Qspi Receive Fifo Level Register (Qspi_Rxfn)

    RXFNE Receive FIFO Not Empty. 0: Receive FIFO is empty Nations Technologies Inc. 651 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 652: Qspi Interrupt Mask Register (Qspi_Imask)

    Receive FIFO Full Interrupt Mask. 0: Mask 1: Not mask RXFOIM Receive FIFO Overflow Interrupt Mask. 0: Mask 1: Not mask Nations Technologies Inc. 652 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 653: Qspi Interrupt Status Register (Qspi_Ists)

    Transmit FIFO Overflow Interrupt Status. 0: Invalid, after masking. 1: Valid, after masking. TXFEIS Transmit FIFO Empty Interrupt Status. Nations Technologies Inc. 653 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 654: Qspi Raw Interrupt Status Register (Qspi_Rists)

    1: Valid, prior to masking. TXFERIS Transmit FIFO Empty Raw Interrupt Status. 0: Invalid, prior to masking. 1: Valid, prior to masking. Nations Technologies Inc. 654 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 655: Qspi Transmit Fifo Overflow Interrupt Clear Register (Qspi_Txfoi_Clr)

    After reading this register, clear the Rx FIFO overflow interrupt status. 23.6.18 QSPI Receive FIFO Underflow Interrupt Clear Register (QSPI_RXFUI_CLR) Address offset: 0x40 Reset value: 0x0000 0000 Nations Technologies Inc. 655 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 656: Qspi Multi-Master Interrupt Clear Register (Qspi_Mmci_Clr)

    After reading this register, clear transmit FIFO overflow interrupt, receive FIFO overflow interrupt, receive FIFO underflow interrupt, and multi-master conflict Nations Technologies Inc. 656 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 657: Qspi Dma Control Register (Qspi_Dma_Ctrl)

    DMA Transmit Data Level. 23.6.23 QSPI DMA Receive Data Level Register (QSPI_DMARDL_CTRL) Address offset: 0x54 Reset value: 0x0000 0000 Nations Technologies Inc. 657 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 658: Qspi Data Register Qspi_Datx

    Reserved, the reset value must be maintained Sampling Edge Select of Receive Data 0: rising edge sampling 1: falling edge sampling Nations Technologies Inc. 658 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 659: Qspi Enhanced Spi Mode Control 0 Register Qspi_Enh_Ctrl0

    Wait Cycles in Dual/Quad mode between control frames transmit and data reception. Reserved Reserved, the reset value must be maintained Nations Technologies Inc. 659 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 660: Qspi Ddr Transmit Drive Edge Register (Qspi_Ddr_Txde)

    = QSPI_BAUD/2 - 1. 23.6.28 QSPI XIP Mode bits Register (QSPI_XIP_MODE) Address offset: 0xFC Nations Technologies Inc. 660 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 661: Qspi Xip Incr Transfer Opcode Register (Qspi_Xip_Incr_Toc)

    Address offset: 0x104 Reset value: 0x0000 0000 Bit field Name Description 31:16 Reserved Reserved, the reset value must be maintained Nations Technologies Inc. 661 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 662: Qspi Xip Control Register (Qspi_Xip_Ctrl)

    0: The size and number of data frames depend on the HSIZE and HBURST signals of the AHB bus Nations Technologies Inc. 662 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 663: Qspi Xip Slave Enable Register (Qspi_Xip_Slave_En)

    Enable the QSPI_EN register, the QSPI_XIP_SLAVE_EN register will be enabled for external slave device selection to enable chip select. Address offset: 0x10C Reset value: 0x0000 0000 Nations Technologies Inc. 663 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 664: Qspi Xip Receive Fifo Overflow Interrupt Clear Register (Qspi_Xip_Rxfoi_Clr)

    After reading this register, clear the Rx FIFO overflow interrupt status 23.6.34 QSPI XIP time out for continuous transfers register (QSPI_XIP_TOUT) Address offset: 0x114 Reset value: 0x0000 0000 Nations Technologies Inc. 664 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 665 Nations Technologies Inc. 665 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 666: Comparator (Comp)

    COMP Interrupt Polarity Selection TIM1_BKIN TIM1_OCrefClear TIM1_IC1 TIM2_IC2 DAC1/PA4 TIM2_OCrefClear DAC2/PA5 TIM3_IC2 VREF1 TIM3_OCrefClear VREF2 TIM5_IC1 TIM8_BKIN TIM1_BKIN +TIM8_BKIN Nations Technologies Inc. 666 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 667: Figure 24-2 Comparator3 And Comparator4 Connection Diagram

    Polarity Selection TIM1_BKIN PB13 TIM3_IC3 DAC1/PA4 TIM3_OCrefClear DAC2/PA5 TIM4_IC3 VREF1 TIM4_OCrefClear VREF2 TIM5_IC3 TIM8_BKIN TIM8_OCrefClear TIM8_IC1 TIM1_BKIN + TIM8_BKIN Nations Technologies Inc. 667 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 668: Figure 24-3 Comparator5,Comparator6,Comparator7 Connection Diagram

    Polarity Selection TIM1_BKIN DAC1/PA4 TIM2_IC1 DAC2/PA5 TIM2_OCrefClear VREF1 TIM3_IC1 VREF2 TIM3_OCrefClear TIM5_IC1 TIM8_BKIN TIM8_OCrefClear TIM8_IC1 TIM1_BKIN + TIM8_BKIN Nations Technologies Inc. 668 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 669: Main Features

    COMPx_FILC.SAMPW[4:0]/2) Configure the filter sampling frequency (for timer applications, sampling frequency should be greater than 5MHz) Nations Technologies Inc. 669 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 670: Comp Working Mode

    GPIO input, GPIO output. The comparator INP pin has the following configuration. Nations Technologies Inc. 670 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 671: Interrupt

    TIM8_BKIN Other Interrupt COMP supports interrupt response, and COMP1, COMP1, COMP2, COMP3 share one interrupt entry , COMP4, Nations Technologies Inc. 671 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 672: Comp Register

    Reset Value COMP2_FILP CLKPSC[15:0] 028h Reserved Reset Value 02Ch Reserved COMP3_CTRL 030h Reset Value COMP3_FILC 034h Reset Value Nations Technologies Inc. 672 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 673 COMP6_FILC 064h Reset Value COMP6_FILP CLKPSC[15:0] 068h Reserved Reset Value 06Ch Reserved COMP7_CTRL 070h Reset Value 074h COMP7_FILC Nations Technologies Inc. 673 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 674: Comp Control Register (Compx_Ctrl)

    This read-only bit is a copy of comparator output state. 0: Output is low (non-inverting input below inverting input); Nations Technologies Inc. 674 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 675: Comp Window Mode Register (Comp_Winmode)

    This bit selects window mode: the two non-inverting inputs of the comparator share the PC3 or PC4 input. 0: Comparators 5 and 6 are not in window mode; Nations Technologies Inc. 675 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 676: Comp Lock Register (Comp_Lock)

    Same function as CMP7LK. 24.7.5 COMP interrupt enable register (COMP_INTEN) Address offset : 0x8C Reset value : 0x0000 0000 Nations Technologies Inc. 676 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 677: Comp Interrupt Status Register (Comp_Intsts)

    Same function as COMP7IS. 24.7.7 COMP filter register (COMPx_FILC) Address offset : 0x14,0x24,0x34,0x44,0x54,0x64,0x74 Reset value : 0x0000 0000 Nations Technologies Inc. 677 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 678: Comp Filter Frequency Division Register (Compx_Filp)

    2: Every 3 cycle … 24.7.9 COMP reference voltage register (COMP_VREFSCL) Address offset : 0x94 Reset value : 0x0000 0000 Nations Technologies Inc. 678 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 679 0: disable; 1: enable. VREF1SET[5:0] VREF1 voltage scaler trim value. VREF1EN VREF1 voltage scaler: 0: disable; 1: enable. Nations Technologies Inc. 679 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 680: Operational Amplifier (Opamp)

    The output of OPAMP3 is connected to the analog input channel 1 of ADC3 The output of OPAMP4 is connected to the analog input channel 3 of ADC4 Nations Technologies Inc. 680 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 681: Figure 25-1 Block Diagram Of Opamp1 And Opamp2 Connection Diagram

    Figure 25-1 Block diagram of OPAMP1 and OPAMP2 connection diagram DAC2/PA5 OPAMP1 ADC1 Channel3 ADC2 Channel3 OPAMP2 Nations Technologies Inc. 681 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 682: Internal Connection Between Opamp And Comp

    OPAMP1, OPAMP2, COMP1, COMP2, COMP3, ADC1 and ADC2 constitute a group of analog linkage applications, and the topology relationship is as follows: Nations Technologies Inc. 682 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 683: Figure 25-3 Simulation Module Linkage Relationship 1

    TIM8_BKIN TIM1_BKIN +TIM8_BKIN OPAMP3, OPAMP4, COMP4, COMP5, COMP6, ADC3 and ADC4 constitute a group of analog linkage applications, Nations Technologies Inc. 683 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 684: Figure 25-4 Simulation Module Linkage Relationship 2

    TIM1_BKIN Polarity Selection TIM2_IC2 DAC1/PA4 TIM2_OCrefClear DAC2/PA5 TIM4_IC4 VREF1 TIM4_OCrefClear VREF2 TIM5_IC1 TIM8_BKIN TIM8_OCrefClear TIM8_IC1 TIM1_BKIN + TIM8_BKIN Nations Technologies Inc. 684 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 685: Opamp Working Mode

    OPAMPx_CS. VMSSEL or OPAMPx_CS. VMSEL is connected to the output port from the chip interior. Nations Technologies Inc. 685 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 686: Opamp Internal Gain (Pga) Mode

    OPAMPx_CS. PGAGAN to gain selection.The output of an OPAMP can be input to another OPAMP or a resistive network. OPAMP's VM input pin can be used as a normal GPIO. Nations Technologies Inc. 686 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 687: Opamp With Filter Internal Gain Mode

    OPAMAPx_CS.VPSEL is set to be connected to the external pin, and the negative of OPAMP can be connected to components such as capacitors. Figure 25-8 Internal gain mode with filter Nations Technologies Inc. 687 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 688: Opamp Calibration

    25.2.5 OPAMP calibration The chip has been calibrated before delivery. Users can calibrate the chip again according to the actual environment. Note: Contact Nations for specific calibration methods to obtain relevant information. 25.2.6 OPAMP independent write protection By configuring the OPAMP_LOCK register, the write protection of OPAMP can be set independently.After the write protection is set, the software cannot write to the corresponding OPAMP register.
  • Page 689: Opamp Control Status Register (Opampx_Cs)

    This bit is set or cleared by software to control the automatic switching between primary and secondary inputs (VPSEL, VMSEL and VPSSEL, VMSSEL). Nations Technologies Inc. 689 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 690 OPAMP mode selection (Operational amplifier PGA mode) 0x: External zoom mode; 10: Internal PGA enable; 11: Internal follow mode. Nations Technologies Inc. 690 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 691: Opamp Lock Register (Opamp_Lock)

    0: OPAMP4 register can read and write; 1: OPAMP4 register is read-only. OPAMP3LK Same as OPAMP4LK. OPAMP2LK Same as OPAMP4LK. OPAMP1LK Same as OPAMP4LK. Nations Technologies Inc. 691 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 692: Debug Support (Dbg)

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

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

    When the corresponding bit of the peripheral control bit in the DBG_CTRL register is set to 1, the corresponding Nations Technologies Inc. 694 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 695: Dbg Registers

    Lower 4 digits of device model. Device model consists of 12 bits, including high, medium and low, representing the Nations Technologies Inc. 695 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 696: Debug Control Register (Dbg_Ctrl)

    0: CAN1 is still running normally; 1: The receiving register of CAN1 does not continue to receive data Nations Technologies Inc. 696 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 697 1: (FCLK ON, HCLK ON) In sleep mode, both the FCLK and HCLK clocks are Nations Technologies Inc. 697 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 698 Bit field Name Description provided by the previously configured system clock. Nations Technologies Inc. 698 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 699: Unique Device Serial Number (Uid)

    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 700: Version History

    Version history Date Version Remark 2022.12.28 V1.0.0 Initial version Nations Technologies Inc. 700 / 701 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 701: Notice

    It is the responsibility of the user of this document to properly design, program, and test the functionality and safety of any application made of this information and any resulting product. In no event shall NATIONS be liable for any direct, indirect, incidental, special, exemplary, or consequential damages arising in any way out of the use of this document or the Product.

Table of Contents