Holtek HT32F49365 User manual

Type
User manual

This manual is also suitable for

ARM®-based 32-bit Cortex®-M4F MCU + FPU
with 256 to 1024 KB Flash, sLib, USB, 2 CANs,
17 timers, 3 ADCs, 21 communication interfaces MCU
HT32F49365/HT32F49395
User Manual
Revision: V1.00 Date: June 01, 2023
Rev. 1.00 2 of 474 June 01, 2023
32-Bit Arm® Cortex®-M4 MCU
HT32F49365/HT32F49395
Table of Contents
Table of Contents
1 System architecture ............................................................................................. 23
Feature ................................................................................................................................ 25
System overview .................................................................................................................. 26
ARM CortexTM-M4F processor ........................................................................................................ 26
Bit band ........................................................................................................................................... 27
Interrupt and exception vectors ...................................................................................................... 30
System Tick (SysTick) .................................................................................................................... 32
Reset .............................................................................................................................................. 32
List of abbreviations for registers ......................................................................................... 34
Device characteristics information ....................................................................................... 34
Flash memory size register ............................................................................................................. 34
Device electronic signature ............................................................................................................. 35
2 Memory resources ................................................................................................ 36
Internal memory address map ............................................................................................. 36
Flash memory ...................................................................................................................... 37
SRAM memory .................................................................................................................... 38
Peripheral address map ....................................................................................................... 39
3 Power control (PWC) ........................................................................................... 41
Introduction .......................................................................................................................... 41
Main Features ...................................................................................................................... 42
POR/LVR ............................................................................................................................. 42
Power voltage monitor (PVM) .............................................................................................. 42
Power domain ...................................................................................................................... 43
Power saving modes ........................................................................................................... 44
PWC registers ...................................................................................................................... 46
Power control register (PWC_CTRL) .............................................................................................. 46
Power control/status register (PWC_CTRLSTS) ............................................................................ 47
4 Clock and reset manage (CRM) ........................................................................... 48
Clock .................................................................................................................................... 48
Clock sources ................................................................................................................................. 49
System clock ................................................................................................................................... 49
Peripheral clock .............................................................................................................................. 50
Clock fail detector ........................................................................................................................... 50
Auto step-by-step system clock switch ........................................................................................... 50
Internal clock output ........................................................................................................................ 50
Interrupts ......................................................................................................................................... 51
Reset ................................................................................................................................... 51
System reset ................................................................................................................................... 51
Rev. 1.00 3 of 474 June 01, 2023
32-Bit Arm® Cortex®-M4 MCU
HT32F49365/HT32F49395
Table of Contents
Table of Contents
Battery powered domain reset ........................................................................................................ 52
CRM registers ...................................................................................................................... 52
Clock control register (CRM_CTRL) ............................................................................................... 52
Clock conî‚¿guration register (CRM_CFG) ....................................................................................... 54
Clock interrupt register (CRM_CLKINT) ......................................................................................... 56
APB2 peripheral reset register (CRM_APB2RST) .......................................................................... 57
APB1 peripheral reset register (CRM_APB1RST) .......................................................................... 59
APB peripheral clock enable register (CRM_AHBEN) .................................................................... 61
APB2 peripheral clock enable register (CRM_AHB2EN) ................................................................ 62
APB1 peripheral clock enable register (CRM_AHB1EN) ................................................................ 63
Battery powered domain control register (CRM_BPDC) ................................................................ 65
Control/status register (CRM_CTRLSTS) ....................................................................................... 66
AHB peripheral reset register (CRM_AHBRST) ............................................................................. 67
Additional register1 (CRM_MISC1) ................................................................................................ 67
Additional register2 (CRM_MISC2) ................................................................................................ 67
Additional register3 (CRM_MISC3) ................................................................................................ 68
Interrupt map register (CRM_INTMAP) .......................................................................................... 68
5 Flash memory controller (FLASH) ..................................................................... 69
Flash memory introduction .................................................................................................. 69
Flash memory operation ...................................................................................................... 75
Unlock/lock ..................................................................................................................................... 75
Erase operation .............................................................................................................................. 75
Programming operation .................................................................................................................. 78
Read operation ............................................................................................................................... 79
External memory operation .................................................................................................. 80
User system data area operation ......................................................................................... 80
Unlock/lock .................................................................................................................................... 80
Erase operation ............................................................................................................................. 80
Programming operation ................................................................................................................. 81
Read operation ............................................................................................................................... 82
Flash memory protection .................................................................................................... 83
Access protection ........................................................................................................................... 83
Erase/program protection ............................................................................................................... 83
Special functions ................................................................................................................. 84
Security library settings ................................................................................................................... 84
Flash memory registers ...................................................................................................... 85
Flash performance select register (FLASH_PSR) .......................................................................... 86
Flash unlock register (FLASH_UNLOCK) ....................................................................................... 86
Flash user system data unlock register (FLASH_USD_UNLOCK) ................................................. 86
Flash status register (FLASH_STS) ............................................................................................... 86
Flash control register (FLASH_CTRL) ............................................................................................ 87
Flash address register (FLASH_ADDR) ......................................................................................... 87
User system data register (FLASH_USD) ...................................................................................... 88
Rev. 1.00 4 of 474 June 01, 2023
32-Bit Arm® Cortex®-M4 MCU
HT32F49365/HT32F49395
Table of Contents
Erase/program protection status register (FLASH_EPPS) ............................................................. 88
Flash unlock register2 (FLASH_UNLOCK2) ................................................................................... 88
Flash status register2 (FLASH_STS2) ........................................................................................... 88
Flash control register2 (FLASH_CTRL2) ........................................................................................ 89
Flash address register2 (FLASH_ADDR2) ..................................................................................... 90
Flash unlock register3 (FLASH_UNLOCK3) ................................................................................... 90
Flash select register (FLASH_SELECT) ......................................................................................... 90
Flash status register3 (FLASH_STS3) ........................................................................................... 90
Flash control register3 (FLASH_CTRL3) ........................................................................................ 91
Flash address register3 (FLASH_ADDR3) ..................................................................................... 91
Flash decrption address register (FLASH_DA) .............................................................................. 92
Flash security library status register (SLIB_STS0) ......................................................................... 92
Flash security library status register1 (SLIB_STS1) ....................................................................... 92
Flash security library password clear register (SLIB_PWD_CLR) .................................................. 93
Security library additional status register (SLIB_MISC_STS) ......................................................... 93
Security library password setting register (SLIB_SET_PWD) ........................................................ 93
Security library address setting register (SLIB_SET_RANGE) ....................................................... 94
Security library unlock register (SLIB_UNLOCK) ........................................................................... 94
Flash CRC check control register (FLASH_CRC_CTRL) ............................................................... 94
Flash CRC check result register (FLASH_CRC_CHKR) ................................................................ 95
6 General-purpose I/Os (GPIOs) ............................................................................. 96
Introduction .......................................................................................................................... 96
Functional descriptions ........................................................................................................ 96
GPIO structure ................................................................................................................................ 96
GPIO reset status ........................................................................................................................... 97
General-purpose input conî‚¿guration .............................................................................................. 97
Analog input/output conî‚¿guration ................................................................................................... 98
General-purpose output conî‚¿guration ............................................................................................ 98
I/O port protection .......................................................................................................................... 98
GPIO registers ..................................................................................................................... 98
GPIO conî‚¿guration register low (GPIOx_CFGLR) (x = A..E) ......................................................... 99
GPIO conî‚¿guration register high (GPIOx_CFGHR) (x = A..E) ....................................................... 99
GPIO input data register (GPIOx_IDT) (x = A..E) ......................................................................... 100
GPIO output data register (GPIOx_ODT) (x = A..E) ..................................................................... 100
GPIO set/clear register (GPIOx_SCR) (x = A..E) ......................................................................... 100
GPIO clear register (GPIOx_CLR) (x = A..E) ................................................................................ 100
GPIO write protection register (GPIOx_WPR) (x = A..E) .............................................................. 101
GPIO huge current control register (GPIOx_HDRV) (x = A..E) ..................................................... 101
7 Multiplex function I/Os (IOMUX) ........................................................................ 102
Introduction ........................................................................................................................ 102
Functional descriptions ...................................................................................................... 102
IOMUX structure ........................................................................................................................... 102
MUX Input conî‚¿guration ............................................................................................................... 103
Rev. 1.00 5 of 474 June 01, 2023
32-Bit Arm® Cortex®-M4 MCU
HT32F49365/HT32F49395
Table of Contents
Table of Contents
MUX output or bidirectional MUX conî‚¿guration ............................................................................ 103
Peripheral MUX function conî‚¿guration ......................................................................................... 104
IOMUX map priority ...................................................................................................................... 104
External interrupt/wake-up lines ................................................................................................... 105
IOMUX registers ................................................................................................................ 105
Event output control register (IOMUX_EVTOUT) ......................................................................... 106
IOMUX remap register (IOMUX_REMAP) .................................................................................... 107
IOMUX external interrupt conî‚¿guration register1 (IOMUX_EXINTC1) ..........................................110
IOMUX external interrupt conî‚¿guration register2 (IOMUX_EXINTC2) ..........................................111
IOMUX external interrupt conî‚¿guration register3 (IOMUX_EXINTC3) ..........................................112
IOMUX external interrupt conî‚¿guration register4 (IOMUX_EXINTC4) ..........................................113
IOMUX remap register2 (IOMUX_REMAP2) .................................................................................114
IOMUX remap register3 (IOMUX_REMAP3) .................................................................................114
IOMUX remap register4 (IOMUX_REMAP4) .................................................................................115
IOMUX remap register5 (IOMUX_REMAP5) .................................................................................116
IOMUX remap register6 (IOMUX_REMAP6) .................................................................................117
IOMUX remap register7 (IOMUX_REMAP7) .................................................................................118
IOMUX remap register8 (IOMUX_REMAP8) ................................................................................ 120
8 External interrupt/Event controller (EXINT) ........................................................ 121
EXINT introduction ............................................................................................................. 121
Main features ..................................................................................................................... 121
Function descriptions and conî‚¿guration procedure .......................................................... 121
EXINT registers ................................................................................................................. 122
Interrupt enable register (EXINT_INTEN) ..................................................................................... 122
Event enable register (EXINT_EVTEN) ........................................................................................ 123
Polarity conî‚¿guration register1 (EXINT_ POLCFG1) ................................................................... 123
Polarity conî‚¿guration register2 (EXINT_ POLCFG2) ................................................................... 123
Software trigger register (EXINT_ SWTRG) ................................................................................. 123
Interrupt status register (EXINT_ INTSTS) ................................................................................... 124
9 DMA controller (DMA) ......................................................................................... 125
Introduction ........................................................................................................................ 125
Main features ..................................................................................................................... 125
Functional descriptions ...................................................................................................... 126
DMA conî‚¿guration ........................................................................................................................ 126
Handshake mechanism ................................................................................................................ 127
Arbiter ........................................................................................................................................... 127
Programmable data transfer width ................................................................................................ 127
Errors ............................................................................................................................................ 129
Interrupts ....................................................................................................................................... 129
Fixed DMA request mapping ........................................................................................................ 129
Flexible DMA request mapping ..................................................................................................... 130
DMA registers .................................................................................................................... 131
Rev. 1.00 6 of 474 June 01, 2023
32-Bit Arm® Cortex®-M4 MCU
HT32F49365/HT32F49395
Table of Contents
DMA interrupt status register (DMA_STS) .................................................................................... 132
DMA interrupt ag clear register (DMA_CLR) ............................................................................... 134
DMA channelx conguration register (DMA_CxCTRL) (x = 1…7) ................................................ 136
DMA channelx number of data register (DMA_CxDTCNT) (x = 1…7) ......................................... 137
DMA channelx peripheral address register (DMA_CxPADDR) (x = 1…7) .................................... 137
DMA channelx memory address register (DMA_CxMADDR) (x = 1…7) ...................................... 137
Channel source register (DMA_SRC_SEL0) ............................................................................... 138
Channel source register1 (DMA_SRC_SEL1) ............................................................................. 138
10 CRC calculation unit (CRC) ............................................................................. 139
CRC introduction ............................................................................................................... 139
Main features ..................................................................................................................... 139
CRC registers .................................................................................................................... 139
Data register (CRC_DT) ............................................................................................................... 139
Common data register (CRC_CDT) .............................................................................................. 140
Control register (CRC_CTRL) ....................................................................................................... 140
Initialization register (CRC_IDT) ................................................................................................... 140
11 I2C interface ....................................................................................................... 141
I2C introduction .................................................................................................................. 141
Main features ..................................................................................................................... 141
Functional descriptions ...................................................................................................... 141
I2C interface ....................................................................................................................... 142
I2C slave communication ow ....................................................................................................... 144
I2C master communication ow .................................................................................................... 146
Utilize DMA for data transfer ......................................................................................................... 154
SMBus .......................................................................................................................................... 155
I2C interrupt requests .................................................................................................................... 157
I2C debug mode ............................................................................................................................ 158
I2C registers ....................................................................................................................... 158
Control register1 (I2C_CTRL1) ..................................................................................................... 158
Control register2 (I2C_CTRL2) ..................................................................................................... 160
Own address register1 (I2C_OADDR1) ........................................................................................ 161
Own address register2 (I2C_OADDR2) ........................................................................................ 161
Data register (I2C_DT) ................................................................................................................. 161
Status register2 (I2C_STS2) ......................................................................................................... 164
Clock control register (I2C_ CLKCTRL) ........................................................................................ 165
I2C timer rise time register (I2C_TMRISE) .................................................................................... 165
12 Universal synchronous/asynchronous receiver/transmitter (USART) ........ 166
USART introduction ........................................................................................................... 166
Main features ..................................................................................................................... 167
Full-duplex/half-duplex selector ......................................................................................... 168
Mode selector .................................................................................................................... 169
Rev. 1.00 7 of 474 June 01, 2023
32-Bit Arm® Cortex®-M4 MCU
HT32F49365/HT32F49395
Table of Contents
Table of Contents
Introduction ................................................................................................................................... 169
Conî‚¿guration procedure ............................................................................................................... 169
USART frame format and conî‚¿guration ............................................................................ 170
DMA transfer introduction ................................................................................................. 171
Transmission using DMA .............................................................................................................. 171
Reception using DMA ................................................................................................................... 172
Baud rate generation ......................................................................................................... 172
Introduction ................................................................................................................................... 172
Conî‚¿guration ................................................................................................................................ 172
Transmitter ......................................................................................................................... 173
Transmitter introduction ................................................................................................................ 173
Transmitter conî‚¿guration .............................................................................................................. 173
Receiver ............................................................................................................................. 174
Receiver introduction .................................................................................................................... 174
Receiver conî‚¿guration .................................................................................................................. 174
Start bit and noise detection ......................................................................................................... 175
Interrupt requests ............................................................................................................... 176
I/O pin control .................................................................................................................... 177
USART registers ................................................................................................................ 178
Status register (USART_STS) ...................................................................................................... 178
Data register (USART_DT) ........................................................................................................... 179
Baud rate register (USART_BAUDR) ........................................................................................... 179
Control register1 (USART_CTRL1) .............................................................................................. 180
Control register2 (USART_CTRL2) .............................................................................................. 181
Control register3 (USART_CTRL3) .............................................................................................. 182
Guard time and divider register (GDIV) ........................................................................................ 183
13 Serial peripheral interface (SPI) ...................................................................... 184
SPI introduction ................................................................................................................. 184
Functional descriptions ...................................................................................................... 184
SPI description .............................................................................................................................. 184
Full-duplex/half-duplex selector .................................................................................................... 185
Chip select controller .................................................................................................................... 187
SPI_SCK controller ....................................................................................................................... 188
CRC .............................................................................................................................................. 188
DMA transfer ................................................................................................................................. 189
Transmitter .................................................................................................................................... 190
Receiver ........................................................................................................................................ 191
Interrupt ........................................................................................................................................ 192
IO pin control ................................................................................................................................ 192
Precautions ................................................................................................................................... 192
I2S functional description ................................................................................................... 192
I2S introduction ............................................................................................................................. 192
Rev. 1.00 8 of 474 June 01, 2023
32-Bit Arm® Cortex®-M4 MCU
HT32F49365/HT32F49395
Table of Contents
I2S full-duplex ............................................................................................................................... 194
Operation mode selector .............................................................................................................. 194
Audio protocol selector ................................................................................................................. 196
I2S_CLK controller ........................................................................................................................ 197
DMA transfer ................................................................................................................................. 200
Transmitter/Receiver .................................................................................................................... 200
Interrupts ...................................................................................................................................... 202
IO pin control ................................................................................................................................ 202
SPI registers ...................................................................................................................... 202
SPI control register1 (SPI_CTRL1) (Not used in I2S mode) ......................................................... 203
SPI control register2 (SPI_CTRL2) .............................................................................................. 204
SPI status register (SPI_STS) ...................................................................................................... 205
SPI data register (SPI_DT) ........................................................................................................... 206
SPICRC register (SPI_CPOLY) (Not used in I2S mode) ............................................................... 206
SPIRxCRC register (SPI_RCRC) (Not used in I2S mode) ............................................................ 206
SPITxCRC register (SPI_TCRC) ................................................................................................. 206
SPI_I2S register (SPI_I2SCTRL) ................................................................................................. 207
SPI_I2S prescaler register (SPI_I2SCLKP) ................................................................................. 208
14 Timer .................................................................................................................. 209
Basic timer (TMR6 and TMR7) .......................................................................................... 210
TMR6 and TMR7 introduction ....................................................................................................... 210
TMR6 and TMR7 main features ................................................................................................... 210
TMR6 and TMR7 functional descriptions ...................................................................................... 210
TMR6 and TMR7 registers ........................................................................................................... 212
General-purpose timer (TMR2 to TMR5) ........................................................................... 214
TMRx introduction ......................................................................................................................... 214
TMRx main features ..................................................................................................................... 214
TMRx functional descriptions ........................................................................................................ 215
TMRx registers ............................................................................................................................. 228
General-purpose timer (TMR9 to TMR14) ......................................................................... 241
TMRx introduction ......................................................................................................................... 241
TMRx main features ..................................................................................................................... 241
TMRx functional descriptions ........................................................................................................ 242
TMR9 and TMR12 registers ......................................................................................................... 250
TMR10,TMR11, TMR13 and TMR14 registers ............................................................................. 258
Advanced-control timers (TMR1 and TMR8) ..................................................................... 264
TMR1 and TMR8 introduction ....................................................................................................... 264
TMR1 and TMR8 main features ................................................................................................... 264
TMR1 and TMR8 functional descriptions ...................................................................................... 265
TMR1 and TMR8 registers ........................................................................................................... 278
15 Window watchdog timer (WWDT) ................................................................... 295
WWDT introduction ............................................................................................................ 295
Main features ..................................................................................................................... 295
Rev. 1.00 9 of 474 June 01, 2023
32-Bit Arm® Cortex®-M4 MCU
HT32F49365/HT32F49395
Table of Contents
Table of Contents
Functional descriptions ...................................................................................................... 295
Debug mode ...................................................................................................................... 296
WWDT registers................................................................................................................. 296
Control register (WWDT_CTRL) ................................................................................................... 297
Conî‚¿guration register (WWDT_CFG) ........................................................................................... 297
Status register (WWDT_STS) ....................................................................................................... 297
16 Watchdog timer (WDT) ..................................................................................... 298
WDT introduction ............................................................................................................... 298
Main features ..................................................................................................................... 298
Functional descriptions ...................................................................................................... 298
Debug mode ...................................................................................................................... 299
WDT registers .................................................................................................................... 299
Command register (WDT_CMD) .................................................................................................. 300
Divider register (WDT_DIV) .......................................................................................................... 300
Reload register (WDT_RLD) ......................................................................................................... 300
Status register (WDT_STS) .......................................................................................................... 300
17 Real-time clock (RTC) ....................................................................................... 301
RTC introduction ................................................................................................................ 301
Main features ..................................................................................................................... 301
RTC structure..................................................................................................................... 301
Functional descriptions ...................................................................................................... 302
Conî‚¿guring RTC registers ............................................................................................................ 302
Reading RTC registers ................................................................................................................. 303
RTC interrupts .............................................................................................................................. 303
RTC registers ..................................................................................................................... 304
RTC control register high (RTC_CTRLH) ..................................................................................... 305
RTC control register low (RTC_CTRLL) ....................................................................................... 305
RTC divider register (RTC_ DIVH/RTC_DIVL) ............................................................................. 306
RTC divider counter register (RTC_ DIVCNTH/RTC_DIVCNTL) ................................................. 306
RTC counter value register (RTC_CNTH/RTC_CNTL) ................................................................ 306
RTC alarm register (RTC_TAH/RTC_TAL) ................................................................................... 307
18 Battery powered registers (BPR) .................................................................... 308
BPR introduction ................................................................................................................ 308
Main features ..................................................................................................................... 308
Functional descriptions ...................................................................................................... 308
BPR registers ..................................................................................................................... 308
Battery powered data register x (BPR_DTx) (x = 1 … 42) ........................................................... 310
RTC calibration register (BPR_ RTCCAL) ................................................................................... 310
BPR control register (BPR_ CTRL) ..............................................................................................311
BPR control/status register (BPR_ CTRLSTS) .............................................................................311
Rev. 1.00 10 of 474 June 01, 2023
32-Bit Arm® Cortex®-M4 MCU
HT32F49365/HT32F49395
Table of Contents
19 Analog-to-digital converter (ADC) ................................................................... 312
ADC introduction ................................................................................................................ 312
Main features ..................................................................................................................... 312
ADC structure .................................................................................................................... 312
Functional descriptions ...................................................................................................... 314
Channel management .................................................................................................................. 314
ADC operation process ................................................................................................................. 315
Conversion sequence management ............................................................................................. 318
Data management ........................................................................................................................ 320
Voltage monitor ............................................................................................................................. 321
Status ag and interrupts .............................................................................................................. 321
Master/Slave mode ............................................................................................................ 321
Data management ........................................................................................................................ 322
Regular simultaneous mode ......................................................................................................... 322
Alternate preempted trigger mode ................................................................................................ 323
Regular switch mode .................................................................................................................... 324
ADC registers .................................................................................................................... 325
ADC status register (ADC_STS) ................................................................................................... 326
ADC control register1 (ADC_CTRL1) ........................................................................................... 327
ADC control register2 (ADC_CTRL2) ........................................................................................... 329
ADC sampling time register 1 (ADC_SPT1) ................................................................................. 331
ADC sampling time register 2 (ADC_SPT2) ................................................................................. 333
ADC preempted channel data oset register x (ADC_PCDTOx) (x=1..4) .................................... 335
ADC voltage monitor high threshold register (ADC_VWHB) ....................................................... 335
ADC voltage monitor low threshold register (ADC_VWLB) .......................................................... 335
ADC ordinary sequence register 1 (ADC_OSQ1) ......................................................................... 335
ADC ordinary sequence register 2 (ADC_OSQ2) ......................................................................... 335
ADC ordinary sequence register 3 (ADC_OSQ3) ......................................................................... 336
ADC preempted sequence register (ADC_PSQ) .......................................................................... 336
ADC preempted data register x (ADC_PDTx) (x = 1..4) ............................................................... 336
ADC ordinary data register (ADC_ODT) ...................................................................................... 336
20 Digital-to-analog converter (DAC) ................................................................... 337
DAC introduction ................................................................................................................ 337
Main features ..................................................................................................................... 337
Design tips ......................................................................................................................... 337
Functional descriptions ...................................................................................................... 338
Trigger events .............................................................................................................................. 338
Noise/Triangular-wave generation ................................................................................................ 338
DAC data alignment ...................................................................................................................... 340
DAC registers .................................................................................................................... 340
DAC control register (DAC_CTRL) .............................................................................................. 341
DAC software trigger register (DAC_SWTRG) ............................................................................ 343
Rev. 1.00 11 of 474 June 01, 2023
32-Bit Arm® Cortex®-M4 MCU
HT32F49365/HT32F49395
Table of Contents
Table of Contents
DAC1 12-bit right-aligned data holding register (DAC_D1DTH12R) ............................................ 343
DAC1 12-bit left-aligned data holding register (DAC_D1DTH12L) ............................................... 344
DAC1 8-bit right-aligned data holding register (DAC_D1DTH8R) ................................................ 344
DAC2 12-bit right-aligned data holding register (DAC_D2DTH12R) ............................................ 344
DAC2 12-bit left-aligned data holding register (DAC_D2DTH12L) ............................................... 344
DAC2 8-bit right-aligned data holding register (DAC_D2DTH8R) ................................................ 344
Dual DAC 12-bit right-aligned data holding register (DAC_DDTH12R) ........................................ 344
Dual DAC 12-bit left-aligned data holding register (DAC_DDTH12L) ........................................... 344
Dual DAC 8-bit right-aligned data holding register (DAC_DDTH8R) ............................................ 345
DAC1 data output register (DAC_D1ODT) ................................................................................... 345
DAC2 data output register (DAC_D2ODT) ................................................................................... 345
21 CAN .................................................................................................................... 346
CAN introduction ................................................................................................................ 346
Main features ..................................................................................................................... 346
Baud rate ........................................................................................................................... 346
Interrupt management ....................................................................................................... 349
Interrupt management ....................................................................................................... 350
Functional descriptions ...................................................................................................... 350
General description ....................................................................................................................... 350
Operating modes .......................................................................................................................... 351
Test modes ................................................................................................................................... 352
Message î‚¿ltering ........................................................................................................................... 352
Message transmission .................................................................................................................. 355
Message reception ....................................................................................................................... 357
Error management ........................................................................................................................ 358
CAN registers .................................................................................................................... 358
CAN control and status registers .................................................................................................. 360
CAN mailbox registers .................................................................................................................. 372
CAN î‚¿lter registers ........................................................................................................................ 375
22 External memory controller ............................................................................. 378
XMC introduction ............................................................................................................... 378
Main features ..................................................................................................................... 378
XMC architecture ............................................................................................................... 379
Block diagram ............................................................................................................................... 379
Address mapping .......................................................................................................................... 380
NOR/PSRAM ..................................................................................................................... 381
Operation mode ............................................................................................................................ 381
Access mode ................................................................................................................................ 382
NAND ................................................................................................................................. 403
Operation mode ............................................................................................................................ 403
Access timings .............................................................................................................................. 404
ECC computation .......................................................................................................................... 405
Rev. 1.00 12 of 474 June 01, 2023
32-Bit Arm® Cortex®-M4 MCU
HT32F49365/HT32F49395
Table of Contents
XMC registers .................................................................................................................... 406
NOR Flash and PSRAM control registers ..................................................................................... 406
NAND Flash control registers ....................................................................................................... 412
23 SDIO interface ................................................................................................... 416
SDIO introduction .............................................................................................................. 416
Main features ..................................................................................................................... 416
Functional descriptions ...................................................................................................... 419
Card functional description ........................................................................................................... 419
Commands and responses ........................................................................................................... 425
SDIO functional description .......................................................................................................... 431
SDIO I/O card-speciî‚¿c operations ................................................................................................ 437
SDIO registers ................................................................................................................... 439
SDIO power control register (SDIO_ PWRCTRL) ........................................................................ 439
SDIO clock control register (SDIO_ CLKCTRL) ........................................................................... 440
SDIO argument register (SDIO_ARG) .......................................................................................... 441
SDIO command register (SDIO_CMD) ......................................................................................... 441
SDIO command response register (SDIO_RSPCMD) .................................................................. 442
SDIO response 1..4 register (SDIO_RSPx) .................................................................................. 442
SDIO data timer register (SDIO_DTTMR) .................................................................................... 443
SDIO data length register (SDIO_DTLEN) ................................................................................... 443
SDIO data control register (SDIO_DTCTRL) ................................................................................ 443
SDIO data counter register (SDIO_DTCNTR) .............................................................................. 445
SDIO status register (SDIO_STS) ................................................................................................ 445
SDIO clear interrupt register (SDIO_INTCLR) .............................................................................. 446
SDIO interrupt mask register (SDIO_INTEN) ............................................................................... 447
SDIOBUF counter register (SDIO_BUFCNTR) ............................................................................ 449
SDIO data BUF register (SDIO_BUF) .......................................................................................... 449
24 Universal serial bus full-seed device interface (USBFS) .............................. 450
USBFS introduction ........................................................................................................... 450
USBFS clock and pin conî‚¿guration ................................................................................... 450
USB clock conî‚¿guration ................................................................................................................ 450
USB pin conî‚¿guration ................................................................................................................... 450
Functional descriptions ...................................................................................................... 451
USB initialization ........................................................................................................................... 451
Endpoint conî‚¿guration .................................................................................................................. 451
USB buer .................................................................................................................................... 451
Double-buered endpoints ........................................................................................................... 453
SOF output ................................................................................................................................... 454
Suspend/Resume ......................................................................................................................... 454
USBFS interrupts ............................................................................................................... 454
USBFS registers ................................................................................................................ 454
USBFS endpoint n register (USBFS_EPTn), n=[0..7] .................................................................. 455
Rev. 1.00 13 of 474 June 01, 2023
32-Bit Arm® Cortex®-M4 MCU
HT32F49365/HT32F49395
Table of Contents
Table of Contents
USBFS control register (USBFS_CTRL) ...................................................................................... 456
USBFS interrupt status register (USBFS_INTSTS) ...................................................................... 457
USBFS SOF frame number register (USBFS_SOFRNUM) ......................................................... 458
USBFS device address register (USBFS_DEVADDR) ................................................................. 459
USBFS buer table address register (USBFS_BUFTBL) ............................................................. 459
USBFS CFG control register (USBFS_CFG) ............................................................................... 459
USBFS transmission buer rst address register (USBFS_TnADDR) ......................................... 459
USBFS transmission data length register (USBFS_TnLEN) ........................................................ 459
USBFS reception buer rst address register (USBFS_RnADDR) .............................................. 460
USBFS reception data length register (USBFS_RnLEN) ............................................................. 460
25 HICK auto clock calibration (ACC) .................................................................. 461
ACC introduction ................................................................................................................ 461
Main features ..................................................................................................................... 461
Interrupt requests ............................................................................................................... 461
Functional descriptions ...................................................................................................... 462
Principle ............................................................................................................................. 463
Register description ........................................................................................................... 465
Status register (ACC_STS) ........................................................................................................... 465
Control register 1 (ACC_CTRL1) .................................................................................................. 466
Control register 2 (ACC_CTRL2) .................................................................................................. 467
Compare value 1 (ACC_C1) ......................................................................................................... 467
Compare value 2 (ACC_C2) ......................................................................................................... 467
Compare value 3 (ACC_C3) ......................................................................................................... 468
26 Debug (DEBUG) ................................................................................................ 469
Debug introduction ............................................................................................................. 469
Debug and Trace ............................................................................................................... 469
I/O pin control .................................................................................................................... 469
DEBUG registers ............................................................................................................... 470
DEBUG device ID (DEBUG_IDCODE) ......................................................................................... 470
DEBUG control register (DEBUG_CTRL) ..................................................................................... 471
Rev. 1.00 14 of 474 June 01, 2023
32-Bit Arm® Cortex®-M4 MCU
HT32F49365/HT32F49395
List of Tables
List of Tables
Table 1. Bit-band address mapping in SRAM ......................................................................................... 29
Table 2. Bit-band address mapping in the peripheral area ..................................................................... 29
Table 3. HT32F49365/HT32F49395 series vector table ......................................................................... 30
Table 4. List of abbreviations for registers .............................................................................................. 34
Table 5. List of abbreviations for registers .............................................................................................. 34
Table 6. Flash memory organization (1024K main memory) .................................................................. 37
Table 7. Flash memory organization (512K main memory) .................................................................... 37
Table 8. Flash memory organization (256K main memory) .................................................................... 38
Table 9. Peripheral boundary address .................................................................................................... 39
Table 10. PW register map and reset values .......................................................................................... 46
Table 11. CRM register map and reset values ........................................................................................ 52
Table 12. Flash memory architecture(1024 K) ........................................................................................ 69
Table 13. Flash memory architecture(512 K) .......................................................................................... 70
Table 14. Flash memory architecture(256 K) .......................................................................................... 70
Table 15. Instruction set supported by external memory ........................................................................ 72
Table 16. User system data area ............................................................................................................ 73
Table 17. Flash memory access limit ...................................................................................................... 83
Table 18. Flash memory interface – Register map and reset value ........................................................ 85
Table 19. GPIO input mode conî‚¿guration ............................................................................................... 97
Table 20. GPIO analog input/output mode conî‚¿guration ........................................................................ 98
Table 21. GPIO output mode conî‚¿guration ............................................................................................. 98
Table 22. GPIO register map and reset values ....................................................................................... 98
Table 23. IOMUX input conî‚¿guration .................................................................................................... 103
Table 24. IOMUX output conî‚¿guration .................................................................................................. 104
Table 25. Hardware preemption ............................................................................................................ 104
Table 26. Debug port map .................................................................................................................... 105
Table 27. IOMUX register map and reset value .................................................................................... 105
Table 28. External interrupt/Event controller register map and reset value .......................................... 122
Table 29. DMA error event .................................................................................................................... 129
Table 30. DMA interrupt requests ......................................................................................................... 129
Table 31. DMA1 requests for each channel .......................................................................................... 129
Table 32. DMA2 requests for each channel .......................................................................................... 129
Table 33. Flexible DMA requests for each channel ............................................................................... 130
Table 34. DMA register map and reset value ........................................................................................ 131
Table 35. CRC register map and reset value ........................................................................................ 139
Table 36. I2C interrupt requests ............................................................................................................ 157
Table 37. I2C register map and reset value ........................................................................................... 158
Table 38. Error calculation for programmed baud rate ......................................................................... 173
Table 39. Data sampling over start bit and noise detection ................................................................. 176
Rev. 1.00 15 of 474 June 01, 2023
32-Bit Arm® Cortex®-M4 MCU
HT32F49365/HT32F49395
List of Tables
List of Tables
Table 40. Data sampling over valid data and noise detection .............................................................. 176
Table 41. USART interrupt request ....................................................................................................... 177
Table 42. USART register map and reset value .................................................................................... 178
Table 43. Audio frequency precision using system clock ...................................................................... 198
Table 44. SPI register map and reset value .......................................................................................... 202
Table 45. TMR functional comparison................................................................................................... 209
Table 46. TMR6 and TMR7 – register table and reset value ................................................................ 212
Table 47. TMRx internal trigger connection .......................................................................................... 217
Table 48. Counting direction versus encoder signals ........................................................................... 219
Table 49. TMRx register map and reset value ...................................................................................... 228
Table 50. Standard CxOUT channel output control bit.......................................................................... 238
Table 51. TMRx internal trigger connection .......................................................................................... 243
Table 52. TMRx register map and reset value ...................................................................................... 250
Table 53. Standard CxOUT channel output control bit.......................................................................... 257
Table 54. TMRx register map and reset value ...................................................................................... 258
Table 55. Standard CxOUT channel output control bit.......................................................................... 263
Table 56. TMRx internal trigger connection .......................................................................................... 267
Table 57. Couting direction versus encoder signals ............................................................................. 269
Table 58. TMR1 and TMR8 register map and reset value .................................................................... 278
Table 59. Complementary output channel CxOUT and CxCOUT control bits with break function ....... 290
Table 60. Minimum and maximum timeout value when PCLK1=72 MHz ............................................. 296
Table 61. WWDT register map and reset value .................................................................................... 296
Table 62. WDT timeout period (LICK=40kHz) ....................................................................................... 299
Table 63. WDT register and reset value................................................................................................ 299
Table 64. RTC register map and reset values....................................................................................... 304
Table 65. BPR register map and reset values ...................................................................................... 308
Table 66. Trigger sources for ADC1 and ADC2 .................................................................................... 316
Table 67. Trigger sources for ADC3 ...................................................................................................... 317
Table 68. ADC register map and reset values ...................................................................................... 326
Table 69. Trigger source selection ........................................................................................................ 338
Table 70. DAC register map and reset values ...................................................................................... 340
Table 71. Examples of î‚¿lter numbering ................................................................................................. 354
Table 72. CAN register map and reset values ...................................................................................... 358
Table 73. NOR/PSRAM pins ................................................................................................................. 379
Table 74. NAND pins ............................................................................................................................ 380
Table 75. Memory bank selection ......................................................................................................... 381
Table 76. Pin signals for NOR and PSRAM ......................................................................................... 381
Table 77. Address translation between HADDR and external memory ................................................ 382
Table 78. Data access width vs. external memory data width .............................................................. 382
Table 79. NOR/PSRAM parameter registers ........................................................................................ 383
Table 80. Mode 1 – SRAM/NOR Flash chip select control register (XMC_BK1CTRL) ........................ 383
Rev. 1.00 16 of 474 June 01, 2023
32-Bit Arm® Cortex®-M4 MCU
HT32F49365/HT32F49395
List of Tables
Table 81. Mode 1 – SRAM/NOR Flash chip select timing register (XMC_ BK1TMG) ......................... 384
Table 82. Mode 2 – SRAM/NOR Flash chip select control register (XMC_BK1CTRL) ........................ 385
Table 83. Mode 2 – SRAM/NOR Flash chip select timing register (XMC_BK1TMG) .......................... 386
Table 84. Mode A – SRAM/NOR Flash chip select control register (XMC_BK1CTRL) ......................... 387
Table 85. Mode A – SRAM/NOR Flash chip select timing register (XMC_BK1TMG) .......................... 388
Table 86. Mode A – SRAM/NOR Flash write timing register (XMC_BK1TMGWR) .............................. 388
Table 87. Mode B – SRAM/NOR Flash chip select register (XMC_BK1CTRL) .................................... 390
Table 88. Mode B – SRAM/NOR Flash chip select timing register (XMC_BK1TMG) .......................... 390
Table 89. Mode B – SRAM/NOR Flash write timing register (XMC_BK1TMGWR) ............................. 391
Table 90. Mode C – SRAM/NOR Flash chip select register (XMC_BK1CTRL) ................................... 392
Table 91. Mode C – SRAM/NOR Flash chip select timing register (XMC_BK1TMG) .......................... 393
Table 92. Mode C – SRAM/NOR Flash write timing register (XMC_BK1TMGWR) ............................. 393
Table 93. Mode D – SRAM/NOR Flash chip select register (XMC_BK1CTRL) ................................... 395
Table 94. Mode D – SRAM/NOR Flash chip select timing register (XMC_BK1TMG) .......................... 395
Table 95. Mode D – SRAM/NOR Flash write timing register (XMC_BK1TMGWR) .............................. 396
Table 96. Multiplexed mode – SRAM/NOR Flash chip select control register (XMC_BK1CTRL) ....... 397
Table 97. Multiplexed mode – SRAM/NOR Flash chip select timing register (XMC_BK1TMG) .......... 398
Table 98. Synchronous mode – SRAM/NOR Flash chip select control register (XMC_ BK1CTRL) .... 399
Table 99. Synchronous mode – SRAM/NOR Flash chip select timing register (XMC_BK1TMG) ....... 400
Table 100. Typical pin signals for NAND Flash ..................................................................................... 403
Table 101. Data access width vs. external memory data width ............................................................ 403
Table 102. NAND parameter registers .................................................................................................. 404
Table 103. lists the ECC result bits corresponding to the number of bytes .......................................... 406
Table 104. XMC register address mapping ........................................................................................... 406
Table 105. Lock/unlock command structure ......................................................................................... 423
Table 106. Commands .......................................................................................................................... 426
Table 107. Data block read commands ................................................................................................ 427
Table 108. Data stream read/write commands ..................................................................................... 427
Table 109. Data block write commands ................................................................................................ 427
Table 110. Block-based write protect commands.................................................................................. 428
Table 111. Erase commands ................................................................................................................. 428
Table 112. I/O mode commands ........................................................................................................... 428
Table 113. Card lock commands ........................................................................................................... 428
Table 114. Application-speciî‚¿c commands ........................................................................................... 429
Table 115. R1 response ........................................................................................................................ 429
Table 116. R2 response ........................................................................................................................ 430
Table 117. R3 response ........................................................................................................................ 430
Table 118. R4 response ........................................................................................................................ 430
Table 119. R4b response ...................................................................................................................... 430
Table 120. R5 response ........................................................................................................................ 430
Table 121. R6 response ........................................................................................................................ 431
Rev. 1.00 17 of 474 June 01, 2023
32-Bit Arm® Cortex®-M4 MCU
HT32F49365/HT32F49395
List of Tables
List of Tables
Table 122. SDIO pin deî‚¿nitions ............................................................................................................ 432
Table 123. Command formats ............................................................................................................... 433
Table 124. Short response format ......................................................................................................... 433
Table 125. Long response format ......................................................................................................... 433
Table 126. Command path status ags ................................................................................................ 433
Table 127. Data token formats .............................................................................................................. 436
Table 128. A summary of the SDIO registers. ....................................................................................... 439
Table 129. Response type and SDIO_RSPx register ........................................................................... 442
Table 130. USB pin conî‚¿guration ......................................................................................................... 450
Table 131. Buer size conguration table ............................................................................................. 451
Table 132. The structure of a regular endpoint register buer description eld .................................... 452
Table 133. USBFS register map and reset values ................................................................................ 454
Table 134. ACC interrupt requests ........................................................................................................ 461
Table 135. ACC register map and reset values .................................................................................... 465
Table 136. Trace function enable .......................................................................................................... 470
Table 137. Trace function mode ............................................................................................................ 470
Table 138. DEBUG register address and reset value ........................................................................... 470
Table 139. Description of ID code ......................................................................................................... 470
Rev. 1.00 18 of 474 June 01, 2023
32-Bit Arm® Cortex®-M4 MCU
HT32F49365/HT32F49395
List of Figures
List of Figures
Figure 1. HT32F49365/HT32F49395 Series microcontrollers system architecture ................................ 24
Figure 2. Internal block diagram of Cortex®-M4F ................................................................................... 27
Figure 3. Comparison between bit-band region and its alias region: image A ........................................ 27
Figure 4. Comparison between bit-band region and its alias region: image B ....................................... 28
Figure 5. Reset process .......................................................................................................................... 33
Figure 6. Example of MSP and PC initialization ..................................................................................... 33
Figure 7. HT32F49365/HT32F49395 address mapping ......................................................................... 36
Figure 8. Block diagram of each power supply ....................................................................................... 41
Figure 9. Power-on reset/Low voltage reset waveform .......................................................................... 42
Figure 10. PVM threshold and output ..................................................................................................... 43
Figure 11. Clock tree ............................................................................................................................... 48
Figure 12. System reset circuit ............................................................................................................... 51
Figure 13. External memory ciphertext protection .................................................................................. 71
Figure 14. Reference circuit for external memory .................................................................................. 71
Figure 15. Flash memory page erase process ...................................................................................... 76
Figure 16. Flash memory mass erase process ....................................................................................... 77
Figure 17. Flash memory programming process .................................................................................... 79
Figure 18. System data area erase process ........................................................................................... 81
Figure 19. System data area programming process ............................................................................... 82
Figure 20. GPIO basic structure ............................................................................................................. 97
Figure 21. Basic structure of IOMUX basic structure ............................................................................ 103
Figure 22. External interrupt/Event controller block diagram ................................................................ 121
Figure 23. DMA block diagram ............................................................................................................. 126
Figure 24. Re-arbitrae after request/acknowledge ............................................................................... 127
Figure 25. PWIDTH: byte, MWIDTH: half-word .................................................................................... 128
Figure 26. PWIDTH: half-word, MWIDTH: word ................................................................................... 128
Figure 27. PWIDTH: word, MWIDTH: byte ........................................................................................... 128
Figure 28. I2C bus protocol .................................................................................................................. 141
Figure 29. I2C function block diagram ................................................................................................... 142
Figure 30. Transfer sequence of slave transmitter ............................................................................... 144
Figure 31. Transfer sequence of slave receiver .................................................................................... 145
Figure 32. Transfer sequence of master transmitter ............................................................................ 147
Figure 33. Transfer sequence of master receiver ................................................................................. 149
Figure 34. Transfer sequence of master receiver when N>2 ................................................................ 150
Figure 35. Transfer sequence of master receiver when N=2 ................................................................ 152
Figure 36. Transfer sequence of master receiver when N=1 ................................................................ 153
Figure 37. USART block diagram ......................................................................................................... 167
Figure 38. IrDA DATA(3/16) – normal mode ......................................................................................... 170
Figure 39. Word length ......................................................................................................................... 171
Rev. 1.00 19 of 474 June 01, 2023
32-Bit Arm® Cortex®-M4 MCU
HT32F49365/HT32F49395
List of Figures
List of Figures
Figure 40. USART interrupt map diagram ............................................................................................ 177
Figure 41. SPI block diagram .............................................................................................................. 184
Figure 42. SPI two-wire unidirectional full-duplex connection .............................................................. 185
Figure 43. Single-wire unidirectional receive only in SPI master mode ................................................ 186
Figure 44. Single-wire unidirectional receive only in SPI slave mode .................................................. 186
Figure 45. Single-wire bidirectional half-duplex mode .......................................................................... 187
Figure 46. SPI interrupts ....................................................................................................................... 192
Figure 47. I2S block diagram ................................................................................................................. 193
Figure 48. I2S full-duplex structure ........................................................................................................ 194
Figure 49. I2S slave device transmission .............................................................................................. 194
Figure 50. I2S slave device reception ................................................................................................... 195
Figure 51. I2S master device transmission ........................................................................................... 195
Figure 52. I2S master device reception ................................................................................................. 196
Figure 53. CK & MCK source in master mode ...................................................................................... 198
Figure 54. I2S interrupt .......................................................................................................................... 202
Figure 55. Basic timer block diagram .................................................................................................. 210
Figure 56. Control circuit with CK_INT divided by 1 ............................................................................. 210
Figure 57. Overow event when PRBEN=0 ...........................................................................................211
Figure 58. Overow event when PRBEN=1 ...........................................................................................211
Figure 59. Counting timing diagram when the prescaler division is 4 ....................................................211
Figure 60. General-purpose timer block diagram ................................................................................. 215
Figure 61. Control circuit with CK_INT divided by 1 ............................................................................. 215
Figure 62. Block diagram of external clock mode A ............................................................................. 216
Figure 63. Counting in external clock mode A ..................................................................................... 216
Figure 64. Block diagram of external clock mode B ............................................................................. 216
Figure 65. Counting in external clock mode B ..................................................................................... 217
Figure 66. Counter timing with prescaler value changing from 1 to 4 ................................................. 217
Figure 67. Overow event when PRBEN=0 ......................................................................................... 218
Figure 68. Overow event when PRBEN=1 ......................................................................................... 218
Figure 69. Counter timing diagram with internal clock divided by 4 ...................................................... 219
Figure 70. Counter timing diagram with internal clock divided by 1 and TMRx_PR=0x32 ................... 219
Figure 71. Example of counter behavior in encoder interface mode (encoder mode C) ...................... 220
Figure 72. Input/output channel 1 main circuit ...................................................................................... 220
Figure 73. Channel 1 input stage .......................................................................................................... 220
Figure 74. Capture/compare channel output stage (channel 1 to 4) .................................................... 221
Figure 75. C1ORAW toggles when counter value matches the C1DT value ........................................ 222
Figure 76. Upcounting mode and PWM mode A ................................................................................... 223
Figure 77. Up/down counting mode and PWM mode A ........................................................................ 223
Figure 78. One-pulse mode .................................................................................................................. 224
Figure 79. Clearing CxORAW(PWM mode A) by EXT input ................................................................. 224
Figure 80. Example of reset mode ........................................................................................................ 225
Rev. 1.00 20 of 474 June 01, 2023
32-Bit Arm® Cortex®-M4 MCU
HT32F49365/HT32F49395
List of Figures
Figure 81. Example of suspend mode .................................................................................................. 225
Figure 82. Example of trigger mode ..................................................................................................... 226
Figure 83. Master/slave timer connection ............................................................................................. 226
Figure 84. Using master timer to start slave timer ................................................................................ 227
Figure 85. Starting master and slave timers synchronously by an external trigger .............................. 228
Figure 86. Block diagram of general-purpose TMR9/12 ....................................................................... 241
Figure 87. Block diagram of general-purpose TMR10/11/13/14 ........................................................... 242
Figure 88. Control circuit with CK_INT divided by 1 ............................................................................. 242
Figure 89. Block diagram of external clock mode A ............................................................................. 243
Figure 90. Counting in external clock mode A ..................................................................................... 243
Figure 91. Counter timing with prescaler value changing from 1 to 4 .................................................. 244
Figure 92. Overow event when PRBEN=0 ......................................................................................... 244
Figure 93. Overow event when PRBEN=1 ......................................................................................... 245
Figure 94. Input/output channel 1 main circuit ...................................................................................... 245
Figure 95. Channel 1 input stage .......................................................................................................... 245
Figure 96. Capture/compare channel output stage (channel 1) ........................................................... 246
Figure 97. C1ORAW toggles when counter value matches the C1DT value ........................................ 247
Figure 98. Upcounting mode and PWM mode A ................................................................................... 248
Figure 99. One-pulse mode .................................................................................................................. 248
Figure 100. Example of reset mode ...................................................................................................... 249
Figure 101. Example of suspend mode ................................................................................................ 249
Figure 102. Example of trigger mode ................................................................................................... 250
Figure 103. Block diagram of advanced-control timer .......................................................................... 264
Figure 104. Control circuit with CK_INT divided by 1 ........................................................................... 265
Figure 105. Block diagram of external clock mode A ........................................................................... 265
Figure 106. Counting in external clock mode A .................................................................................... 266
Figure 107. Block diagram of external clock mode B ........................................................................... 266
Figure 108. Counting in external clock mode B .................................................................................... 266
Figure 109. Counter timing with prescaler value changing from 1 to 4 ................................................. 267
Figure 110. Overow event when PRBEN=0 ........................................................................................ 268
Figure 111. Overow event when PRBEN=1 ........................................................................................ 268
Figure 112. Counter timing diagram with internal clock divided by 4 .................................................... 268
Figure 113. Counter timing diagram with internal clock divided by 1 and TMRx_PR=0x32 ................. 269
Figure 114. OVFIF when RPR=2 .......................................................................................................... 269
Figure 115. Example of encoder interface mode C............................................................................... 270
Figure 116. Input/output channel 1 main circuit .................................................................................... 270
Figure 117. Channel 1 input stage ........................................................................................................ 270
Figure 118. Channel output stage (channel 1 to 3) ............................................................................... 271
Figure 119. Channel 4 output stage ...................................................................................................... 272
Figure 120. C1ORAW toggles when counter value matches the C1DT value ...................................... 273
Figure 121. Upcounting mode and PWM mode A ................................................................................. 273
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46
  • Page 47 47
  • Page 48 48
  • Page 49 49
  • Page 50 50
  • Page 51 51
  • Page 52 52
  • Page 53 53
  • Page 54 54
  • Page 55 55
  • Page 56 56
  • Page 57 57
  • Page 58 58
  • Page 59 59
  • Page 60 60
  • Page 61 61
  • Page 62 62
  • Page 63 63
  • Page 64 64
  • Page 65 65
  • Page 66 66
  • Page 67 67
  • Page 68 68
  • Page 69 69
  • Page 70 70
  • Page 71 71
  • Page 72 72
  • Page 73 73
  • Page 74 74
  • Page 75 75
  • Page 76 76
  • Page 77 77
  • Page 78 78
  • Page 79 79
  • Page 80 80
  • Page 81 81
  • Page 82 82
  • Page 83 83
  • Page 84 84
  • Page 85 85
  • Page 86 86
  • Page 87 87
  • Page 88 88
  • Page 89 89
  • Page 90 90
  • Page 91 91
  • Page 92 92
  • Page 93 93
  • Page 94 94
  • Page 95 95
  • Page 96 96
  • Page 97 97
  • Page 98 98
  • Page 99 99
  • Page 100 100
  • Page 101 101
  • Page 102 102
  • Page 103 103
  • Page 104 104
  • Page 105 105
  • Page 106 106
  • Page 107 107
  • Page 108 108
  • Page 109 109
  • Page 110 110
  • Page 111 111
  • Page 112 112
  • Page 113 113
  • Page 114 114
  • Page 115 115
  • Page 116 116
  • Page 117 117
  • Page 118 118
  • Page 119 119
  • Page 120 120
  • Page 121 121
  • Page 122 122
  • Page 123 123
  • Page 124 124
  • Page 125 125
  • Page 126 126
  • Page 127 127
  • Page 128 128
  • Page 129 129
  • Page 130 130
  • Page 131 131
  • Page 132 132
  • Page 133 133
  • Page 134 134
  • Page 135 135
  • Page 136 136
  • Page 137 137
  • Page 138 138
  • Page 139 139
  • Page 140 140
  • Page 141 141
  • Page 142 142
  • Page 143 143
  • Page 144 144
  • Page 145 145
  • Page 146 146
  • Page 147 147
  • Page 148 148
  • Page 149 149
  • Page 150 150
  • Page 151 151
  • Page 152 152
  • Page 153 153
  • Page 154 154
  • Page 155 155
  • Page 156 156
  • Page 157 157
  • Page 158 158
  • Page 159 159
  • Page 160 160
  • Page 161 161
  • Page 162 162
  • Page 163 163
  • Page 164 164
  • Page 165 165
  • Page 166 166
  • Page 167 167
  • Page 168 168
  • Page 169 169
  • Page 170 170
  • Page 171 171
  • Page 172 172
  • Page 173 173
  • Page 174 174
  • Page 175 175
  • Page 176 176
  • Page 177 177
  • Page 178 178
  • Page 179 179
  • Page 180 180
  • Page 181 181
  • Page 182 182
  • Page 183 183
  • Page 184 184
  • Page 185 185
  • Page 186 186
  • Page 187 187
  • Page 188 188
  • Page 189 189
  • Page 190 190
  • Page 191 191
  • Page 192 192
  • Page 193 193
  • Page 194 194
  • Page 195 195
  • Page 196 196
  • Page 197 197
  • Page 198 198
  • Page 199 199
  • Page 200 200
  • Page 201 201
  • Page 202 202
  • Page 203 203
  • Page 204 204
  • Page 205 205
  • Page 206 206
  • Page 207 207
  • Page 208 208
  • Page 209 209
  • Page 210 210
  • Page 211 211
  • Page 212 212
  • Page 213 213
  • Page 214 214
  • Page 215 215
  • Page 216 216
  • Page 217 217
  • Page 218 218
  • Page 219 219
  • Page 220 220
  • Page 221 221
  • Page 222 222
  • Page 223 223
  • Page 224 224
  • Page 225 225
  • Page 226 226
  • Page 227 227
  • Page 228 228
  • Page 229 229
  • Page 230 230
  • Page 231 231
  • Page 232 232
  • Page 233 233
  • Page 234 234
  • Page 235 235
  • Page 236 236
  • Page 237 237
  • Page 238 238
  • Page 239 239
  • Page 240 240
  • Page 241 241
  • Page 242 242
  • Page 243 243
  • Page 244 244
  • Page 245 245
  • Page 246 246
  • Page 247 247
  • Page 248 248
  • Page 249 249
  • Page 250 250
  • Page 251 251
  • Page 252 252
  • Page 253 253
  • Page 254 254
  • Page 255 255
  • Page 256 256
  • Page 257 257
  • Page 258 258
  • Page 259 259
  • Page 260 260
  • Page 261 261
  • Page 262 262
  • Page 263 263
  • Page 264 264
  • Page 265 265
  • Page 266 266
  • Page 267 267
  • Page 268 268
  • Page 269 269
  • Page 270 270
  • Page 271 271
  • Page 272 272
  • Page 273 273
  • Page 274 274
  • Page 275 275
  • Page 276 276
  • Page 277 277
  • Page 278 278
  • Page 279 279
  • Page 280 280
  • Page 281 281
  • Page 282 282
  • Page 283 283
  • Page 284 284
  • Page 285 285
  • Page 286 286
  • Page 287 287
  • Page 288 288
  • Page 289 289
  • Page 290 290
  • Page 291 291
  • Page 292 292
  • Page 293 293
  • Page 294 294
  • Page 295 295
  • Page 296 296
  • Page 297 297
  • Page 298 298
  • Page 299 299
  • Page 300 300
  • Page 301 301
  • Page 302 302
  • Page 303 303
  • Page 304 304
  • Page 305 305
  • Page 306 306
  • Page 307 307
  • Page 308 308
  • Page 309 309
  • Page 310 310
  • Page 311 311
  • Page 312 312
  • Page 313 313
  • Page 314 314
  • Page 315 315
  • Page 316 316
  • Page 317 317
  • Page 318 318
  • Page 319 319
  • Page 320 320
  • Page 321 321
  • Page 322 322
  • Page 323 323
  • Page 324 324
  • Page 325 325
  • Page 326 326
  • Page 327 327
  • Page 328 328
  • Page 329 329
  • Page 330 330
  • Page 331 331
  • Page 332 332
  • Page 333 333
  • Page 334 334
  • Page 335 335
  • Page 336 336
  • Page 337 337
  • Page 338 338
  • Page 339 339
  • Page 340 340
  • Page 341 341
  • Page 342 342
  • Page 343 343
  • Page 344 344
  • Page 345 345
  • Page 346 346
  • Page 347 347
  • Page 348 348
  • Page 349 349
  • Page 350 350
  • Page 351 351
  • Page 352 352
  • Page 353 353
  • Page 354 354
  • Page 355 355
  • Page 356 356
  • Page 357 357
  • Page 358 358
  • Page 359 359
  • Page 360 360
  • Page 361 361
  • Page 362 362
  • Page 363 363
  • Page 364 364
  • Page 365 365
  • Page 366 366
  • Page 367 367
  • Page 368 368
  • Page 369 369
  • Page 370 370
  • Page 371 371
  • Page 372 372
  • Page 373 373
  • Page 374 374
  • Page 375 375
  • Page 376 376
  • Page 377 377
  • Page 378 378
  • Page 379 379
  • Page 380 380
  • Page 381 381
  • Page 382 382
  • Page 383 383
  • Page 384 384
  • Page 385 385
  • Page 386 386
  • Page 387 387
  • Page 388 388
  • Page 389 389
  • Page 390 390
  • Page 391 391
  • Page 392 392
  • Page 393 393
  • Page 394 394
  • Page 395 395
  • Page 396 396
  • Page 397 397
  • Page 398 398
  • Page 399 399
  • Page 400 400
  • Page 401 401
  • Page 402 402
  • Page 403 403
  • Page 404 404
  • Page 405 405
  • Page 406 406
  • Page 407 407
  • Page 408 408
  • Page 409 409
  • Page 410 410
  • Page 411 411
  • Page 412 412
  • Page 413 413
  • Page 414 414
  • Page 415 415
  • Page 416 416
  • Page 417 417
  • Page 418 418
  • Page 419 419
  • Page 420 420
  • Page 421 421
  • Page 422 422
  • Page 423 423
  • Page 424 424
  • Page 425 425
  • Page 426 426
  • Page 427 427
  • Page 428 428
  • Page 429 429
  • Page 430 430
  • Page 431 431
  • Page 432 432
  • Page 433 433
  • Page 434 434
  • Page 435 435
  • Page 436 436
  • Page 437 437
  • Page 438 438
  • Page 439 439
  • Page 440 440
  • Page 441 441
  • Page 442 442
  • Page 443 443
  • Page 444 444
  • Page 445 445
  • Page 446 446
  • Page 447 447
  • Page 448 448
  • Page 449 449
  • Page 450 450
  • Page 451 451
  • Page 452 452
  • Page 453 453
  • Page 454 454
  • Page 455 455
  • Page 456 456
  • Page 457 457
  • Page 458 458
  • Page 459 459
  • Page 460 460
  • Page 461 461
  • Page 462 462
  • Page 463 463
  • Page 464 464
  • Page 465 465
  • Page 466 466
  • Page 467 467
  • Page 468 468
  • Page 469 469
  • Page 470 470
  • Page 471 471
  • Page 472 472
  • Page 473 473
  • Page 474 474

Holtek HT32F49365 User manual

Type
User manual
This manual is also suitable for

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI