Nations N32G45 Series User Manual

32-bit arm cortex-m4 microcontroller
Table of Contents

Advertisement

Quick Links

N32G45x series
®
®
32-bit ARM
Cortex
-M4 microcontroller
User manual V3.0

Advertisement

Table of Contents
loading

Summary of Contents for Nations N32G45 Series

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

    4.1.1 Power supply ..............................76 4.1.2 Power supply supervisor ............................ 78 Power modes ................................80 4.2.1 SLEEP mode ..............................84 Nations Technologies Inc. 2 / 838 Tel:+86-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) ......................109 6.3.3 Clock Configuration Register (RCC_CFG) ..................... 110 6.3.4 Clock Interrupt Register (RCC_CLKINT) ...................... 114 Nations Technologies Inc. 3 / 838 Tel:+86-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 ) ............177 7.4.10 AFIO alternate remapping configuration register 5(AFIO_RMP_CFG5) ............. 180 Nations Technologies Inc. 4 / 838 Tel:+86-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 ............................... 212 9.3.9 Scanning mode ..............................213 9.3.10 Injection channel management ......................... 213 9.3.11 Discontinuous mode ............................214 Nations Technologies Inc. 5 / 838 Tel:+86-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 Introduction ................................244 Main features ................................ 244 DAC function description and operation description ................... 246 10.3.1 DAC enable ..............................246 Nations Technologies Inc. 6 / 838 Tel:+86-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 ..............................267 11.3.2 Counter mode ..............................268 11.3.3 Repetition counter ............................273 11.3.4 Clock selection ..............................276 Nations Technologies Inc. 7 / 838 Tel:+86-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) ....................332 General-purpose timers (TIM2, TIM3, TIM4 and TIM5) ..................333 General-purpose timers introduction ........................333 Nations Technologies Inc. 8 / 838 Tel:+86-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) ........................... 386 Introduction ................................386 Main features ................................386 Basic timers description ............................387 13.3.1 Time-base unit ..............................387 Nations Technologies Inc. 9 / 838 Tel:+86-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) ....................411 14.3.6 RTC Prescaler Register (RTC_PRE) ......................413 14.3.7 RTC Wakeup Timer Register (RTC_WKUPT) ....................413 Nations Technologies Inc. 10 / 838 Tel:+86-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 ..........................433 16.5.2 IWDG key register (IWDG_KEY) ........................ 433 16.5.3 IWDG pre-scaler register (IWDG_PREDIV) ....................433 Nations Technologies Inc. 11 / 838 Tel:+86-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 ............................477 18.5.5 Response format ............................478 Hardware flow control ............................481 SDIO register ................................ 481 Nations Technologies Inc. 12 / 838 Tel:+86-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.6.4 Receive data byte number register n (USB_CNTn_RX) ................522 Controller area network (CAN) ..........................524 Introduction to CAN ............................. 524 Nations Technologies Inc. 13 / 838 Tel:+86-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.7 Error flag ............................... 584 21.3.8 SPI interrupt ..............................584 S function description ............................585 21.4.1 Supported audio protocols ..........................586 Nations Technologies Inc. 14 / 838 Tel:+86-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.6.10 I2C Rise time register (I2C_TMRISE) ......................635 Universal synchronous asynchronous receiver transmitter (USART) ..............636 Introduction ................................636 Nations Technologies Inc. 15 / 838 Tel:+86-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 24.6.3 QSPI Control 1 Register (QSPI_CTRL1) ...................... 685 24.6.4 QSPI Enable Register (QSPI_EN)......................... 685 24.6.5 QSPI Microwire Control Register (QSPI_MW_CTRL)................686 Nations Technologies Inc. 16 / 838 Tel:+86-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.4.7 Power management (PMT) ..........................721 25.4.8 Ethernet DMA function description....................... 724 25.4.9 Precision time protocol (PTP) ........................740 Nations Technologies Inc. 17 / 838 Tel:+86-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 25.5.38 ETH PTP timestamp low update register (ETH_PTPNSUP) ..............773 25.5.39 ETH PTP timestamp addend register (ETH_PTPTSADD) ................. 773 Nations Technologies Inc. 18 / 838 Tel:+86-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 27.2.1 OPAMP independent op amp mode ....................... 809 27.2.2 OPAMP follow mode............................. 809 27.2.3 OPAMP internal gain (PGA) mode ....................... 810 Nations Technologies Inc. 19 / 838 Tel:+86-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 MCU debugging function ............................. 831 29.3.1 Low power mode support ..........................831 29.3.2 Peripheral debugging support ........................831 DBG registers ............................... 832 Nations Technologies Inc. 20 / 838 Tel:+86-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 Introduction ................................836 UID register ................................836 UCID register ............................... 836 Version history ................................837 Notice ..................................838 Nations Technologies Inc. 21 / 838 Tel:+86-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 7-14 TIM3 alternate function remapping ....................147 Table 7-15 TIM2 alternate function remapping ....................148 Table 7-16 TIM1 alternate function remapping ....................148 Nations Technologies Inc. 22 / 838 Tel:+86-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 7-44 I2C ..............................155 Table 7-45 SPI ..............................156 Table 7-46 I2S..............................156 Table 7-47 SDIO .............................. 157 Nations Technologies Inc. 23 / 838 Tel:+86-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 12-1 Counting direction versus encoder signals ..................361 Table 12-2 Register map and reset value ......................363 Nations Technologies Inc. 24 / 838 Tel:+86-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 Table 18-19 I/O mode command ........................475 Table 18-20 Lock command ..........................476 Table 18-21 Application related commands ....................476 Nations Technologies Inc. 25 / 838 Tel:+86-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 Table 22-1 Comparison between SMBus and I2C ................... 621 Table 22-2 I C interrupt request ........................623 Table 22-3 I2C register overview ........................624 Nations Technologies Inc. 26 / 838 Tel:+86-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 Table 28-2 DVP register overview........................820 Table 29-1 Debug port pin ..........................831 Table 29-2 DBG register overview ........................832 Nations Technologies Inc. 27 / 838 Tel:+86-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 9-11 Schematic diagram of fast alternate mode conversion for continuous conversion of 1 channel .. 222 Figure 9-12 Schematic diagram of slow alternate mode conversion for 1 channel ........223 Nations Technologies Inc. 28 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 29 Figure 11-16 Capture/compare channel (example: channel 1 input stage) ............280 Figure 11-17 Capture/compare channel 1 main circuit ..................281 Nations Technologies Inc. 29 / 838 Tel:+86-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 12-13 Capture/compare channel (example: channel 1 input stage) ............345 Figure 12-14 Capture/compare channel 1 main circuit ..................346 Nations Technologies Inc. 30 / 838 Tel:+86-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 18-5 SDIO continuous write operation....................444 Figure 18-6 SDIO block diagram ........................444 Figure 18-7 SDIO adapter ..........................445 Nations Technologies Inc. 31 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 32 Figure 21-5 Schematic diagram of the change of TE/RNE/BUSY when the host is continuously transmitting in full duplex mode ............................575 Nations Technologies Inc. 32 / 838 Tel:+86-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 Figure 22-5 Master transmitter transfer sequence diagram ................615 Figure 22-6 Master receiver transfer sequence diagram .................. 617 Nations Technologies Inc. 33 / 838 Tel:+86-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 Figure 25-4 MII interface signal line ....................... 710 Figure 25-5 MII clock source ........................... 711 Figure 25-6 RMII interface signal line ......................712 Nations Technologies Inc. 34 / 838 Tel:+86-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 Figure 28-1 DVP interface timing example ..................... 817 Figure 29-1 N32G45x level and Cortex -M4F level debugging block diagram ........... 829 Nations Technologies Inc. 35 / 838 Tel:+86-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: Abbreviations In The Text

    For all models of N32G45x microcontroller series, the existence and number of a peripheral, please refer to the data sheet of the corresponding model. Nations Technologies Inc. 36 / 838 Tel:+86-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: 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. 37 / 838 Tel:+86-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 Settable I2C1_ER I2C1 error interrupt 0x0000_00C0 Settable I2C2_EV I2C2 event interrupt 0x0000_00C4 Settable I2C2_ER I2C2 error interrupt 0x0000_00C8 Nations Technologies Inc. 38 / 838 Tel:+86-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 DMA2 channel 7 global interrupt 0x0000_0154 Settable I2C3_EV I2C3 event interrupt 0x0000_0158 Settable I2C3_ER I2C3 error interrupt 0x0000_015C Nations Technologies Inc. 39 / 838 Tel:+86-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: 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. 40 / 838 Tel:+86-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: 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. 41 / 838 Tel:+86-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 Line Mapping

     Configure 21 interrupt/event line mask bits (EXTI_IMASK, EXTI_EMASK);  Configure the request bit of the software interrupt event register (EXTI_SWIE). 2.2.4 EXTI line mapping Nations Technologies Inc. 42 / 838 Tel:+86-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: Figure 2-2 External Interrupt Gpio Mapping

    The EXTI line 18 is connected to the USB wake-up event  The EXTI line 19 is connected to the Ethernet wake-up event. Nations Technologies Inc. 43 / 838 Tel:+86-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: Exti Registers

    Interrupt mask on line x 0: Interrupt request from line x is masked; 1: Interrupt request from line x is not masked. Nations Technologies Inc. 44 / 838 Tel:+86-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: 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. 45 / 838 Tel:+86-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: Exti Software Interrupt Event Register (Exti_Swie)

    1: A pending trigger request has occurred. This bit is set to '1' when a selected edge trigger event occurs on the external interrupt Nations Technologies Inc. 46 / 838 Tel:+86-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: 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. 47 / 838 Tel:+86-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 And Bus Architecture

    TIM8 TIM8  ICode bus: Connect the ICode bus of Cortex™-M4FP core with the flash instruction interface. Instruction Nations Technologies Inc. 48 / 838 Tel:+86-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: 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. 49 / 838 Tel:+86-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: Figure 3-2 Bus Address Map

    The following mapping formula shows how each byte in the alias area corresponds to the corresponding bit in the bit Nations Technologies Inc. 50 / 838 Tel:+86-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: 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. 51 / 838 Tel:+86-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: Memory System

    The maximum main memory area is 512KB, also known as main flash memory, which contains 256 Page for storing and running user programs and storing data. Nations Technologies Inc. 52 / 838 Tel:+86-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-2 Flash Bus Address List

    USART1 and USB (DFU) serial interface to program the flash memory.  System configuration area, which contains basic information of the chip. Nations Technologies Inc. 53 / 838 Tel:+86-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 Page Erase process:  Check the FLASH_ STS.BUSY bit to confirm that there are no other flash operations in progress; Nations Technologies Inc. 54 / 838 Tel:+86-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 (the high byte is the complement of the low byte), and start the programming operation, which will ensure that the option byte and its complement are always correct. Option byte erase process: Nations Technologies Inc. 55 / 838 Tel:+86-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 FLASH_OPTKEY. Nations Technologies Inc. 56 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 57: Table 3-3 Option Byte List

    Write protection option byte: WRP0 ~ 3, which can be written through the register FLASH _WRP [31:0] query Nations Technologies Inc. 57 / 838 Tel:+86-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: Table 3-4 Read Protection Configuration List

    RDP2! = 0xCC || nRDP2! = 0x33 L2 level 0xXX 0xXX 0x33 0xCC L1 level Not the above three configurations  L0 level: Nations Technologies Inc. 58 / 838 Tel:+86-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 RDP2. No matter what the value of RDP1 is, as long as it satisfies Nations Technologies Inc. 59 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 60: Table 3-5 Flash Read-Write-Erase (1) Permission Control Table

    Prohibit Read-write-erase Prohibit area Read and Read and Read and SRAM (All) Read and write write write write Nations Technologies Inc. 60 / 838 Tel:+86-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 Read and write write write write Prohibit Read-only Read-only Prohibit L0 or L2 is allowed. Before 4KB of flash Nations Technologies Inc. 61 / 838 Tel:+86-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 SRAM Access to areas Read-write-erase Before 4KB of flash Read-write- Read-write- Read-write- Change to L1 or L2 is Nations Technologies Inc. 62 / 838 Tel:+86-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 Flash main memory Allow Allow Allow area mass erase Flash option byte area Read-only Read-only Read-only Nations Technologies Inc. 63 / 838 Tel:+86-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: Icache

     When using icache, there is no WB/WT selection when the CPU writes operation. Register description FLASH_AC.ICAHEN and FLASH_AC.ICAHRST are the iCache enable switch and iCache data clear switch respectively. Nations Technologies Inc. 64 / 838 Tel:+86-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: Sram

    SRAM supports code running (supports access of SBus, ICode and DCode), and can run programs at full speed in Nations Technologies Inc. 65 / 838 Tel:+86-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: R-Sram(Retention Sram

    Retention is possible, data still needs to be retained in stop2 and standby modes (can be configured not to retain) Nations Technologies Inc. 66 / 838 Tel:+86-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: Flash Register

    See for abbreviations in register descriptions 1.1 section. 3.2.5.2.1 The FLASH access control register (FLASH_AC) Address offset: 0x00 Nations Technologies Inc. 67 / 838 Tel:+86-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 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. 68 / 838 Tel:+86-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', and writing '1' can clear this bit status. Note: Every successful programming or erasing will set the EOP state. Nations Technologies Inc. 69 / 838 Tel:+86-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 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. 70 / 838 Tel:+86-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 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. 71 / 838 Tel:+86-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 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. 72 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 73 1: 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. 73 / 838 Tel:+86-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 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. 74 / 838 Tel:+86-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 Bit field Name Description Chapter). 0: disable 1: enable LOCKSTRT[3:0] iCache lock start. 0: disable 1: enable Nations Technologies Inc. 75 / 838 Tel:+86-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 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. 76 / 838 Tel:+86-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 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. 77 / 838 Tel:+86-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: 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. 78 / 838 Tel:+86-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: 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. 79 / 838 Tel:+86-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: Power Modes

    No interrupt waiting, CPU external interrupt line exits returns from ISR STOP0 CPU deep sleep mode: WFI/WFE: wake: Nations Technologies Inc. 80 / 838 Tel:+86-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 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. 81 / 838 Tel:+86-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 Sleep VBAT Wakeup Wakeup Wakeup capability capability capability BKPOR/PDR HCLK HCLK (O) (O) Flash SRAM R-SRAM Backup Registers Nations Technologies Inc. 82 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 83 RTC / Auto wakeup Number of RTC Tamper pins USART1/2/3 UART4/5/6/7 I2C1/2/3/4 SPI1/2/3 CAN1/2 ETH MAC QSPI SDMMC OPAMP COMP Nations Technologies Inc. 83 / 838 Tel:+86-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: Sleep Mode

    SLEEP-ON-EXIT: If SCB_SCR.SLEEPONEXIT = 1, the system immediately enters sleep mode when exiting from the lowest priority ISR. Nations Technologies Inc. 84 / 838 Tel:+86-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: Stop0 Mode

    Internal RC oscillator (LSI RC): can be turned on by register RCC_CTRLSTS.LSIEN bit  External 32.768kHz crystal oscillator (LSE OSC): can be turned on by register RCC_BDCTRL.LSEEN. Nations Technologies Inc. 85 / 838 Tel:+86-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: Stop2 Mode

    When the STOP2 mode is exited by generating an interrupt or a wake-up event, the HSI RC oscillator is selected as the system clock, and the code execution will continue from where it stopped. Nations Technologies Inc. 86 / 838 Tel:+86-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: Standby Mode

    External 32.768kHz crystal oscillator (LSE OSC) optional: It can be turned on by RCC_BDCTRL.LSEEN bit.  R-SRAM data retention, which can be turned on by register PWR_CTRL2.SR2STBRET. Nations Technologies Inc. 87 / 838 Tel:+86-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: Low-Power Auto-Wakeup(Awu)Mode

    Table 4-3 PWR register overview Offset Register PWR_CTRL PRS[2:0] 000h Reserved Reset Value PWR_CTRLSTS 004h Reserved Reserved Reset Value Nations Technologies Inc. 88 / 838 Tel:+86-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: Power Control Register (Pwr_Ctrl)

    When the MSB bit is 1, the threshold is as follows: register(4bits) Voltage 1000 1.78v 1001 1.88v 1010 1.98v 1011 2.08v 1100 3.06v 1101 3.24v Nations Technologies Inc. 89 / 838 Tel:+86-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: Power Control Status Register(Pwr_Ctrlsts)

    4.4.3 Power control status register(PWR_CTRLSTS) Address offset: 0x04 Reset value: 0x0000 0000 (not cleared when waking up from standby mode) Nations Technologies Inc. 90 / 838 Tel:+86-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: Power Control Register 2 (Pwr_Ctrl2)

    WKUPEN bit) when the WKUP pin is already high. 4.4.4 Power control register 2 (PWR_CTRL2) Address offset: 0x08 Nations Technologies Inc. 91 / 838 Tel:+86-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: Power Control Register 3 (Pwr_Ctrl3)

    Address offset: 0x0C Reset value: 0x0000 5B70 Bit field Name Description 31:1 Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 92 / 838 Tel:+86-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 Bit field Name Description EXMODE Extended mode control bits. 0: Normal mode 1: Extended mode Nations Technologies Inc. 93 / 838 Tel:+86-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: Backup Registers (Bkp)

    TAMPER pin. Therefore, the TAMPER pin should be connected to the correct level off-chip. Nations Technologies Inc. 94 / 838 Tel:+86-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: 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. 95 / 838 Tel:+86-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 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. 96 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 97: Backup 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. 97 / 838 Tel:+86-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: 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. 98 / 838 Tel:+86-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 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. 99 / 838 Tel:+86-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: Reset And Clock Control (Rcc)

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

    The backup domain has two dedicated resets that only affect the backup domain (see Figure 4-1 Power Supply Block Diagram). Nations Technologies Inc. 101 / 838 Tel:+86-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: 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. 102 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 103: Clock Tree Diagram

    The high-speed external clock signal (HSE) can be generated from the following two clock sources:  HSE external crystal/ceramic resonator Nations Technologies Inc. 103 / 838 Tel:+86-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: Hsi Clock

    If the user application is subject to voltage or temperature variations, this may affect the accuracy of the RC oscillator. Nations Technologies Inc. 104 / 838 Tel:+86-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: Pll Clock

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

    HSI oscillator and the disabling of the external HSE oscillator. If HSE clock (divided or not) is selected as PLL input Nations Technologies Inc. 106 / 838 Tel:+86-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: Rtc Clock

    The clock selection is controlled by RCC_CFG.MCO[2:0] bits. RCC Registers The RCC registers are accessible through AHB bus. The register description is as follows. Nations Technologies Inc. 107 / 838 Tel:+86-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: Rcc Register Overview

    Reset Value RCC_AHBPRST 028h Reserved Reserved Reset Value ADCHPRES RCC_CFG2 RNGCPRES[4:0] ADC1MPRES[4:0] ADCPLLPRES[4:0] 02Ch Reserved [3:0] Reset Value Nations Technologies Inc. 108 / 838 Tel:+86-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: Clock Control Register (Rcc_Ctrl)

    Set by hardware once HSE is ready. This bit takes 6 HSE clock cycles to clear after the HSEEN bit is cleared. Nations Technologies Inc. 109 / 838 Tel:+86-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: Clock Configuration Register (Rcc_Cfg)

    6.3.3 Clock Configuration Register (RCC_CFG) Address offset: 0x04 Reset value: 0x2000 0000 Bit Field Name Description 31:28 MCOPRES[3:0] MCO prescaler Nations Technologies Inc. 110 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 111 PLL is disabled. The PLL output frequency must not exceed 144MHz. 00000: PLL input clock × 2 Nations Technologies Inc. 111 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 112 0: HSI clock divided by 2 is used as the PLL input clock 1: HSE clock selected as PLL input clock 15:14 Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 112 / 838 Tel:+86-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 00: Select HSI as system clock 01: Select HSE as system clock 10: Select PLL output as system clock 11: Unavailable Nations Technologies Inc. 113 / 838 Tel:+86-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: Clock Interrupt Register (Rcc_Clkint)

    PLL ready interrupt enable Set and cleared by software to enable and disable PLL ready interrupt 0: Disable PLL ready interrupt Nations Technologies Inc. 114 / 838 Tel:+86-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 This bit is cleared by the software by setting the LSERDICLR bit. 0: No clock ready interrupt caused by LSE oscillator 1: Clock ready interrupt caused by LSE oscillator Nations Technologies Inc. 115 / 838 Tel:+86-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 Reset Register (Rcc_Apb2Prst)

    1: Reset DVP Reserved Reserved, the reset value must be maintained. USART1RST USART1 reset Set and cleared by software. Nations Technologies Inc. 116 / 838 Tel:+86-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 1: Reset GPIO port B IOPAMPRST GPIO port A reset. Set or cleared by software. 0: Clear the reset Nations Technologies Inc. 117 / 838 Tel:+86-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 Reset Register (Rcc_Apb1Prst)

    0: Clear the reset 1: Reset CAN1 Reserved Reserved, the reset value must be maintained. USBRST USB reset. Nations Technologies Inc. 118 / 838 Tel:+86-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: Clear the reset 1: Reset window watchdog 10:6 Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 119 / 838 Tel:+86-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: Ahb Peripheral Clock Enable Register (Rcc_Ahbpclken)

    Reserved, the reset value must be maintained. QSPIEN QSPI clock enable Set and cleared by software. 0: QSPI clock disabled 1: QSPI clock enabled Nations Technologies Inc. 120 / 838 Tel:+86-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 0: Disable the clock of the flash interface circuit 1: Enable the clock of the flash interface circuit Nations Technologies Inc. 121 / 838 Tel:+86-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: Apb2 Peripheral Clock Enable Register (Rcc_Apb2Pclken)

    Set and cleared by software. 0: UART7 clock disabled 1: UART7 clock enabled UART6EN UART6 clock enable Set and cleared by software. Nations Technologies Inc. 122 / 838 Tel:+86-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 0: IO Port D clock disabled 1: IO Port D clock enabled IOPCEN IO Port C clock enable Set and cleared by software. Nations Technologies Inc. 123 / 838 Tel:+86-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: Apb1 Peripheral Clock Enable Register (Rcc_Apb1Pclken)

    Power interface clock enable Set and cleared by software. 0: Power interface clock disabled 1: Power interface clock enable Nations Technologies Inc. 124 / 838 Tel:+86-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 Set and cleared by software. 0: USART2 clock disabled 1: USART2 clock enabled Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 125 / 838 Tel:+86-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 TIM3EN TIM3 timer clock enable Set and cleared by software. 0: TIM3 clock disabled 1: TIM3 clock enabled Nations Technologies Inc. 126 / 838 Tel:+86-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: Backup Domain Control Register (Rcc_Bdctrl)

    0: LSE oscillator not bypassed 1: LSE oscillator bypassed LSERD External low-speed clock oscillator ready Nations Technologies Inc. 127 / 838 Tel:+86-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: Clock Control/Status Register (Rcc_Ctrlsts)

    0: No independent watchdog reset occurred 1: Independent watchdog reset occurred SFTRSTF Software reset flag Set by hardware when a software reset occurs. Nations Technologies Inc. 128 / 838 Tel:+86-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 MSI frequency range selection. A total of 7 frequencies are available for software selection 000: 100kHz 001: 200kHz Nations Technologies Inc. 129 / 838 Tel:+86-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: Ahb Peripheral Reset Register (Rcc_Ahbprst)

    1: Reset ETHMAC ADC4RST ADC4 reset Set and cleared by software. 0: Clear the reset 1: Reset ADC4 Nations Technologies Inc. 130 / 838 Tel:+86-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: Clock Configuration Register 2 (Rcc_Cfg2)

    PCLK2 × 2 is selected. 1: SYSCLK input clock is selected as TIM1/8 clock source. 28:24 RNGCPRES[4:0] RNGC prescaler. Nations Technologies Inc. 131 / 838 Tel:+86-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 11010: PLL clock divided by 128 11011: PLL clock divided by 256 Others: PLL clock divided by 256 ADCHPRES[3:0] ADC HCLK prescaler Nations Technologies Inc. 132 / 838 Tel:+86-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: Clock Configuration Register 3 (Rcc_Cfg3)

    0010x: TRNG 1M clock source divided by 6 0011x: TRNG 1M clock source divided by 8 0100x: TRNG 1M clock source divided by 10 Nations Technologies Inc. 133 / 838 Tel:+86-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 Set and cleared by software. 0: Disable BOR reset 1: Enable BOR reset Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 134 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 135: Gpio And Afio

    8-bit byte access is not allowed). The figure below shows the basic structure of an I/O port. Nations Technologies Inc. 135 / 838 Tel:+86-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: I/O Function 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. 136 / 838 Tel:+86-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: 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. 137 / 838 Tel:+86-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: 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. 138 / 838 Tel:+86-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: 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. 139 / 838 Tel:+86-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: Figure 7-4 Alternate Function Configuration

    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. 140 / 838 Tel:+86-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: 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. 141 / 838 Tel:+86-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: 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. 142 / 838 Tel:+86-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 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. 143 / 838 Tel:+86-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 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. 144 / 838 Tel:+86-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: 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. 145 / 838 Tel:+86-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-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. 146 / 838 Tel:+86-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-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_CH1 TIM3_CH2 TIM3_CH3 TIM3_CH4 Nations Technologies Inc. 147 / 838 Tel:+86-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: 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. 148 / 838 Tel:+86-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: Table 7-19 Can2 Alternate Function Remapping

    Table 7-21 USART1 alternate function remapping Alternate function USART1_RMP = 0 USART1_RMP = 1 USART1_CTS PA11 USART1_RTS PA12 USART1_TX USART1_RX PA10 USART1_CK Nations Technologies Inc. 149 / 838 Tel:+86-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: Table 7-22 Usart2 Alternate Function Remapping

    Table 7-26 UART6 alternate function remapping Alternate function UART6_RMP[1:0] = 00 UART6_RMP[1:0] = 10 UART6_RMP[1:0] = 11 UART6_TX UART6_RX Nations Technologies Inc. 150 / 838 Tel:+86-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: Table 7-27 Uart7 Alternate Function Remapping

    Table 7-31 I2C4 pin remapping Alternate function I2C4_RMP[1:0] = 00 I2C4_RMP[1:0] = 01 I2C4_RMP[1:0] = 11 I2C4_SCL PD14 I2C4_SDA PD15 PA10 Nations Technologies Inc. 151 / 838 Tel:+86-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: Table 7-32 Spi1 Pin Remapping

    Alternate function SDIO_RMP = 0 SDIO_RMP = 1 SDIO_0 SDIO_1 SDIO_2 PC10 PE10 SDIO_3 PC11 PE11 SDIO_4 SDIO_5 SDIO_6 Nations Technologies Inc. 152 / 838 Tel:+86-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: Table 7-36 Qspi Pin Remapping

    ETH_MII_RX_CLK ETH_MII_REF_CLK ETH_MII_MDIO ETH_RMII_MDIO ETH_MII_COL ETH_MII_RX_DV ETH_RMII_CRS_DV ETH_MII_RXD0 ETH_RMII_RXD0 ETH_MII_RXD1 PD10 PD10 ETH_RMII_RXD1 ETH_MII_RXD2 PD11 ETH_RMII_RXD2 ETH_MII_RXD3 PD12 Nations Technologies Inc. 153 / 838 Tel:+86-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: I/O Configuration Of Peripherals

    Input capture Input floating channel x TIM2/3/4/5_CHx Output channel x Push-pull alternate output TIM2/3/4/5_ETR External trigger Input floating Nations Technologies Inc. 154 / 838 Tel:+86-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: Table 7-41 Bxcan

    Table 7-44 I2C I2C pin Description GPIO configuration I2Cx_SCL I2C clock Open-drain alternate output I2Cx_SDA I2C data Open-drain alternate Nations Technologies Inc. 155 / 838 Tel:+86-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: Table 7-45 Spi

    Input floating or pull-up input or input pull-down Master mode Push-pull alternate output I2Sx_MCK Slave mode Unused, can be used as general I/O. Nations Technologies Inc. 156 / 838 Tel:+86-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: Table 7-47 Sdio

    ETH_RMII_CRS_DV ETH_MII_RXD0 Input floating (reset state) ETH_RMII_RXD0 ETH_MII_RXD1 Input floating (reset state) ETH_RMII_RXD1 ETH_MII_RXD2 Input floating (reset state) Nations Technologies Inc. 157 / 838 Tel:+86-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: Gpio Locking Mechanism

    Refer to the port configuration lock register GPIOx_PLOCK_CFG.  PLOCKK_CFG is GPIOx_PLOCK_CFG[16], which will become 1 only after the PLOCKK_CFG is operated Nations Technologies Inc. 158 / 838 Tel:+86-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: Gpio Registers

    GPIOC base address: 0x40011000 GPIOD base address: 0x40011400 GPIOE base address: 0x40011800 GPIOF base address: 0x40011C00 GPIOG base address: 0x40012000 Nations Technologies Inc. 159 / 838 Tel:+86-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: 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, F, G); 0x0008 0800 (x=B) Nations Technologies Inc. 160 / 838 Tel:+86-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: 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. 161 / 838 Tel:+86-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: 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,F,G) Nations Technologies Inc. 162 / 838 Tel:+86-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: 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. 163 / 838 Tel:+86-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: 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. 164 / 838 Tel:+86-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: 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. 165 / 838 Tel:+86-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 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. 166 / 838 Tel:+86-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: 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. 167 / 838 Tel:+86-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 0: ADC1 injection conversion external trigger is connected to EXTI15 1: ADC1 injection conversion external trigger is connected to TIM8_CH4 Nations Technologies Inc. 168 / 838 Tel:+86-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 11: Full image (CH1/PC6, CH2/PC7, CH3/PC8, CH4/PC9). Note: Remapping does not affect TIM3_ETR on PD2. TIM2_RMP[1:0] Remapping of Timer 2 Nations Technologies Inc. 169 / 838 Tel:+86-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 This bit can be set to '1' or set to '0' by software to control the image of I2C1's SCL and SDA alternate functions on the GPIO port. Nations Technologies Inc. 170 / 838 Tel:+86-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: Afio External Interrupt Configuration Register 1(Afio_Exti_Cfg1)

    0000: PA3 pin 0001: PB3 pin 0010: PC3 pin 0011: PD3 pin 0100: PE3 pin 0101: PF3 pin Nations Technologies Inc. 171 / 838 Tel:+86-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: Afio External Interrupt Configuration Register 2(Afio_Exti_Cfg2)

    0101: Reserved 0110: Reserved 7.4.6 AFIO external interrupt configuration register 3(AFIO_EXTI_CFG3) Address offset: 0x10 Reset value: 0x0000 0000 Nations Technologies Inc. 172 / 838 Tel:+86-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: Afio External Interrupt Configuration Register 4(Afio_Exti_Cfg4)

    EXTIx_CFG[3:0] These bits can be read and written by software and used to select the input source of Nations Technologies Inc. 173 / 838 Tel:+86-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: Afio Alternate Remapping Configuration Register 3(Afio_Rmp_Cfg3)

    11: Partial image (ETR/PB4, CH1/PD14, CH2/PD15, CH3/PC8, CH4/PC9, BKIN/PB3, CH1N/PA15, CH2N/PC12, CH3N/PD2). 29:28 Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 174 / 838 Tel:+86-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 SPI1_RMP_0 to form SPI1_RMP[1:0] to control the image of NSS, SCK, MISO and MOSI alternate functions of SPI1 on the GPIO port. 00: No remapping (NSS/PA4, SCK/PA5, MISO/PA6, MOSI/PA7); Nations Technologies Inc. 175 / 838 Tel:+86-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 SCL alternate functions on the GPIO port. 00: No remapping (SCL/PC0, SDA/PC1); 01: Unused combination; 10: Remapping (SCL/PF4, SDA/PF5); 11: Remapping (SCL/PA4, SDA/PC5). Nations Technologies Inc. 176 / 838 Tel:+86-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: Afio Alternate Remap Configuration Register 4 (Afio_ Rmp_Cfg4 )

    Reserved, the reset value must be maintained. QSPI_MISO The IO1 pin of QSPI is equivalent to MISO in standard single-wire mode, and the Nations Technologies Inc. 177 / 838 Tel:+86-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 ADC3 injection conversion external trigger remapping This bit can be set to '1' or '0' by software. It controls the trigger input connected Nations Technologies Inc. 178 / 838 Tel:+86-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 This bit can be set to '1' or '0' by software. 00: No remapping (COMP1_OUT/PA0); 01: Remapping (COMP1_OUT/PB1); Nations Technologies Inc. 179 / 838 Tel:+86-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: Afio Alternate Remapping Configuration Register 5(Afio_Rmp_Cfg5)

    EMC GBN1 detection enable bit. 0: Disable 1: Enable ECLAMP4_DET_EN EMC CLAMP4 detection enable bit for VDD_4. 0: Disable Nations Technologies Inc. 180 / 838 Tel:+86-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 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. 0: Disable Nations Technologies Inc. 181 / 838 Tel:+86-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 Description 1: Enable ECLAMP1_RST_EN When EMC CLAMP1 detects, the system resets the enable bit. 0: Disable 1: Enable Nations Technologies Inc. 182 / 838 Tel:+86-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: Dma Controller

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

    Nations Technologies Inc. 184 / 838 Tel:+86-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: 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. 185 / 838 Tel:+86-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: 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. 186 / 838 Tel:+86-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: 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. 187 / 838 Tel:+86-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: 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. 188 / 838 Tel:+86-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: 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. 189 / 838 Tel:+86-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: 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. 190 / 838 Tel:+86-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 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. 191 / 838 Tel:+86-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: 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. 192 / 838 Tel:+86-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: Dma Registers

    Reset Value DMA_CHSEL2 CH_SEL[5:0] 02Ch Reserved Reset Value DMA_CHCFG3 030h Reserved Reset Value DMA_TXNUM3 NDTX[15:0] 034h Reserved Reset Value Nations Technologies Inc. 193 / 838 Tel:+86-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 Reset Value DMA_PADDR8 ADDR[31:0] 09Ch Reset Value DMA_MADDR8 ADDR[31:0] 0A0h Reset Value DMA_CHSEL8 CH_SEL[5:0] 0A4h Reserved Reset Value Nations Technologies Inc. 194 / 838 Tel:+86-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: 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. 195 / 838 Tel:+86-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: 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. 196 / 838 Tel:+86-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 Half transfer interrupt enable. Software can enable/disable half transfer interrupt. 0: Disable half transfer interrupt of channel x. Nations Technologies Inc. 197 / 838 Tel:+86-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: 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. 198 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 199: Dma 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. 199 / 838 Tel:+86-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 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. 200 / 838 Tel:+86-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: Dma2 Channel X Channel Request Select Register (Dma2_Chselx)

    Reserved, the reset value must be maintained. CH_SEL[5:0] DMA2 channel request selection 32:DVP 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 Nations Technologies Inc. 201 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 202: Dma Channel Map Enable Register (Dma_Chmapen)

    Description 31:1 Reserved Reserved, the reset value must be maintained. MAP_EN Channel MAP enable. 0: Disable channel MAP Nations Technologies Inc. 202 / 838 Tel:+86-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 Bit field Name Description 1: Enable channel MAP Nations Technologies Inc. 203 / 838 Tel:+86-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: Analog To Digital Conversion (Adc)

     Support 2 conversion modes.  Single conversion.  Continuous conversion.  Support discontinuous mode.  Support self-calibration. Nations Technologies Inc. 204 / 838 Tel:+86-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: 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. 205 / 838 Tel:+86-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: 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. 206 / 838 Tel:+86-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: 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. 207 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 208: Figure 9-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. 208 / 838 Tel:+86-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 [16] Slow Channel VREF+ [16] VREF- [17] Slow Channel OPAMP2 [17] VREF- [18] Slow Channel REFINT [18] VREF- Nations Technologies Inc. 209 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 210: Figure 9-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. 210 / 838 Tel:+86-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: 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. 211 / 838 Tel:+86-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: 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. 212 / 838 Tel:+86-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: Scanning Mode

    When using this function, the time interval between the injection channel triggers needs to be greater than the time Nations Technologies Inc. 213 / 838 Tel:+86-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: 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. 214 / 838 Tel:+86-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: 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. 215 / 838 Tel:+86-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: 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. 216 / 838 Tel:+86-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: 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. 217 / 838 Tel:+86-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: Dma Requests

    ADC software trigger, the master ADC and the slave ADC external trigger must be Nations Technologies Inc. 218 / 838 Tel:+86-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: 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. 219 / 838 Tel:+86-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: 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. 220 / 838 Tel:+86-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: 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. 221 / 838 Tel:+86-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: 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. 222 / 838 Tel:+86-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: 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. 223 / 838 Tel:+86-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: Mixed Synchronous Regular Mode + Synchronous Injection Mode

    If the interval Nations Technologies Inc. 224 / 838 Tel:+86-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: 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. 225 / 838 Tel:+86-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: Temperature Sensor

    Not suitable for measuring absolute temperature. When accurate temperature measurement is required, an external temperature sensor should be used. Nations Technologies Inc. 226 / 838 Tel:+86-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: 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. 227 / 838 Tel:+86-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 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. 228 / 838 Tel:+86-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 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. 229 / 838 Tel:+86-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 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. 230 / 838 Tel:+86-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 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. 231 / 838 Tel:+86-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 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. 232 / 838 Tel:+86-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: 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. 233 / 838 Tel:+86-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 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. 234 / 838 Tel:+86-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: 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. 235 / 838 Tel:+86-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: 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. 236 / 838 Tel:+86-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: 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. 237 / 838 Tel:+86-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: 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. 238 / 838 Tel:+86-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: 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. 239 / 838 Tel:+86-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: 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. 240 / 838 Tel:+86-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: Adc Calibration Factor (Adc_Calfact)

    ADC, the coefficient will be applied after a new single-ended calibration is initiated. Nations Technologies Inc. 241 / 838 Tel:+86-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: 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. 242 / 838 Tel:+86-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: 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. 243 / 838 Tel:+86-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: 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. 244 / 838 Tel:+86-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: 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. 245 / 838 Tel:+86-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 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. 246 / 838 Tel:+86-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: 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. 247 / 838 Tel:+86-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: Dac Trigger

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

    .The output voltage of DAC is calculated as follows: REF+ DAC output = V X (DATO / 4095). Nations Technologies Inc. 249 / 838 Tel:+86-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: 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. 250 / 838 Tel:+86-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: 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. 251 / 838 Tel:+86-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: 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. 252 / 838 Tel:+86-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: 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. 253 / 838 Tel:+86-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: 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. 254 / 838 Tel:+86-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: 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. 255 / 838 Tel:+86-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: Synchronous Trigger To Generate The Same Triangle Wave

    The added value is transferred to the Nations Technologies Inc. 256 / 838 Tel:+86-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: 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. 257 / 838 Tel:+86-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 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. 258 / 838 Tel:+86-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 100: TIM2 TRGO event; 101: TIM4 TRGO event; 110: External interrupt line 9; 111: Software trigger. T1EN DAC1 trigger on Nations Technologies Inc. 259 / 838 Tel:+86-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: 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. 260 / 838 Tel:+86-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: 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. 261 / 838 Tel:+86-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: Bit Right Aligned Data Hold Register For Dac2 (Dac_Dr12Ch2)

    Retained, 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. 262 / 838 Tel:+86-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: 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. 263 / 838 Tel:+86-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: Bit Right Aligned Data Hold Register For Dual Dac (Dac_Dr8Dch)

    Retained, 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. 264 / 838 Tel:+86-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: Dac2 Data Output Register (Dac_Dato2)

    Retained, 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. 265 / 838 Tel:+86-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: 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. 266 / 838 Tel:+86-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: 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. 267 / 838 Tel:+86-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: Counter Mode

    • The repetition counter reloads the contents of the TIMx_REPCNT • Update auto-reload shadow registers with preload value(TIMx_AR), when TIMx_CTRL1.ARPEN = 1. Nations Technologies Inc. 268 / 838 Tel:+86-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-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. 269 / 838 Tel:+86-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 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. 270 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 271: Figure 11-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. 271 / 838 Tel:+86-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: 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. 272 / 838 Tel:+86-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: Repetition Counter

    This means that data is transferred from the preload registers to the shadow registers every N+1 counter overflow or Nations Technologies Inc. 273 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 274: Figure 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. 274 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 275: Figure 11-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. 275 / 838 Tel:+86-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: 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. 276 / 838 Tel:+86-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-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. 277 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 278: Figure 11-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. 278 / 838 Tel:+86-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: 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. 279 / 838 Tel:+86-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: 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. 280 / 838 Tel:+86-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-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. 281 / 838 Tel:+86-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: 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. 282 / 838 Tel:+86-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: 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. 283 / 838 Tel:+86-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: Forced Output Mode

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

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

    User should not modified TIMx_CTRL1.DIR by software, it is updated by hardware. Nations Technologies Inc. 286 / 838 Tel:+86-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: 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. 287 / 838 Tel:+86-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: 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. 288 / 838 Tel:+86-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: 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. 289 / 838 Tel:+86-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: 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. 290 / 838 Tel:+86-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: 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. 291 / 838 Tel:+86-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: 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. 292 / 838 Tel:+86-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: 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. 293 / 838 Tel:+86-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: 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. 294 / 838 Tel:+86-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: Debug Mode

    Counter register 60 61 62 63 64 65 66 00 01 02 03 01 02 03 UDGN TITF Nations Technologies Inc. 295 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 296: Figure 11-28 Control Circuit In Trigger Mode

    The delay between the rising edge on TI1 and the actual stop of the counter is due to the resynchronization circuit on Nations Technologies Inc. 296 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 297: Figure 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. 297 / 838 Tel:+86-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: 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. 298 / 838 Tel:+86-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: 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. 299 / 838 Tel:+86-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-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. 300 / 838 Tel:+86-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: 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. 301 / 838 Tel:+86-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: 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. 302 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 303: Figure 11-34 Example Of Hall Sensor Interface

    Interfacing timer Counter(CNT) (CCDAT2) CCDAT1 TRGO=OC2REF Advanced-control timers(TIM1&TIM8) OC1N OC2N OC3N Write CCxEN、CCxNEN and OCxMD for next step Nations Technologies Inc. 303 / 838 Tel:+86-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: 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. 304 / 838 Tel:+86-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: 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. 305 / 838 Tel:+86-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 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. 306 / 838 Tel:+86-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 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. 307 / 838 Tel:+86-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: 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. 308 / 838 Tel:+86-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: 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. 309 / 838 Tel:+86-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 0: No action 1: Events on the trigger input (TRGI) are delayed to allow a perfect synchronization between the Nations Technologies Inc. 310 / 838 Tel:+86-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: 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. 311 / 838 Tel:+86-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: 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. 312 / 838 Tel:+86-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: 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. 313 / 838 Tel:+86-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 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. 314 / 838 Tel:+86-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: 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. 315 / 838 Tel:+86-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 Mode Register 1 (Timx_Ccmod1)

    Output compare mode: Nations Technologies Inc. 316 / 838 Tel:+86-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 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. 317 / 838 Tel:+86-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 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. 318 / 838 Tel:+86-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 TIMx_SMCTRL.TSEL. Note: CC1SEL is writable only when the channel is off (TIMx_CCEN.CC1EN = 0). Nations Technologies Inc. 319 / 838 Tel:+86-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 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. 320 / 838 Tel:+86-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 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. 321 / 838 Tel:+86-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 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. 322 / 838 Tel:+86-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: 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. 323 / 838 Tel:+86-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: 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. 324 / 838 Tel:+86-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: 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. 325 / 838 Tel:+86-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: 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. 326 / 838 Tel:+86-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: 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. 327 / 838 Tel:+86-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 Lock Configuration These bits offer a write protection against software errors. – No write protected. – LOCK Level 1 Nations Technologies Inc. 328 / 838 Tel:+86-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: 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. 329 / 838 Tel:+86-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: 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. 330 / 838 Tel:+86-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: 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. 331 / 838 Tel:+86-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: 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. 332 / 838 Tel:+86-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: 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. 333 / 838 Tel:+86-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: General-Purpose Timers Description

    The TIMx_PSC register consists of a 16-bit counter that can be used to divide the counter clock frequency by any Nations Technologies Inc. 334 / 838 Tel:+86-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: Counter Mode

    To avoid updating the shadow registers when new values are written to the preload registers, you can disable the update by setting TIMx_CTRL1.UPDIS=1. Nations Technologies Inc. 335 / 838 Tel:+86-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: 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. 336 / 838 Tel:+86-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: Figure 12-4 Timing Diagram Of The Up-Counting, Update Event When Arpen=0/1

    Counter overflow Update event(UEV) Update interrupt flag(UDITF) Auto-reload preload register Write a new value in TIMx_AR Auto-reload shadow register Nations Technologies Inc. 337 / 838 Tel:+86-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: 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. 338 / 838 Tel:+86-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: 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. 339 / 838 Tel:+86-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: Clock Selection

    12.3.3 Clock selection  The internal clock of timers :CK_INT  Two kinds of external clock mode : Nations Technologies Inc. 340 / 838 Tel:+86-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-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. 341 / 838 Tel:+86-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-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. 342 / 838 Tel:+86-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: 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. 343 / 838 Tel:+86-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: 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. 344 / 838 Tel:+86-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: 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. 345 / 838 Tel:+86-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-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. 346 / 838 Tel:+86-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: Input Capture Mode

    Define the sampling frequency of the TI1 input and the length of the digital filter by configuring the Nations Technologies Inc. 347 / 838 Tel:+86-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: 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. 348 / 838 Tel:+86-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: 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. 349 / 838 Tel:+86-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 Otherwise the TIMx_CCDATx shadow register will be updated at the next update event. Here is an example. Nations Technologies Inc. 350 / 838 Tel:+86-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: 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. 351 / 838 Tel:+86-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: 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. 352 / 838 Tel:+86-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: 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. 353 / 838 Tel:+86-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: 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. 354 / 838 Tel:+86-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: 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. 355 / 838 Tel:+86-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: 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. 356 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 357: Figure 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. 357 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 358: Figure 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. 358 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 359: Figure 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. 359 / 838 Tel:+86-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: 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. 360 / 838 Tel:+86-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: 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. 361 / 838 Tel:+86-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: 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. 362 / 838 Tel:+86-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: 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. 363 / 838 Tel:+86-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 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. 364 / 838 Tel:+86-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: 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. 365 / 838 Tel:+86-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 1: If update interrupt or DMA request is enabled, only counter overflow/underflow will generate update interrupt or DMA request Nations Technologies Inc. 366 / 838 Tel:+86-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: 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. 367 / 838 Tel:+86-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: 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. 368 / 838 Tel:+86-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 (via TRGO) and its slaves. This is useful when several timers are required to be synchronized to a single external event. Nations Technologies Inc. 369 / 838 Tel:+86-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: 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. 370 / 838 Tel:+86-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: 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. 371 / 838 Tel:+86-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: 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. 372 / 838 Tel:+86-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: 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. 373 / 838 Tel:+86-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: Capture/Compare Mode Register 1 (Timx_Ccmod1)

    ICx describes the function of a channel in input mode. Hence, Nations Technologies Inc. 374 / 838 Tel:+86-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 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. 375 / 838 Tel:+86-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 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. 376 / 838 Tel:+86-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: 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. 377 / 838 Tel:+86-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 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. 378 / 838 Tel:+86-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: 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. 379 / 838 Tel:+86-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: 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. 380 / 838 Tel:+86-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: 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. 381 / 838 Tel:+86-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: 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. 382 / 838 Tel:+86-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: 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. 383 / 838 Tel:+86-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: 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. 384 / 838 Tel:+86-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 For the fourth time, DMA access to the TIMx_ DADDR register will be mapped to access TIMx_CCDAT4 register; Nations Technologies Inc. 385 / 838 Tel:+86-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: Basic Timers (Tim6 And Tim7)

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

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

    The figure below shows some examples of the counter behavior and the update flags for different division factors in the up-counting mode. Nations Technologies Inc. 388 / 838 Tel:+86-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: 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. 389 / 838 Tel:+86-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: 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. 390 / 838 Tel:+86-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: 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. 391 / 838 Tel:+86-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: 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. 392 / 838 Tel:+86-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: 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. 393 / 838 Tel:+86-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: 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. 394 / 838 Tel:+86-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: 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. 395 / 838 Tel:+86-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: Counter (Timx_Cnt)

    PSC + 1. 13.4.9 Automatic reload register (TIMx_AR) Offset address: 0x2C Reset values: 0xFFFF Nations Technologies Inc. 396 / 838 Tel:+86-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 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. 397 / 838 Tel:+86-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: Real-Time Clock (Rtc)

    SLEEP, STOP0 ,STOP2 and STANDBY modes. Nations Technologies Inc. 398 / 838 Tel:+86-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: Rtc Function Description

     Timestamp event/interrupt  RTC output functions  256 Hz or 1Hz clock output (LSE frequency is 32.768 kHz). Nations Technologies Inc. 399 / 838 Tel:+86-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: 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. 400 / 838 Tel:+86-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: 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. 401 / 838 Tel:+86-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: 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. 402 / 838 Tel:+86-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: 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. 403 / 838 Tel:+86-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: 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. 404 / 838 Tel:+86-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 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. 405 / 838 Tel:+86-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 Low Power Mode

    Normal work when the clock source of RTC is LSE Alarm A, Alarm B, Periodic Wakeup, Tamper STANDBY or LSI event and Timestamp event Nations Technologies Inc. 406 / 838 Tel:+86-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 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. 407 / 838 Tel:+86-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 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. 408 / 838 Tel:+86-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 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. 409 / 838 Tel:+86-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 1: Enable Alarm A Reserved Reserved, the reset value must be maintained HFMT Hour format bit 0: 24 hour format Nations Technologies Inc. 410 / 838 Tel:+86-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: 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. 411 / 838 Tel:+86-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 This flag is set to ‘1’ by hardware as soon as a shift operation is initiated by a write to Nations Technologies Inc. 412 / 838 Tel:+86-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: 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. 413 / 838 Tel:+86-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: 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. 414 / 838 Tel:+86-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: 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. 415 / 838 Tel:+86-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: 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. 416 / 838 Tel:+86-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: 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. 417 / 838 Tel:+86-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: 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. 418 / 838 Tel:+86-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: 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. 419 / 838 Tel:+86-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: 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. 420 / 838 Tel:+86-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: 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. 421 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 422 Reserved, the reset value must be maintained TYPE RTC_ALARM output type on PC13 0: Open-drain output 1: Push-pull output Nations Technologies Inc. 422 / 838 Tel:+86-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: 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. 423 / 838 Tel:+86-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: Function Description

    If the initial value needs to be set, the LRC register should be configured first. Nations Technologies Inc. 424 / 838 Tel:+86-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: 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. 425 / 838 Tel:+86-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: 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. 426 / 838 Tel:+86-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: 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. 427 / 838 Tel:+86-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: 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. 428 / 838 Tel:+86-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: Independent Watchdog (Iwdg)

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

    Pre-scale register and reload register controls the time that generates reset, as shown in Table 16-1. Nations Technologies Inc. 431 / 838 Tel:+86-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: 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. 432 / 838 Tel:+86-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: 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. 433 / 838 Tel:+86-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: 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. 434 / 838 Tel:+86-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: 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. 435 / 838 Tel:+86-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: 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. 436 / 838 Tel:+86-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: Timing For Refresh Watchdog And Interrupt Generation

    Table 17-1 (assuming APB1 clock 36 MHz) with calculate equation: Nations Technologies Inc. 437 / 838 Tel:+86-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: 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. 438 / 838 Tel:+86-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: 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. 439 / 838 Tel:+86-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: 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. 440 / 838 Tel:+86-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: 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. 441 / 838 Tel:+86-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: Sdio Bus Topology

    Each transmission type is shown in the following figure: Nations Technologies Inc. 442 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 443: Figure 18-1 Sdio "No Response" And "No Data" Operations

    SDIO_DATA The data flow Data read operation 数据停止操作 Data stop operation Nations Technologies Inc. 443 / 838 Tel:+86-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 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. 444 / 838 Tel:+86-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: 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. 445 / 838 Tel:+86-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: Table 18-1 Mmc/Sd/Sd I/O Card Bus Pin Definition

    (8 clock cycles after the command channel and data channel subunits enter the idle phase). Nations Technologies Inc. 446 / 838 Tel:+86-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: Figure 18-8 Control 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. 447 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 448: Figure 18-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. 448 / 838 Tel:+86-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 (Send) state, which will trigger the data counter to stop sending function of the command. Nations Technologies Inc. 449 / 838 Tel:+86-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: Table 18-2 Command Channel Status Flags

    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. 450 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 451: Figure 18-12 Data Channel

    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. 451 / 838 Tel:+86-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: 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. 452 / 838 Tel:+86-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: 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. 453 / 838 Tel:+86-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: 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. 454 / 838 Tel:+86-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: 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. 455 / 838 Tel:+86-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: 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. 456 / 838 Tel:+86-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: 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. 457 / 838 Tel:+86-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: Write Data Block

    SDIO_DAT signal line low. Nations Technologies Inc. 458 / 838 Tel:+86-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: 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. 459 / 838 Tel:+86-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 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. 460 / 838 Tel:+86-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: 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. 461 / 838 Tel:+86-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: Table 18-6 Lock/Unlock Data Structure

    Bit4 Bit3 Bit2 Bit1 Bit0 Reserved (Remains at 0) ERASE LOCK_UNLOCK CLR_PWD SET_PWD PWDS_LEN Password Data (PWD) …… Nations Technologies Inc. 462 / 838 Tel:+86-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 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. 463 / 838 Tel:+86-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 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. 464 / 838 Tel:+86-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: Card Status Register

    Nations Technologies Inc. 465 / 838 Tel:+86-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 An attempt was made to reverse the copy or permanent write protection, i.e. restore or release write protection. Nations Technologies Inc. 466 / 838 Tel:+86-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 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. 467 / 838 Tel:+86-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-8 Sd Status

    (each Card bit can be used to '0001'= SD ROM Card define a different SD type). The Nations Technologies Inc. 468 / 838 Tel:+86-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 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. 469 / 838 Tel:+86-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: 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. 470 / 838 Tel:+86-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: 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. 471 / 838 Tel:+86-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: Sd I/O Mode

    Nations Technologies Inc. 472 / 838 Tel:+86-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: 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. 473 / 838 Tel:+86-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: 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. 474 / 838 Tel:+86-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: 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. 475 / 838 Tel:+86-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: 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. 476 / 838 Tel:+86-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: 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. 477 / 838 Tel:+86-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: 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. 478 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 479: Table 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. 479 / 838 Tel:+86-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: Table 18-29 R4B Response

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

    AHB bus. Note that these peripheral registers must be manipulated in word (32 bits). Nations Technologies Inc. 481 / 838 Tel:+86-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: 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. 482 / 838 Tel:+86-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: 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. 483 / 838 Tel:+86-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 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. 484 / 838 Tel:+86-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 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. 485 / 838 Tel:+86-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: 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. 486 / 838 Tel:+86-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: 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. 487 / 838 Tel:+86-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: 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. 488 / 838 Tel:+86-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 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. 489 / 838 Tel:+86-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: 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. 490 / 838 Tel:+86-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: 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. 491 / 838 Tel:+86-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: 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. 492 / 838 Tel:+86-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 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. 493 / 838 Tel:+86-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 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. 494 / 838 Tel:+86-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: 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. 495 / 838 Tel:+86-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: 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. 496 / 838 Tel:+86-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: Universal Serial Bus Full-Speed Device Interface (Usb_Fs_Device)

    Register mapper Packet Buffer Memory APB1 bus Packet Buffer Interface Arbiter USB Clock Region PCLK1 Clock Region Nations Technologies Inc. 497 / 838 Tel:+86-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: Clock Configuration

    The USB module accesses the Packet Buffer Memory in 16-bit mode, refer to Figure 19-2. When the USB module Nations Technologies Inc. 498 / 838 Tel:+86-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: Buffer Description Table

    Endpoint packet buffers for unused endpoints or in the unused direction of a used endpoint may be used for other purposes. The relationship between the buffer description table and the endpoint packet buffer is shown in Figure Nations Technologies Inc. 499 / 838 Tel:+86-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: Double-Buffered Endpoints

    USB device can process the data packet and reply to the PC host Nations Technologies Inc. 500 / 838 Tel:+86-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: Table 19-1 Dattog And Sw_Buf Definitions

    If you want to use double-buffered bulk endpoints, you can set them up as follows:  Set USB_EPn.EP_TYPE = 00, define the endpoint as a bulk endpoint Nations Technologies Inc. 501 / 838 Tel:+86-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 ADDR3_RX_0/CNT3_RX_0, and the application can process the buffer1 corresponding to ADDR3_RX_1/CNT3_RX_1. As shown in Figure 19-4 below. Nations Technologies Inc. 502 / 838 Tel:+86-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: Usb Transfer

    The process of one time receiving or sending data on the USB is called a transaction, and there are three types of transactions: Setup transaction, Data IN transaction, and Data OUT transaction. Nations Technologies Inc. 503 / 838 Tel:+86-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 After the USB device receives the PID OUT or SETUP token packet sent by the host, the USB processing flow for OUT or SETUP is as follows: Nations Technologies Inc. 504 / 838 Tel:+86-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 Rx direction status of the USB device endpoint to VALID, and the Tx Nations Technologies Inc. 505 / 838 Tel:+86-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 SETUP token packet, and will not reply any handshake packet to the host, forcing the host to send the SETUP token packet again. Nations Technologies Inc. 506 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 507: Figure 19-5 Control Transfer

    USB host will allocate the required bandwidth for the endpoint in Nations Technologies Inc. 507 / 838 Tel:+86-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: Usb Events And Interrupts

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

    Table 19-4 Resume event detection [USB_FN.RXDP_STS, USB_FN.RXDM_STS] Wake-up event Software operation Root reset None Nations Technologies Inc. 509 / 838 Tel:+86-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: Endpoint Initialization

    USB registers The peripheral registers can be accessed by half-words (16-bit) or words (32-bit). USB base address: 0x4000 5C00 Nations Technologies Inc. 510 / 838 Tel:+86-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: Usb Register Overview

    Reset Value USB_STS EP_ID[3:0] 044h Reserved Reset Value USB_FN FN[10:0] 048h Reserved Reset Value 04Ch USB_ADDR Reserved ADDR[6:0] Nations Technologies Inc. 511 / 838 Tel:+86-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: Usb Endpoint N Register (Usb_Epn), N=[0

    Hardware sets this bit to the NAK state when a correct OUT or SETUP transaction completes. Note: Nations Technologies Inc. 512 / 838 Tel:+86-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 2、 Control endpoint, the hardware will set this bit after the USB module correctly receives the PID SETUP token packet. Nations Technologies Inc. 513 / 838 Tel:+86-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: Usb Control Register (Usb_Ctrl)

    VALID: endpoints can be used to send 19.5.3 USB control register (USB_CTRL) Address offset: 0x40 Reset value: 0x0000 0003 Nations Technologies Inc. 514 / 838 Tel:+86-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 7:5 Reserved Reserved, the reset value must be maintained. RESUM Resume request 0: No resume request Nations Technologies Inc. 515 / 838 Tel:+86-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: Usb Interrupt Status Register (Usb_Sts)

    When USB_CTRL.FRST = 1, the USB module will remain in reset state until software clears this bit. 19.5.4 USB interrupt status register (USB_STS) Address offset: 0x44 Reset value: 0x0000 0000 Nations Technologies Inc. 516 / 838 Tel:+86-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 、 After the USB is reset, the hardware will immediately enable the detection of the Nations Technologies Inc. 517 / 838 Tel:+86-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 (the lower the endpoint number, the higher the priority). Nations Technologies Inc. 518 / 838 Tel:+86-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: Usb Frame Number Register (Usb_Fn)

    Hardware increments this bit every time the USB module receives a PID SOF token packet. 19.5.6 USB device address register (USB_ADDR) Address offset: 0x4C Reset value: 0x0000 0000 Nations Technologies Inc. 519 / 838 Tel:+86-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: Usb Packet Buffer Description Table Address Register (Usb_Buftab)

    32 bits, the data packet buffer memory addresses use 32-bit aligned addresses, not the addresses used by the USB_BUFTAB register and the buffer description table. Nations Technologies Inc. 520 / 838 Tel:+86-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: Send Buffer Address Register N (Usb_Addrn_Tx)

    Address offset: [USB_ BUFTAB] + n× 16 + 8 USB local address: [USB_ BUFTAB] + n× 8 + 4 Nations Technologies Inc. 521 / 838 Tel:+86-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: Receive Data Byte Number Register N (Usb_Cntn_Rx)

    BLSIZE = 1 00000 Not allowed 32 bytes 00001 2 bytes 64 bytes 00010 4 bytes 96 bytes Nations Technologies Inc. 522 / 838 Tel:+86-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 The size of the endpoint packet receive buffer is defined during the device enumeration process and is defined by the wMaxPacketSize field of the standard endpoint descriptor in the USB 2.0 protocol specification. Nations Technologies Inc. 523 / 838 Tel:+86-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: Controller Area Network (Can)

    A total of 14 filter groups(each CAN module has its own)  Configurable FIFO overrun handling method  Time stamp function for recording the time of receiving SOF Nations Technologies Inc. 524 / 838 Tel:+86-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: Can Overall Introduction

    Initialization, normal and sleep mode are three main working modes of CAN. The internal pull-up resistor of CANTX pin is activated after hardware reset, and CAN works in sleep mode to reduce power consumption. Nations Technologies Inc. 525 / 838 Tel:+86-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 When the CAN_MCTRL.AWKUM bit is set(enable hardware wake up automatically), once the activity of the CAN bus is detected, the hardware will automatically clear the CAN_MSTS.SLPRQ bit to wake up CAN. Nations Technologies Inc. 526 / 838 Tel:+86-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: 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. 527 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 528: Figure 20-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. 528 / 838 Tel:+86-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: 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. 529 / 838 Tel:+86-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: Figure 20-5 Silent Mode

    To enter loopback silence mode, both the CAN_BTIM.SLM bit and the CAN_BTIM.LBM bit should be set. Figure 20-6 loopback silent mode CAN-CTRL transceiver CAN_Bus Nations Technologies Inc. 530 / 838 Tel:+86-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: 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. 531 / 838 Tel:+86-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: Time Triggered Communication Mode

    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. 532 / 838 Tel:+86-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: Receiving Management

    Please refer to 20.4.5 Section: identifier filtering. Nations Technologies Inc. 533 / 838 Tel:+86-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-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. 534 / 838 Tel:+86-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: 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. 535 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 536: Figure 20-9 Filter Bit Width Setting-Register Organization

    The filter ID is used to store the identifier format, and the filter MASK is used to indicate which bits must be checked and which bits can be ignored. Identifier list mode Nations Technologies Inc. 536 / 838 Tel:+86-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: Table 20-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. 537 / 838 Tel:+86-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: 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. 538 / 838 Tel:+86-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: 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. 539 / 838 Tel:+86-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-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. 540 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 541: Figure 20-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. 541 / 838 Tel:+86-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: 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. 542 / 838 Tel:+86-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: Error Management

    CAN configuration flow can divided into serval phases. Nations Technologies Inc. 543 / 838 Tel:+86-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 For Reception: User can also change a filter value (CAN_FiRx) when the corresponding filter is deactivated. To deactivate Nations Technologies Inc. 544 / 838 Tel:+86-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: 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. 545 / 838 Tel:+86-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: 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. 546 / 838 Tel:+86-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 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. 547 / 838 Tel:+86-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 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. 548 / 838 Tel:+86-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 Offset Register CAN_F13B1 FBC[31:0] 2A8h Reset Value CAN_F13B2 FBC[31:0] 2ACh Reset Value Nations Technologies Inc. 549 / 838 Tel:+86-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: Can Control And Status Register

    Notes: For more information about bus-off status, please refer to 20.5.1: Error management. Nations Technologies Inc. 550 / 838 Tel:+86-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 CAN activity (sending or receiving) is over, the hardware sets the CAN_MSTS.INIAK bit and CAN enters initialization mode. Nations Technologies Inc. 551 / 838 Tel:+86-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 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. 552 / 838 Tel:+86-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 Transmit mailbox 2 empty When there is no message waiting to be sent in mailbox 2, hardware sets this bit. Nations Technologies Inc. 553 / 838 Tel:+86-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 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. 554 / 838 Tel:+86-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 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. 555 / 838 Tel:+86-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 Release FIFO 1 output mailbox. The software releases the output mailbox of the receive FIFO by setting this bit. If Nations Technologies Inc. 556 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 557 0: 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. 557 / 838 Tel:+86-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 Notes: Please refer to 20.5 Section CAN interrupt. CAN error status register (CAN_ESTS) Address offset: 0x18 Reset value: 0x0000 0000 Nations Technologies Inc. 558 / 838 Tel:+86-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 (The value of the receiving error counter or the sending error counter is > 127). Nations Technologies Inc. 559 / 838 Tel:+86-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 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. 560 / 838 Tel:+86-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: 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. 561 / 838 Tel:+86-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 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. 562 / 838 Tel:+86-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 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. 563 / 838 Tel:+86-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 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. 564 / 838 Tel:+86-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 Data byte 5 Data byte 5 of the message. DATA4[7:0] Data byte 4 Data byte 4 of the message. Nations Technologies Inc. 565 / 838 Tel:+86-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: 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. 566 / 838 Tel:+86-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 1: the filter is associated to FIFO1. CAN filter activation register (CAN_FA1) Address offset: 0x21C Reset value: 0x0000 0000 Nations Technologies Inc. 567 / 838 Tel:+86-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 Notes: According to the different settings of filter bit width and mode, the functions of the two registers in the filter Nations Technologies Inc. 568 / 838 Tel:+86-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 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 20-4. Nations Technologies Inc. 569 / 838 Tel:+86-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: 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. 570 / 838 Tel:+86-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: 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. 571 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 572: Figure 21-2 Selective Management Of Hardware/Software

    Figure 21-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. 572 / 838 Tel:+86-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: Figure 21-3 Master And Slave Applications

    Figure 21-4 is the combination timing of four CLKPHA and CLKPOL bits transmitted by SPI when the SPI_CTRL1.LSBFF = 0. Nations Technologies Inc. 573 / 838 Tel:+86-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: Spi Work Mode

    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. 574 / 838 Tel:+86-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-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. 575 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 576: Figure 21-6 Schematic Diagram Of Te/Busy Change When The Host Transmits Continuously In One-Way Only Mode

    Figure 21-7 Schematic diagram of RNE change when continuous transmission occurs in receive-only mode (BIDIRMODE = 0 and Nations Technologies Inc. 576 / 838 Tel:+86-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 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. 577 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 578: Figure 21-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. 578 / 838 Tel:+86-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 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. 579 / 838 Tel:+86-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: Status Flag

    After reading the SPI_DAT register, the hardware will set this flag to 0. BUSY flag bit (BUSY) Nations Technologies Inc. 580 / 838 Tel:+86-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: 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. 581 / 838 Tel:+86-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: 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. 582 / 838 Tel:+86-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: 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. 583 / 838 Tel:+86-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: Error Flag

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

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

    (MSB) is sent and will change on the falling edge of the clock signal. Nations Technologies Inc. 586 / 838 Tel:+86-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: Figure 21-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. 587 / 838 Tel:+86-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 (MSB) are generated simultaneously. The standard data receiving and sending processing mode is the same as I S Philips standard. Nations Technologies Inc. 588 / 838 Tel:+86-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: Figure 21-17 The Msb Is Aligned With 16-Bit Or 32-Bit Full Precision, Clkpol = 0

    Figure 21-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. 589 / 838 Tel:+86-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: Figure 21-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. 590 / 838 Tel:+86-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: Figure 21-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. 591 / 838 Tel:+86-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: 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. 592 / 838 Tel:+86-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: Figure 21-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. 593 / 838 Tel:+86-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: 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. 594 / 838 Tel:+86-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 When I2S function is turned off, different audio standards, data length and channel length adopt different operation steps: Nations Technologies Inc. 595 / 838 Tel:+86-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: 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. 596 / 838 Tel:+86-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: 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. 597 / 838 Tel:+86-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: Spi And I S Register

    BIDIRMODE Bidirectional data mode enable 0: Select the "two-wire one-way" mode. 1: Select the "one-wire bidirectional " mode. Nations Technologies Inc. 598 / 838 Tel:+86-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 0: Disable software slave device management. 1: Enable software slave device management. Note: Not used in I S mode. Nations Technologies Inc. 599 / 838 Tel:+86-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 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. 600 / 838 Tel:+86-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: Spi Control Register 2 (Spi_Ctrl2)

    0: Disable receive buffer DMA. 1: Enable receive buffer DMA. 21.5.4 SPI status register (SPI_STS) Address: 0x08 Reset value: 0x0002 Nations Technologies Inc. 601 / 838 Tel:+86-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 Receive buffer is not empty 0: The receive buffer is empty. 1: The receive buffer is not empty. Nations Technologies Inc. 602 / 838 Tel:+86-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: Spi Data Register (Spi_Dat)

    21.5.7 SPI RX CRC register (SPI_CRCRDAT) (not used in I S mode) Address offset: 0x14 Reset value: 0x0000 Nations Technologies Inc. 603 / 838 Tel:+86-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: Spi Tx Crc Register(Spi_Crctdat

    Note: not used in I s mode. 21.5.9 SPI_ I S configuration register(SPI_I2SCFG) Address offset: 0x1c Reset value: 0x0000 Nations Technologies Inc. 604 / 838 Tel:+86-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 Length of data to be transmitted 00: 16-bit data length. 01: 24-bit data length; 10: 32-bit data length; Nations Technologies Inc. 605 / 838 Tel:+86-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: 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. 606 / 838 Tel:+86-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: 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. 607 / 838 Tel:+86-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: Software Communication Process

    The block diagram of I C interface is shown in the figure below. Nations Technologies Inc. 608 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 609: Figure 22-1 I 2 C Functional Block Diagram

    SDA line when SCL is high. as shown in the figure below. Figure 22-2 I2C bus protocol Start Stop condition condition Nations Technologies Inc. 609 / 838 Tel:+86-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 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. 610 / 838 Tel:+86-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 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. 611 / 838 Tel:+86-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-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. 612 / 838 Tel:+86-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-4 Slave Receiver Transfer Sequence Diagram

    When the START condition is generated on the Nations Technologies Inc. 613 / 838 Tel:+86-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 The I2C_STS1.TXDATE bit will be set after the penultimate byte is sent, and will be cleared when the stop bit (STOP) is sent. Nations Technologies Inc. 614 / 838 Tel:+86-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: Figure 22-5 Master Transmitter Transfer Sequence Diagram

    I2C timing is output. After enabling and configuring, I2C runs in slave mode by default, waiting Nations Technologies Inc. 615 / 838 Tel:+86-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 SCL and SDA lines; the master device can send a stop/restart condition. Nations Technologies Inc. 616 / 838 Tel:+86-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: Figure 22-6 Master Receiver Transfer Sequence Diagram

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

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

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

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

    Device identification On the SMBus, as a slave have a only address for any device, named slave address. Nations Technologies Inc. 621 / 838 Tel:+86-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 When more than one device’s SMBALERT is low, the highest priority(The smaller the address, the higher the priority) Nations Technologies Inc. 622 / 838 Tel:+86-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: Debug Mode

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

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

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

    I2C_STS1.BSF = 1 with no I2C_STS1.TXDATE or I2C_STS1.RXDATNE event I2C_STS1.TXDATE = 1 if I2C_CTRL2.BUFINTEN = 1 I2C_STS1.RXDATNE = 1 if I2C_CTRL2.BUFINTEN = 1 Nations Technologies Inc. 627 / 838 Tel:+86-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: I2C Own Address Register 1 (I2C_Oaddr1)

    Note: don't care these bits in 7-bit address mode ADDR[7:1] Interface address 7~1 bits of the address. ADDR0 Interface address Nations Technologies Inc. 628 / 838 Tel:+86-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: I2C Own Address Register 2 (I2C_Oaddr2)

    I2C Status register 1 (I2C_STS1) 22.6.7 Address offset: 0x14 Nations Technologies Inc. 629 / 838 Tel:+86-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 Writing ‘0’ to this bit by software can clear it, or it is cleared by hardware when I2C_CTRL1.EN=0. 0: No acknowledge failed; Nations Technologies Inc. 630 / 838 Tel:+86-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 I2C_CTRL1.EN=0, the hardware will clear this bit. 0: No stop condition is detected; 1: Stop condition is detected. Nations Technologies Inc. 631 / 838 Tel:+86-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 After the STS1 register is read by software, writing to the data register will clear this bit, or when I2C_CTRL1.EN=0, the hardware will clear this bit. 0: Start condition was not sent; Nations Technologies Inc. 632 / 838 Tel:+86-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: I2C Status Register 2 (I2C_Sts2)

    At the end of the whole address transmission stage, this bit is set according to the R/W bit of Nations Technologies Inc. 633 / 838 Tel:+86-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: I2C Clock Control Register (I2C_Clkctrl)

    Tlow = CLKCTRL× T PCLK1 Thigh = CLKCTRL× T PCLK1  If duty cycle = Tlow/Thigh = 2/1: Nations Technologies Inc. 634 / 838 Tel:+86-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: 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. 635 / 838 Tel:+86-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: Universal Synchronous Asynchronous Receiver Transmitter (Usart)

    LIN break frame detection, noise flag/overflow error/frame error in multi-buffer communication Nations Technologies Inc. 636 / 838 Tel:+86-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: 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. 637 / 838 Tel:+86-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: Usart Frame Format

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

    Receiving in Smartcard mode General USART mode, single-wire mode and modem mode. Transmitting and receiving in Smartcard mode Nations Technologies Inc. 639 / 838 Tel:+86-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: Figure 23-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. 640 / 838 Tel:+86-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: Receiver

    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. 641 / 838 Tel:+86-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: Figure 23-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. 642 / 838 Tel:+86-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 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. 643 / 838 Tel:+86-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: Generation Of Fractional Baud Rate

    PCLK  PCLK1 is used for USART2, USART3, UART4, UART5, up to 36MHz; Nations Technologies Inc. 644 / 838 Tel:+86-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: Table 23-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. 645 / 838 Tel:+86-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: 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 23-6 Frame format WL bit PCEN bit USART frame Nations Technologies Inc. 646 / 838 Tel:+86-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: 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. 647 / 838 Tel:+86-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: Figure 23-7 Transmission Using Dma

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

    Figure 23-9 hardware flow control between two USART DEVICE 1 DEVICE 2 TX control RX control RX control TX control Nations Technologies Inc. 649 / 838 Tel:+86-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: Figure 23-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. 650 / 838 Tel:+86-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: Multiprocessor Communication

    As shown in the Figure 23-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. 651 / 838 Tel:+86-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: Figure 23-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. 652 / 838 Tel:+86-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: 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. 653 / 838 Tel:+86-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: Figure 23-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. 654 / 838 Tel:+86-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: Single-Wire Half-Duplex Mode

    Communication conflicts are managed by software. Nations Technologies Inc. 655 / 838 Tel:+86-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: 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. 656 / 838 Tel:+86-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: 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. 657 / 838 Tel:+86-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 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. 658 / 838 Tel:+86-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: Figure 23-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. 659 / 838 Tel:+86-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: 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. 660 / 838 Tel:+86-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: Figure 23-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. 661 / 838 Tel:+86-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: Interrupt Request

    RXDNEIEN Data overrun error detected. ORERR IDLEF Idle line detected IDLEIEN Parity error PEIEN Disconnect flag LINBDF LINBDIEN Nations Technologies Inc. 662 / 838 Tel:+86-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: 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. 663 / 838 Tel:+86-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: 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. 664 / 838 Tel:+86-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 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. 665 / 838 Tel:+86-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: 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. 666 / 838 Tel:+86-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: Usart Baud Rate Register (Usart_Brcf)

    Software can set or clear this bit. 0:USART is disabled. Nations Technologies Inc. 667 / 838 Tel:+86-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 RXEN Receiver enable 0: The receiver is disabled. 1: the receiver is enabled. RCVWU The receiver wakes up Nations Technologies Inc. 668 / 838 Tel:+86-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: 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. 669 / 838 Tel:+86-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: Usart Control Register 3 Register (Usart_Ctrl3)

    USART will be awakened. 23.7.7 USART control register 3 register (USART_CTRL3) Address offset : 0x14 Reset value : 0x0000 0000 Nations Technologies Inc. 670 / 838 Tel:+86-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 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. 671 / 838 Tel:+86-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: 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. 672 / 838 Tel:+86-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 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. 673 / 838 Tel:+86-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: 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. 674 / 838 Tel:+86-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: 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. 675 / 838 Tel:+86-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: 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. 676 / 838 Tel:+86-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: 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. 677 / 838 Tel:+86-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 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. 678 / 838 Tel:+86-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: 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. 679 / 838 Tel:+86-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 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. 680 / 838 Tel:+86-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: 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. 681 / 838 Tel:+86-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 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. 682 / 838 Tel:+86-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: 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. 683 / 838 Tel:+86-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 1: Toggles one cycle after activation of the select line and captures data on the second edge of the serial clock. Nations Technologies Inc. 684 / 838 Tel:+86-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: 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 24.6.4 QSPI Enable Register (QSPI_EN) Address offset: 0x08 Reset value: 0x0000 0000 Nations Technologies Inc. 685 / 838 Tel:+86-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: Qspi Microwire Control Register (Qspi_Mw_Ctrl)

    24.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. 686 / 838 Tel:+86-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: Qspi Baud Rate Select Register (Qspi_Baud)

    2 and 65534. 24.6.8 QSPI Transmit FIFO Threshold Level Register (QSPI_TXFT) Address offset: 0x18 Reset value: 0x0000 0000 Nations Technologies Inc. 687 / 838 Tel:+86-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: Qspi Receive Fifo Threshold Level Register (Qspi_Rxft)

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

    RXFNE Receive FIFO Not Empty. 0: Receive FIFO is empty Nations Technologies Inc. 689 / 838 Tel:+86-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: 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. 690 / 838 Tel:+86-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: 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. 691 / 838 Tel:+86-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: 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. 692 / 838 Tel:+86-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: Qspi Transmit Fifo Overflow Interrupt Clear Register (Qspi_Txfoi_Clr)

    After reading this register, clear the Rx FIFO overflow interrupt status. 24.6.18 QSPI Receive FIFO Underflow Interrupt Clear Register (QSPI_RXFUI_CLR) Address offset: 0x40 Reset value: 0x0000 0000 Nations Technologies Inc. 693 / 838 Tel:+86-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: 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. 694 / 838 Tel:+86-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: Qspi Dma Control Register (Qspi_Dma_Ctrl)

    DMA Transmit Data Level. 24.6.23 QSPI DMA Receive Data Level Register (QSPI_DMARDL_CTRL) Address offset: 0x54 Reset value: 0x0000 0000 Nations Technologies Inc. 695 / 838 Tel:+86-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: 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. 696 / 838 Tel:+86-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: 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. 697 / 838 Tel:+86-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: Qspi Ddr Transmit Drive Edge Register (Qspi_Ddr_Txde)

    = QSPI_BAUD/2 - 1. 24.6.28 QSPI XIP Mode bits Register (QSPI_XIP_MODE) Address offset: 0xFC Nations Technologies Inc. 698 / 838 Tel:+86-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: 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. 699 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 700: 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. 700 / 838 Tel:+86-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: 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. 701 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 702: Qspi Xip Receive Fifo Overflow Interrupt Clear Register (Qspi_Xip_Rxfoi_Clr)

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

     Support automatic generation of CRC and PAD padding bits when transmit frames, and automatic stripping of CRC/PAD when receive frames  Support programmable frame length (up to 16K bytes) Nations Technologies Inc. 704 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 705  Can configure the corresponding interrupts in various working status  Support polling or fixed priority to arbitrate DMA transmit and receive  PTP main features: Nations Technologies Inc. 705 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 706: Function Block Diagram

    There are two frame formats for the data communication of the MAC compliant with the IEEE 802.3-2008 standard: Nations Technologies Inc. 706 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 707: Pin Configuration (Alternate) Method

    Input floating (reset state) Rx_CLK REF_CLK Input floating (reset state) Push-pull alternate output, high speed MDIO MDIO (50MHz) Nations Technologies Inc. 707 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 708: Smi Interface

    To implement the SMI write operation, the data to be transmitted needs to be written into the ETH_MACMIIDAT Nations Technologies Inc. 708 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 709: Mii Interface

    MII is used for MAC and external PHY interconnection, and supports 10Mbps and 100Mbps data rate transmission modes. Nations Technologies Inc. 709 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 710: Figure 25-4 Mii Interface Signal Line

    This signal does not need to be synchronized with the transmit/receive clock. Nations Technologies Inc. 710 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 711: Rmii Interface

    MII interface requires 16 pins for data and control signals, while the RMII standard reduces the number of pins to 7. Nations Technologies Inc. 711 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 712: Mac Function Description

    Nations Technologies Inc. 712 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 713 The built-in Jabber timer of Ethernet will terminate the transmission of Ethernet frames after more than 2048 bytes Nations Technologies Inc. 713 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 714 MAC transmits a Pause frame with a pause time of 0 to inform the remote site that the local buffer is ready to receive new data frames. Nations Technologies Inc. 714 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 715 The checksum module analyzes and judges the frame type (TCP, UDP or ICMP) according to the IPv4 or IPv6 header (including extension header). The checksum module does not process the frame as follows: Nations Technologies Inc. 715 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 716 If ETH_MACFFLT.HUC is set to 0, unicast filtering can be implemented by using a static physical address; if ETH_MACFFLT.HUC is set to 1, unicast filtering can be implemented by using HASH list. Nations Technologies Inc. 716 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 717 Set ETH_MACFFLT.DAIF to reverse the filtering result of the destination address of unicast and multicast frames, and set ETH_MACFFLT.SAIF to reverse the filtering result of the source address of unicast and multicast Nations Technologies Inc. 717 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 718: Table 25-5 Destination Address Filter Result List

    Fail when perfect/group filter matches, if ETH_MACFFLT.PCF = 0x, drop Pause control frame Fail when HASH filter matches, if ETH_MACFFLT.PCF = 0x, drop Nations Technologies Inc. 718 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 719: Table 25-6 Source Address Filter Result List

    RxFIFO has received a complete frame. If MAC is set to discard all erroneous frames, then DMA will only read out legitimate frames and forward them to application. Nations Technologies Inc. 719 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 720 The calculated checksum value of IPv4 header does not match the content of its checksum field – The data type indicated by Ethernet type field does not match IP header version field Nations Technologies Inc. 720 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 721: Power Management (Pmt)

    Ethernet module when a Magic Packet wake-up frame is received. Any wake-up function is enabled, as long as MAC receives the corresponding wake-up frame, Ethernet module will generate a wake-up interrupt and exit Nations Technologies Inc. 721 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 722: Table 25-7 Remote Wakeup Frame Filter Register Overview

    The minimum allowed value of the offset value is 12, which represents the 13th byte of the frame (the offset value of 0 represents the first byte of the frame).  Filter n CRC-16 Nations Technologies Inc. 722 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 723 Ethernet DMA module by setting ETH_DMAOPMOD.ST and ETH_DMAOPMOD.SR (corresponding to TxDMA and RxDMA respectively) to 0. Nations Technologies Inc. 723 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 724: Ethernet Dma Function Description

    0, which can realize the implicit connection of the descriptor (the ring structure of the Nations Technologies Inc. 724 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 725: Figure 25-8 Two Structures Of Descriptor

    2 bytes (0x2000 0AB0 and 0x2000 0AB1) and the last 2 bytes (0x2000 0AC2 and 0x2000 0AC3) are filled with null data instead. Note: DMA controller will not write any data beyond the defined buffer address. Nations Technologies Inc. 725 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 726 TDES2 and TDES3 are also used to store the lower 32 bits of timestamp and the upper Nations Technologies Inc. 726 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 727: Table 25-8 Transmit Descriptor Overview

    The value of the header length field does not match the received header length  The value of the header version field does not match the value of the frame Nations Technologies Inc. 727 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 728 1: Carrier sense signal of PHY is invalid when frame is transmitted (Carrier signal is not sensed). Late collision. Nations Technologies Inc. 728 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 729 0: No transmission delay has occurred. 1: MAC is delayed and the transmission is delayed.  TDES1: Transmit descriptor word 1 Nations Technologies Inc. 729 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 730 Transmit timestamp enable bit. TTSE This bit is only valid when TDES1.FS is 1. When this bit is 1 and Nations Technologies Inc. 730 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 731 DMA operation of the sender is divided into two cases: non-OSF mode and OSF mode. By default, non-OSF mode Nations Technologies Inc. 731 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 732 TxDMA controller will poll descriptor list until the end of frame is transmitted. If a frame is described by Nations Technologies Inc. 732 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 733 25.4.8.4.2 RxDMA descriptor RxDMA descriptor structure contains four 32-bit words, RDES0, RDES1, RDES2, and RDES3. If IEEE 1588 Nations Technologies Inc. 733 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 734: Table 25-9 Receive Descriptor Overview

    This bit is the logical OR of: RDES0[14]: Descriptor error RDES0[11]: Overflow error RDES0[7]: IP header error RDES0[6]: Late collision Nations Technologies Inc. 734 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 735 IP header bytes for Ethernet frame. Late collision. A late collision indicates that a collision occurred after 64 bytes of data were Nations Technologies Inc. 735 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 736 This bit is also set to 1 when the data length of received Ethernet frame does not match the value of IPv4 or IPv6 packet length field.  RDES1: Receive descriptor word 1 Nations Technologies Inc. 736 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 737 RDES2 will keep the value of the original address.  RDES3: Receive descriptor word 3 Nations Technologies Inc. 737 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 738 If frame transfer is complete or buffer is full, receiving controller will get next receive descriptor from descriptor queue; Nations Technologies Inc. 738 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 739 RxDMA request to access the data bus at the same time, the access priority between TxDMA and RxDMA can be configured by setting these bits of ETH_DMABUSMOD.PR[1:0] level ratio. When ETH_DMABUSMOD.DA is set Nations Technologies Inc. 739 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 740: Precision Time Protocol (Ptp)

    The following diagram illustrates the flow of the fine-tuning algorithm: Nations Technologies Inc. 740 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 741: Figure 25-9 System Time Precision Calibration

    System time initialization process Timestamp function needs to configure ETH_PTPTSCTRL.TSENA to 1 first, and then initialize timestamp counter Nations Technologies Inc. 741 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 742 After ETH module is enabled, PPS output function is automatically turned on, and it is output to PB5/PB6 in different Nations Technologies Inc. 742 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 743: Typical Ethernet Configuration Flow Example

    When receive frame data: View first receive descriptor in descriptor list (the address of descriptor can be obtained through the Nations Technologies Inc. 743 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 744: Ethernet Interrupt

    The registers of this peripheral can be accessed in the form of bytes (8 bits), halfwords (16 bits) and words (32 bits). Nations Technologies Inc. 744 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 745: Eth Register Overview

    Reset Value ETH_MACADDR0LO ADDRLO[31:0] 044h Reset Value ETH_MACADDR1HI MBC[5:0] ADDRHI[15:0] 048h Reserved Reset Value ETH_MACADDR1LO ADDRLO[31:0] 04Ch Reset Value Nations Technologies Inc. 745 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 746 CNT[31:0] 198h Reset Value ETH_MMCRXGUFCNT CNT[31:0] 1C4h Reset Value ETH_PTPTSCTRL 700h Reserved Reset Value 704h ETH_PTPSSINC Reserved SSINC[7:0] Nations Technologies Inc. 746 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 747 ETH_DMACHTXDESC ADDR[31:0] 1048h Reset Value ETH_DMACHRXDESC ADDR[31:0] 104Ch Reset Value ETH_DMACHTXBADDR ADDR[31:0] 1050h Reset Value 1054h ETH_DMACHRXBADDR ADDR[31:0] Nations Technologies Inc. 747 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 748: Eth Mac Configuration Register (Eth_Maccfg)

    Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 748 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 749 This bit is only valid in half-duplex mode. 0: Disable MAC deferral check function. MAC will delay sending until the CRS Nations Technologies Inc. 749 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 750: Eth Mac Frame Filter Register (Eth_Macfflt)

    HASH filter or the perfect filter, it is considered that it has passed the receiving address filter. Nations Technologies Inc. 750 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 751 0: MAC will compare the value of the destination address field of the received unicast frame with the set value of the destination address register. Nations Technologies Inc. 751 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 752: Eth Mac Hash List High Register (Eth_Machashhi)

    A 64-bit HASH list can be used for group address filtering. This register contains the lower 32 bits of the multicast HASH list. Bit field Name Description 31:0 HTL[31:0] HASH list low. Nations Technologies Inc. 752 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 753: Eth Mac Mii Address Register (Eth_Macmiiaddr)

    When the PHY is read, the value of the ETH_MACMIIDAT register is valid after the hardware clears this bit. Nations Technologies Inc. 753 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 754: Eth Mac Mii Data Register (Eth_Macmiidat)

    1: When the FIFO layer flow control signal is withdrawn, the automatic generation of the automatic zero-valued PAUSE control frame is turned off. Nations Technologies Inc. 754 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 755 In half-duplex mode, setting this bit to 1 activates the backpressure function. When the backpressure function is valid, if MAC receives a new frame, it will transmit a Nations Technologies Inc. 755 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 756: Eth Mac Vlan Tag Register (Eth_Macvlantag)

    If VLTI[n:0] is not all 0, use VLTI[n:0] for comparison. 25.5.10 ETH MAC remote wakeup frame filter register (ETH_MACRMTWUFRMFLT) Address offset: 0x0028 Nations Technologies Inc. 756 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 757: Eth Mac Pmt Control And Status Register (Eth_Macpmtctrlsts)

    0: No Magic Packet wakeup frame was received. 1: A Magic Packet wakeup frame is received and a wakeup event occurs. Nations Technologies Inc. 757 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 758: Eth Mac Interrupt Status Register (Eth_Macintsts)

    0: ETH_MACINTSTS.MMCTXIS and ETH_MACINTSTS.MMCRXIS are both 0. 1: One of ETH_MACINTSTS.MMCTXIS and ETH_MACINTSTS.MMCRXIS is 1. PMTIS PMT status. Nations Technologies Inc. 758 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 759: Eth Mac Interrupt Mask Register (Eth_Macintmsk)

    Reserved, the reset value must be maintained. 25.5.14 ETH MAC address 0 high register (ETH_MACADDR0HI) Address offset: 0x0040 Reset value: 0x8000 FFFF Nations Technologies Inc. 759 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 760: Eth Mac Address 0 Low Register (Eth_Macaddr0Lo)

    0: MAC address 1 is used to compare with the destination address of the received frame. 1: MAC address 1 is used to compare with the source address of the received frame. Nations Technologies Inc. 760 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 761: Eth Mac Address 1 Low Register (Eth_Macaddr1Lo)

    These bits contain the lower 32 bits of the 6-byte MAC address 1. 25.5.18 ETH MAC address 2 high register (ETH_MACADDR2HI) Address offset: 0x0050 Reset value: 0x0000 FFFF Nations Technologies Inc. 761 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 762: Eth Mac Address 2 Low Register (Eth_Macaddr2Lo)

    These bits contain the lower 32 bits of the 6-byte MAC address 2. 25.5.20 ETH MAC address 3 high register (ETH_MACADDR3HI) Address offset: 0x0058 Reset value: 0x0000 FFFF Nations Technologies Inc. 762 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 763: Eth Mac Address 3 Low Register (Eth_Macaddr3Lo)

    Address offset: 0x005C Reset value: 0xFFFF FFFF Bit field Name Description 31:0 ADDRLO[31:0] MAC address 3 low 32 bits. Nations Technologies Inc. 763 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 764: Eth Mmc Control Register (Eth_Mmcctrl)

    (the highest bit of the counter is set). Reading the MMC counter that generates an interrupt can clear the corresponding interrupt bit (must read the lower 8 bits of the corresponding counter). Nations Technologies Inc. 764 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 765: Eth Mmc Transmit Interrupt Status Register (Eth_Mmctxint)

    0: Transmit "good" frame counter value has not reached half of the maximum value. 1: Transmit "good" frame counter value reaches half of the maximum value. Nations Technologies Inc. 765 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 766: Eth Mmc Receive Interrupt Mask Register (Eth_Mmcrxintmsk)

    1: Mask the interrupt that occurs when ETH_MMCRXINT.RXCRCERFIS is 1. Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 766 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 767: Eth Mmc Transmit Interrupt Mask Register (Eth_Mmctxintmsk)

    This register is used to count the number of frames successfully transmitted after only one collision in half-duplex mode. Nations Technologies Inc. 767 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 768: Eth Mmc Transmitted "Good" Frame Counter Register After More Than 1 Collision

    Bit field Name Description 31:0 CNT[31:0] Transmitted "good" frame counter. These bits are a counter of "good" frame transmitted. Nations Technologies Inc. 768 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 769: Eth Mmc Crc Error Received Frame Counter Register (Eth_Mmcrxfcecnt)

    These bits are a counter of frames with misalignment in the received frame. 25.5.32 ETH MMC receive "good" unicast frame counter register (ETH_MMCRXGUFCNT) Address offset: 0x01C4 Reset value: 0x0000 0000 Nations Technologies Inc. 769 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 770: Eth Ptp Timestamp Control Register (Eth_Ptptsctrl)

    0: System time remains unchanged. 1: Update system time, add or subtract the value of the timestamp high and low Nations Technologies Inc. 770 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 771: Eth Ptp Subsecond Increment Register (Eth_Ptpssinc)

    This register is read-only and contains the second value of the system time. The system time high and low 2 registers Nations Technologies Inc. 771 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 772: Eth Ptp Timestamp Low Register (Eth_Ptpns)

    MAC. These 2 registers should be written first, and then ETH_PTPTSCTRL.TSINIT or ETH_PTPTSCTRL.TSUPDT should be set. Nations Technologies Inc. 772 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 773: Eth Ptp Timestamp Low Update Register (Eth_Ptpnsup)

    The value of this register is accumulated to the 32-bit accumulator every clock cycle, and the system time is updated once the accumulator overflows. Nations Technologies Inc. 773 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 774: Eth Ptp Target Time High Register (Eth_Ptpttsec)

    These bits represent the nanosecond value of the target time. If the timestamp value equals or exceeds the target time, and the corresponding interrupt is enabled, MAC Nations Technologies Inc. 774 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 775: Eth Dma Bus Mode Register (Eth_Dmabusmod)

    001000: The maximum number of data transfers is 8 010000: The maximum number of data transfers is 16 Nations Technologies Inc. 775 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 776 0: No effect 1: Reset the internal registers and logic circuits of all subsystems of ETH. After the Nations Technologies Inc. 776 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 777: Eth Dma Transmit Query Request Register (Eth_Dmatxpd)

    This register is used for RxDMA query of the receive descriptor list. Writing any value to this register enables the receive query. Bit field Name Description 31:0 RPD[31:0] Receive query request bit. Nations Technologies Inc. 777 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 778: Eth Dma Receive Descriptor List Address Register (Eth_Dmarxdladdr)

    Writing to this register is only allowed when transmission is stopped. Before starting the TxDMA transmission process, this register must be configured correctly. Nations Technologies Inc. 778 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 779: Eth Dma Status Register (Eth_Dmasts)

    0: No PMT interrupt event occurred. 1: A PMT interrupt event has occurred. Nations Technologies Inc. 779 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 780 With the corresponding interrupt enabled in the ETH_DMAINTEN register, the normal interrupt summary bits are the logical OR of the following bit values: Nations Technologies Inc. 780 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 781 1: Received frame length exceeds 2048 bytes. RPSS Receive process stop status. 0: Receive process no stop. 1: Receive process enters stop status. Nations Technologies Inc. 781 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 782 When this bit is set to 1, TDES0.OWN of the first descriptor is also set to 1. 0: Frame transmission has not yet been completed. 1: Frame transmission has been completed. Nations Technologies Inc. 782 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 783: Eth Dma Operation Mode Register (Eth_Dmaopmod)

    Writing to this register is not allowed until this bit is 0. 19:17 Reserved Reserved, the reset value must be maintained. Nations Technologies Inc. 783 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 784 Reserved, the reset value must be maintained. RTC[1:0] Receive threshold control. These bits control the threshold of the RxFIFO in cut-through (threshold) mode. Nations Technologies Inc. 784 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 785: Eth Dma Interrupt Enable Register (Eth_Dmainten)

    ETH_DMASTS.NIS or ETH_DMASTS.AIS is set to 1 and the corresponding interrupt is enabled. Nations Technologies Inc. 785 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 786 0: Mask receive buffer unavailable interrupt. 1: When ETH_DMAINTEN.AISE is 1, enable receive buffer unavailable interrupt. Receive interrupt enable. Nations Technologies Inc. 786 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 787: Eth Dma Missed Frames And Buffer Overflow Counter Register (Eth_Dmamfbocnt)

    FIFO overflow counter overflow bit. 27:17 OVFFRMCNT[10:0] Frames missed by application. These bits indicate the number of frames missed by the RxFIFO. Nations Technologies Inc. 787 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 788: Eth Dma Current Transmit Descriptor Address Register (Eth_Dmachtxdesc)

    This register points to the start address (base address) of the receive descriptor that RxDMA is reading. Bit field Name Description 31:0 ADDR[31:0] Receive descriptor address pointer. Nations Technologies Inc. 788 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 789: Eth Dma Current Transmit Buffer Address Register (Eth_Dmachtxbaddr)

    31:0 ADDR[31:0] Receive buffer address pointer. These bits are cleared on reset and updated by RxDMA during operation. Nations Technologies Inc. 789 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 790: 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. 790 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 791: Figure 26-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. 791 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 792: Figure 26-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. 792 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 793: 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. 793 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 794: Comp Working Mode

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

    TIM8_BKIN Other Interrupt COMP supports interrupt response, and COMP1, COMP1, COMP2, COMP3 share one interrupt entry , COMP4, Nations Technologies Inc. 795 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 796: 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. 796 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 797 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. 797 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 798: Comp Control Register (Compx_Ctrl)

    0: Output is low (non-inverting input below inverting input); 1: Output is high (non-inverting input above inverting input). Nations Technologies Inc. 798 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 799: Comp Window Mode Register (Comp_Winmode)

    0: Comparators 5 and 6 are not in window mode; 1: Comparators 5 and 6 are in window mode. Nations Technologies Inc. 799 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 800: Comp Lock Register (Comp_Lock)

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

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

    Name Description 31:14 Reserved Reserved, the reset value must be maintained 13:8 VREF2SET[5:0] VREF2 voltage scaler trim value. Nations Technologies Inc. 802 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 803 0: disable; 1: enable. VREF1SET[5:0] VREF1 voltage scaler trim value. VREF1EN VREF1 voltage scaler: 0: disable; 1: enable. Nations Technologies Inc. 803 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 804: 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. 804 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 805: Figure 27-1 Block Diagram Of Opamp1 And Opamp2 Connection Diagram

    Figure 27-1 Block diagram of OPAMP1 and OPAMP2 connection diagram DAC2/PA5 OPAMP1 ADC1 Channel3 ADC2 Channel3 OPAMP2 Nations Technologies Inc. 805 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 806: 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. 806 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 807: Figure 27-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. 807 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 808: Figure 27-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. 808 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 809: Opamp Working Mode

    OPAMPx_CS. VMSSEL or OPAMPx_CS. VMSEL is connected to the output port from the chip interior. Nations Technologies Inc. 809 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 810: 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. 810 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 811: 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 27-8 Internal gain mode with filter Nations Technologies Inc. 811 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 812: Opamp Calibration

    27.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. 27.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 813: 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. 813 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 814 OPAMP mode selection (Operational amplifier PGA mode) 0x: External zoom mode; 10: Internal PGA enable; 11: Internal follow mode. Nations Technologies Inc. 814 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 815: 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. 815 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 816: Dvp Interface (Dvp)

    DVP_ PCLK DVP_D0 DVP_D1 DVP_D2 DVP_D3 DVP_D4 PF12 PB10 DVP_D5 PF13 PB11 DVP_D6 PF14 PF14 DVP_D7 PF15 PF15 Nations Technologies Inc. 816 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 817: Interface Timing

    Configure the capture enable bit (register DVP_CTRL.CAPTURE), ready to receive data; Turn on the CMOS sensor and start sending data. Nations Technologies Inc. 817 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 818: Dma Application

    5th byte, discard the 6th,7th,8th byte, and so on, until the end of the line. For specific configuration, please refer to the register list. Nations Technologies Inc. 818 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 819: Soft Reset

    It must be ensured that the external CMOS optical sensor clock is turned on first, that is, DVP_PCLK is valid. Nations Technologies Inc. 819 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 820: Dvp Register

    DAT1[7:0] DAT0[7:0] 01Ch Reset Value 28.4.2 DVP Control Register(DVP_CTRL) Address offset : 0x00 Reset value : 0x0000 1000 Nations Technologies Inc. 820 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 821 This bit is used to configure the capture edge of the pixel clock. 0: Capture on falling edge 1: Capture on rising edge VSPOL Vertical sync signal polarity. Nations Technologies Inc. 821 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 822: Dvp Status Register(Dvp_Sts

    Length of data in FIFO. FIFO not empty flag. 0: FIFO is empty 1: There is valid data in the FIFO Nations Technologies Inc. 822 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 823: Dvp Interrupt Status Register(Dvp_Intsts

    Software write 0 to clear. This bit needs to be cleared manually. 0: FIFO is not empty 1: FIFO is empty Nations Technologies Inc. 823 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 824: Dvp Interrupt Enable Register

    VSYNC error interrupt enable. 0: Disable VSYNC error interrupt 1: Enable VSYNC error interrupt FOIE FIFO overflow interrupt enable. Nations Technologies Inc. 824 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 825: Dvp Interrupt Trigger Status Register(Dvp_Mintsts

    Reserved Reserved, the reset value must be maintained. HERRMIS HSYNC error interrupt trigger status. 0: No HSYNC error. Nations Technologies Inc. 825 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 826 Frame start interrupted state. Software write 0 to clear. 0: Frame not started. 1: Frame has started and interrupt triggered. Nations Technologies Inc. 826 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 827: Dvp Image Start Register(Dvp_Wst

    The number of pixels per line, calculated in bytes. 28.4.9 DVP FIFO register(DVP_FIFO) Address offset : 0x1c Reset value : 0x0000 0000 Nations Technologies Inc. 827 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 828 DAT3[7:0] Data byte 3 23:16 DAT2[7:0] Data byte 2 15:8 DAT1[7:0] Data byte 1 DAT0[7:0] Data byte 0 Nations Technologies Inc. 828 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 829: 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. 829 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 830: 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. 830 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 831: 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. 831 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 832: Dbg Registers

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

    1: Freeze the timeout control of SMBUS. CAN1_STOP When the kernel enters the debugging state, CAN1 stops running. Set or cleared by software. Nations Technologies Inc. 833 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 834 HCLK is off. Since sleep mode does not reset the configured clock system, the software does not need to reconfigure the Nations Technologies Inc. 834 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 835 1: (FCLK ON, HCLK ON) In sleep mode, both the FCLK and HCLK clocks are provided by the previously configured system clock. Nations Technologies Inc. 835 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 836: 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 837: Version History

    Version history Date Version Remark 2022.7.8 V3.0 Initial version Nations Technologies Inc. 837 / 838 Tel:+86-755-86309900 Email:info@nationstech.com Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North. Nanshan District, Shenzhen, 518057, P.R.China...
  • Page 838: 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