Nuvoton TRM KM1M4BF02 03 04 05 52 53 54 Vol1 Technical Reference Manual

  • Hello! I'm your chat assistant. I've analyzed the Technical Reference Manual for the Nuvoton KM1M4BF0 02/03/04/05 and KM1M4BF5 52/53/54 series microcontrollers. This document provides detailed information on a wide variety of system features, including safety mechanisms, power saving functions and timer-related capabilities. Feel free to ask me any questions about the device's specifications or usage, and I'll do my best to assist you.
  • What is the core architecture of these microcontrollers?
    What kind of safety functions are included?
    What types of low power modes are available?
    What kind of interfaces are supported?
KM1M4BF02/03/04/05 Series
KM1M4BF52/53/54 Series
Arm® Cortex®-M
32-bit Microcontroller
KM1M4BF02/03/04/05 Series
KM1M4BF52/53/54 Series
Technical Reference Manual Vol. 1
The information described in this document is the exclusive intellectual property of Nuvoton
Technology Corporation Japan and shall not be reproduced without permission from Nuvoton.
Nuvoton is providing document only for reference purposes of KM1M4BF02/03/04/05/52/53/54
Series based system design.
Nuvoton assumes no responsibility for errors or commissions.
All data and specifications are subject to changed without notice.
For additional information or question, please contact Nuvoton Technology Corporation Japan.
www.nuvoton.co.jp
May 15.2023 Page 1 of 671 Ver 1.03
KM1M4BF02/03/04/05 Series KM1M4BF52/53/54 Series Technical Reference
Manual Vol. 1
KM1M4BF02/03/04/05 Series
KM1M4BF52/53/54 Series
Request for your special attention and precautions
in using the technical information and semiconductors described in this book
(1) If any of the products or technical information described in this book is to be exported or provided to non-
residents, the laws and regulations of the exporting country, especially, those with regard to security export
control, must be observed.
(2) The technical information described in this book is intended only to show the main characteristics and
application circuit examples of the products. No license is granted in and to any intellectual property right or
other right owned by Nuvoton Technology Corporation Japan or any other company. Therefore, no
responsibility is assumed by our company as to the infringement upon any such right owned by any other
company which may arise as a result of the use of technical information de-scribed in this book.
(3) The products described in this book are intended to be used for general applications (such as office
equipment, communications equipment, measuring instruments and household appliances), or for specific
applications as expressly stated in this book.
It is to be understood that our company shall not be held responsible for any damage caused as a result of the
following special applications:
Special applications (such as for automotive, airplanes, aerospace, transport equipment, traffic signaling
equipment, combustion equipment, medical equipment and safety devices) in which exceptional quality and
reliability are required, or if the failure or malfunction of the products may directly jeopardize life or harm the
human body.
It is to be understood that our company shall not be held responsible for any damage incurred as a result of or
in connection with your using the products described in this book for any special application, unless our
company agrees to your using the products in this book for any special application.
(4) When designing your equipment, comply with the range of absolute maximum rating and the guaranteed
operating conditions (operating power supply voltage and operating environment etc.). Especially, please be
careful not to exceed the range of absolute maximum rating on the transient state, such as power-on, power-off
and mode-switching. Other-wise, we will not be liable for any defect which may arise later in your equipment.
Even when the products are used within the guaranteed values, take into the consideration of incidence of break
down and failure mode, possible to occur to semiconductor products. Measures on the systems such as
redundant design, arresting the spread of fire or preventing glitch are recommended in order to prevent physical
injury, fire, social damages, for example, by using the products.
(5) Comply with the instructions for use in order to prevent breakdown and characteristics change due to
external factors (ESD, EOS, thermal stress and mechanical stress) at the time of handling, mounting or at
customer's process. We do not guarantee quality for disassembled products or the product re-mounted after
removing from the mounting board. When using products for which damp-proof packing is required, satisfy the
conditions, such as shelf life and the elapsed time since first opening the packages.
(6) When reselling products described in this book to other companies without our permission and receiving
any claim of request from the resale destination, please understand that customers will bear the burden.
(7) This book may be not reprinted or reproduced whether wholly or partially, without the prior written
permission of our company.
May 15.2023 Page 2 of 671 Ver 1.03
KM1M4BF02/03/04/05 Series KM1M4BF52/53/54 Series Technical Reference
Manual Vol. 1
KM1M4BF02/03/04/05 Series
KM1M4BF52/53/54 Series
May 15.2023 Page 3 of 671 Ver 1.03
KM1M4BF02/03/04/05 Series KM1M4BF52/53/54 Series Technical Reference
Manual Vol. 1
KM1M4BF02/03/04/05 Series
KM1M4BF52/53/54 Series
n
n
May 15.2023 Page 4 of 671 Ver 1.03
KM1M4BF02/03/04/05 Series KM1M4BF52/53/54 Series Technical Reference
Manual Vol. 1
Table of Contents
1. Overview .............................................................................................. 15
1.1 Overview .................................................................................................................................16
1.2 Product Summary....................................................................................................................16
1.2.1 Function Summary ........................................................................................................17
1.3 Features ..................................................................................................................................18
1.4 Pins .........................................................................................................................................21
1.4.1 Pin Configuration ( KM1M4BF0 Series ) .......................................................................21
1.4.2 Pin Configuration ( KM1M4BF5 Series ) .......................................................................25
1.4.3 Pin Functions (KM1M4BF0 Series)...............................................................................28
1.4.4 Pin Functions (KM1M4BF5 Series)...............................................................................41
1.5 Block Diagram .........................................................................................................................54
1.6 Electrical Characteristics .........................................................................................................55
1.6.1 Absolute Maximum Ratings ..........................................................................................55
1.6.2 Operation Conditions ....................................................................................................56
1.6.3 DC Characteristics ........................................................................................................58
1.6.4 Analog Characteristics ..................................................................................................61
1.6.5 AC Characteristics ........................................................................................................65
1.6.6 Flash EEPROM Characteristics ....................................................................................65
1.7 Package Dimension ................................................................................................................66
1.8 Cautions for Circuit Setup .......................................................................................................70
1.8.1 Cautions of Usage.........................................................................................................70
1.8.2 Pin Connections ............................................................................................................71
1.8.3 Unused pins ..................................................................................................................74
1.8.4 Cautions of Power Supply.............................................................................................75
1.8.5 Example of Oscillator Connection .................................................................................78
2. Safety Function.................................................................................... 81
2.1 Overview .................................................................................................................................82
2.1.1 Flash Memory Data Protection Function.......................................................................82
2.1.2 Flash-ECC Function......................................................................................................82
2.1.3 RAM-ECC function........................................................................................................83
2.1.4 MPU Function ...............................................................................................................83
2.1.5 Register Protection Function.........................................................................................83
2.1.6 WDT Function ...............................................................................................................84
2.1.7 Clock Monitoring Function.............................................................................................84
2.1.8 CRC Calculation Function.............................................................................................84
2.1.9 A/D Fault Diagnosis Function........................................................................................84
2.1.10 Power Supply Voltage Detection Function ..................................................................84
2.1.11 Reset Factor Identifying Function................................................................................85
2.1.12 IO-level Monitoring Function .......................................................................................85
3. System Setting .................................................................................... 87
KM1M4BF02/03/04/05 Series
KM1M4BF52/53/54 Series
KM1M4BF02/03/04/05 Series KM1M4BF52/53/54 Series Technical Reference
Manual Vol. 1
May 15.2023 Page 5 of 671 Ver 1.03
3.1 Reset .......................................................................................................................................88
3.1.1 Overview .......................................................................................................................88
3.1.2 Reset Controller Control Register .................................................................................88
3.1.3 Reset Definition.............................................................................................................89
3.1.4 Identifying Reset Factor ................................................................................................90
3.1.5 Start-Up Sequence after Reset .....................................................................................91
3.2 Flash Option ............................................................................................................................94
3.2.1 Overview of Flash Option..............................................................................................94
3.2.2 Detail of Flash Option....................................................................................................96
3.3 Software Start-UP .................................................................................................................103
3.3.1 Overview of Software Start-Up....................................................................................103
3.3.2 Examples of Settings ..................................................................................................103
3.4 Clock Generator ....................................................................................................................104
3.4.1 Overview of Clock Generator ......................................................................................104
3.4.2 Clock Generator Control Register ...............................................................................106
3.4.3 Specification of Clock Generator.................................................................................106
3.4.4 Setting Example of Clock Generator...........................................................................112
4. CPU......................................................................................................115
4.1 Overview ...............................................................................................................................116
4.1.1 Cortex-M4 Processor and Core Peripheral Structure ................................................117
4.1.2 Cortex-M4 Processor Interrupts ..................................................................................118
4.1.3 Block Diagram of Cortex-M4 Processor and Core Peripheral Blocks .........................118
5. Memory Map .......................................................................................119
5.1 Overview ...............................................................................................................................120
5.2 Memory map .........................................................................................................................121
5.3 Flash Memory Area ...............................................................................................................123
5.3.1 Access Wait Setting to Flash area ..............................................................................123
5.3.2 Flash-ECC Functions ..................................................................................................124
5.4 Data RAM Area .....................................................................................................................126
5.4.1 Data RAM-ECC Function ............................................................................................127
5.5 Peripheral Area .....................................................................................................................131
5.5.1 Register Map...............................................................................................................131
6. Low Power Mode ............................................................................... 141
6.1 Overview of Low Power Mode...............................................................................................142
6.1.1 Operation Modes.........................................................................................................142
6.1.2 Operation Mode Transition Diagram ...........................................................................143
6.2 Low Power Mode Control Register........................................................................................144
6.3 Detail of Low Power Mode ....................................................................................................145
6.3.1 Specification of Operation Mode .................................................................................145
6.3.2 Operating State of Functional Block............................................................................146
6.3.3 Entering and Exiting DEEPSLEEP Mode....................................................................147
6.3.4 Entering and Exiting SLEEP Mode .............................................................................149
KM1M4BF02/03/04/05 Series
KM1M4BF52/53/54 Series
May 15.2023 Page 6 of 671 Ver 1.03
KM1M4BF02/03/04/05 Series KM1M4BF52/53/54 Series Technical Reference
Manual Vol. 1
6.3.5 Setting Example of Transition of Operation Mode.......................................................151
7. Interrupt Controller............................................................................ 153
7.1 Overview of the Interrupt Controller ......................................................................................154
7.2 Features of the Interrupt Controller .......................................................................................154
7.3 Block Diagram of the Interrupt Controller ..............................................................................154
7.4 The List of the Interrupt Factors ............................................................................................155
7.5 Control Registers of the Interrupt Controller..........................................................................163
7.6 External Interrupt Function ....................................................................................................164
7.6.1 Overview .....................................................................................................................164
7.7 Group Interrupt Function .......................................................................................................165
7.7.1 Overview .....................................................................................................................165
7.7.2 Function Descriptions..................................................................................................166
7.7.3 Example of Interrupt Settings......................................................................................167
7.8 Pin Protection Factor Detection Function..............................................................................172
8. DMA controller................................................................................... 173
8.1 Overview ...............................................................................................................................174
8.1.1 Functions of DMA controller........................................................................................174
8.1.2 Interrupt group list of DMA controller ..........................................................................175
8.1.3 DMA transfer factor list................................................................................................177
8.1.4 Block diagram of DMA controller.................................................................................181
8.2 Control Registers of DMA controller......................................................................................182
8.3 DMA controller operation.......................................................................................................186
8.3.1 DMA transfer target.....................................................................................................186
8.3.2 DMA transfer operation ...............................................................................................187
8.3.3 Addressing mode ........................................................................................................193
8.3.4 Priority level.................................................................................................................193
8.3.5 DMA transfer operation in DEEPSLEEP.....................................................................193
8.4 Setting example of DMA transfer ..........................................................................................194
9. I/O port................................................................................................ 197
9.1 Overview of I/O Ports ............................................................................................................198
9.1.1 The List of I/O Ports ....................................................................................................201
9.1.2 The Default States of the I/O Ports .............................................................................204
9.1.3 The Circuit Diagram of the I/O Ports ...........................................................................207
9.2 I/O Port Control Registers .....................................................................................................209
10. Noise Filter....................................................................................... 215
10.1 Overview of Noise Filter ......................................................................................................216
10.1.1 List of Noise Filter Function.......................................................................................216
10.1.2 Noise Filter Block Diagram........................................................................................217
10.2 Control Registers of Noise Filter .........................................................................................218
KM1M4BF02/03/04/05 Series
KM1M4BF52/53/54 Series
KM1M4BF02/03/04/05 Series KM1M4BF52/53/54 Series Technical Reference
Manual Vol. 1
May 15.2023 Page 7 of 671 Ver 1.03
10.3 Function of Noise Filter .......................................................................................................219
10.3.1 Specification of Noise Filter.......................................................................................219
10.3.2 Setting Example of Noise Filter.................................................................................220
11. 16-bit Timer ...................................................................................... 221
11.1 Overview of 16-bit Timer......................................................................................................222
11.1.1 List of 16-bit Timer Functions ....................................................................................223
11.1.2 List of 16-bit Timer Clock Sources.............................................................................225
11.1.3 List of 16-bit Timer Interrupt Groups..........................................................................226
11.1.4 List of 16-bit Timer Ports ...........................................................................................228
11.1.5 16-bit Timer Block Structure ......................................................................................233
11.2 Control Registers of 16-bit Timer.........................................................................................234
11.3 Interval Timer.......................................................................................................................248
11.3.1 Function of Interval Timer..........................................................................................248
11.3.2 Timing of Interval Timer Operation ............................................................................249
11.3.3 Example of Interval Timer Settings............................................................................250
11.4 Timer Output........................................................................................................................251
11.4.1 Function of Timer Output...........................................................................................251
11.4.2 Timing of Timer Output Operation .............................................................................252
11.4.3 Example of Timer Output Settings.............................................................................253
11.5 PWM Output ........................................................................................................................255
11.5.1 Function of PWM Output ...........................................................................................255
11.5.2 Timing of PWM Output Operation .............................................................................256
11.5.3 Example of PWM Output Settings.............................................................................257
11.6 Event Count.........................................................................................................................259
11.6.1 Function of Event Count............................................................................................259
11.6.2 Timing of Event Count Operation ..............................................................................260
11.6.3 Example of Event Count Settings..............................................................................262
11.7 Phase Difference Pulse Count ............................................................................................264
11.7.1 Function of Phase Difference Pulse Count................................................................264
11.7.2 Timing of Phase Difference Pulse Count Operation..................................................265
11.7.3 Example of Phase Difference Pulse Count Settings .................................................267
11.8 Up/Down Pulse Count .........................................................................................................268
11.8.1 Function of Up/Down Pulse Count ............................................................................268
11.8.2 Timing of Up/Down Pulse Count Operation...............................................................269
11.8.3 Example of Up/Down Pulse Count Settings ..............................................................270
11.9 Input Capture.......................................................................................................................271
11.9.1 Function of Input Capture..........................................................................................271
11.9.2 Timing of Input Capture Operation ............................................................................272
11.9.3 Example of Input Capture Settings............................................................................273
11.10 1-Shot Output ....................................................................................................................275
11.10.1 Function of 1-Shot Output .......................................................................................275
11.10.2 Timing of 1-Shot Output Operation..........................................................................276
11.10.3 Example of 1-Shot Output Settings .........................................................................277
11.11 External Trigger .................................................................................................................279
KM1M4BF02/03/04/05 Series
KM1M4BF52/53/54 Series
May 15.2023 Page 8 of 671 Ver 1.03
KM1M4BF02/03/04/05 Series KM1M4BF52/53/54 Series Technical Reference
Manual Vol. 1
11.11.1 Function of External Trigger ....................................................................................279
11.11.2 Timing of External Trigger Operation.......................................................................280
11.11.3 Example of External Trigger Settings ......................................................................281
11.12 Output Protection...............................................................................................................283
11.12.1 Function of Output Protection..................................................................................283
11.12.2 Timing of Output Protection Operation ....................................................................284
11.12.3 Example of Output Protection Settings ...................................................................285
11.13 Timer Interrupt Output Control...........................................................................................287
11.13.1 Function of Timer Interrupt Output Control..............................................................287
11.13.2 Timing of Timer Interrupt Output Control Operation ................................................288
11.13.3 Example of Timer Interrupt Output Control Setting .................................................289
11.14 A/D Converter Start ...........................................................................................................291
11.14.1 Function of A/D Converter Start ..............................................................................291
11.14.2 Timing of A/D Conversion Start Operation ..............................................................291
11.14.3 Example of A/D Converter Setting ..........................................................................292
11.15 Cascade Connection .........................................................................................................294
11.15.1 List of Cascade Connection Timer Functions..........................................................295
11.15.2 Function of Cascade Connection Timer ..................................................................296
11.15.3 Timing of Cascade Connection Timer Operation.....................................................298
11.15.4 Example of Cascade Connection Timer Setting......................................................300
11.16 Phase Complementary PWM Output ................................................................................302
11.16.1 Function of Phase Complementary PWM Output ...................................................302
11.16.2 Timing of Phase Complementary PWM Output Operation......................................303
11.16.3 Example of Phase Complementary PWM Output Setting .......................................304
11.17 Dead Time .........................................................................................................................306
11.17.1 Function of Dead Time ............................................................................................306
11.17.2 Timing of Dead Time Operation...............................................................................307
11.17.3 Function of Dead Time Width Automatic Control ....................................................308
11.17.4 Timing of Dead Time Width Automatic Control Operation.......................................308
11.17.5 Example of Dead Time Setting................................................................................309
11.18 Output Shift........................................................................................................................311
11.18.1 Function of Output Shift...........................................................................................311
11.18.2 Timing of Output Shift Operation .............................................................................312
11.18.3 Example of Output Shift Setting ..............................................................................313
11.19 Duty Cut.............................................................................................................................315
11.19.1 Function of Duty Cut................................................................................................315
11.19.2 Timing of Duty Cut Operation ..................................................................................316
11.19.3 Example of Duty Cut Setting ...................................................................................317
11.20 Period cut ..........................................................................................................................319
11.20.1 Function of Period Cut.............................................................................................319
11.20.2 Timing of Period Cut Operation ...............................................................................320
11.20.3 Example of Period Cut Setting ................................................................................321
11.21 Leading Edge Blanking......................................................................................................323
11.21.1 Function of Leading Edge Blanking.........................................................................323
11.21.2 Timing of Leading Edge Blanking Operation ...........................................................324
KM1M4BF02/03/04/05 Series
KM1M4BF52/53/54 Series
KM1M4BF02/03/04/05 Series KM1M4BF52/53/54 Series Technical Reference
Manual Vol. 1
May 15.2023 Page 9 of 671 Ver 1.03
11.21.3 Example of Leading Edge Blanking Setting ............................................................325
11.22 Chopping Control...............................................................................................................327
11.22.1 Function of Chopping Control..................................................................................327
11.22.2 Timing of Chopping Control Operation ....................................................................328
11.22.3 Example of Chopping Control Setting .....................................................................329
11.23 Task Overflow Detection....................................................................................................331
11.23.1 Function of Task Overflow Detection.......................................................................331
11.23.2 Timing of Task Overflow Detection Operation .........................................................332
11.23.3 Example of Task Overflow Detection Setting ..........................................................333
12. Power Control PWM ........................................................................ 335
12.1 Overview of Power Control PWM........................................................................................336
12.1.1 List of Power Control PWM Functions ......................................................................337
12.1.2 List of Power Control PWM Clock Sources...............................................................338
12.1.3 List of Power Control PWM Interrupt Groups............................................................338
12.1.4 List of Power Control PWM Ports..............................................................................339
12.1.5 Power Control PWM Block Diagram .........................................................................340
12.2 Control Registers for Power Control PWM..........................................................................341
12.3 Basic Operation of Power Control PWM .............................................................................349
12.3.1 Waveform Mode ........................................................................................................349
12.3.2 GPWM Cycle Setting ................................................................................................351
12.3.3 GPWM Output Start and Stop...................................................................................351
12.3.4 Output Waveform Polarity .........................................................................................352
12.3.5 Double Buffer ............................................................................................................353
12.3.6 Double Buffer Load Timing........................................................................................354
12.4 Dead Time Setting Function ................................................................................................356
12.4.1 Details of Dead Time Setting Function......................................................................356
12.4.2 Dead Time Period Auto Control Function..................................................................358
12.5 "H"/"L" Level Output Function .............................................................................................359
12.5.1 Setting "H"/"L" Level Output Function .......................................................................359
12.5.2 Inserting Dead Time When Outputting "H"/"L" Levels...............................................361
12.6 Output Shift Function...........................................................................................................362
12.6.1 Details of Output Shift Function ................................................................................362
12.7 Interrupt Output Control Function........................................................................................363
12.7.1 Details of Interrupt Output Control Function..............................................................363
12.8 Output Protection Function..................................................................................................365
12.8.1 Details of Output Protection Function .......................................................................365
12.9 Synchronous A/D Conversion Start Function......................................................................368
12.9.1 Details of Synchronous A/D Conversion Start Function............................................368
12.10 Count State Output Function.............................................................................................370
12.10.1 Details of Count State Output Function...................................................................370
12.11 Pin Output Order Selection................................................................................................371
12.11.1 Details of Pin Output Order Selection .....................................................................371
12.12 Duty Cut Function..............................................................................................................372
KM1M4BF02/03/04/05 Series
KM1M4BF52/53/54 Series
May 15.2023 Page 10 of 671 Ver 1.03
KM1M4BF02/03/04/05 Series KM1M4BF52/53/54 Series Technical Reference
Manual Vol. 1
12.12.1 Details of Duty Cut Function ...................................................................................372
12.12.2 The Operation Timing of Duty Cut Function............................................................373
12.13 Period Cut Function...........................................................................................................374
12.13.1 Details of Period Cut Function ................................................................................374
12.13.2 The Operation Timing of Period Cut Function.........................................................375
13. Serial Interface................................................................................. 377
13.1 Overview of Serial Interface ................................................................................................378
13.1.1 List of Serial Interface Functions...............................................................................378
13.1.2 List of Serial Interface Interrupt Groups ....................................................................380
13.1.3 List of Serial Interface Ports ......................................................................................381
13.2 Serial Interface Control Registers .......................................................................................384
13.3 Clock Specification ..............................................................................................................392
13.3.1 Clock Source.............................................................................................................394
13.3.2 Transfer Clock of Clock-Synchronous Communication.............................................395
13.3.3 Transfer Clock of UART ............................................................................................396
13.3.4 Transfer Clock of IIC .................................................................................................396
13.4 Clock-Synchronous Communication ...................................................................................399
13.4.1 Communication Function of Clock-Synchronous ......................................................399
13.4.2 Communication Timing of Clock-Synchronous ........................................................412
13.4.3 Example of Clock-Synchronous Communication Setting..........................................417
13.5 UART Communication.........................................................................................................424
13.5.1 Communication Functions of UART..........................................................................424
13.5.2 Communication Timing of UART ..............................................................................431
13.5.3 Example of UART Communication Setting ..............................................................433
13.6 IIC Communication..............................................................................................................437
13.6.1 Communication Function of IIC.................................................................................437
13.6.2 IIC Communication Flowchart ...................................................................................446
13.6.3 Example of IIC Communication Setting ...................................................................457
13.6.4 Access Timing of IIC .................................................................................................484
14. A/D Converter .................................................................................. 485
14.1 Overview of A/D Converter..................................................................................................486
14.1.1 List of A/D Converter Functions ................................................................................486
14.1.2 List of A/D Conversion Clocks...................................................................................487
14.1.3 List of A/D Converter Interrupt Groups......................................................................487
14.1.4 List of A/D Converter Ports .......................................................................................488
14.1.5 A/D Converter Block Diagram ...................................................................................490
14.2 A/D Converter Control Registers.........................................................................................491
14.3 A/D Converter Functions .....................................................................................................497
14.3.1 A/D Conversion Operation ........................................................................................497
14.3.2 A/D Conversion Time ................................................................................................499
14.3.3 A/D Conversion Mode ...............................................................................................503
14.3.4 Conversion Start Trigger Reduction Function ...........................................................505
14.3.5 A/D Conversion Error Detection Function .................................................................506
KM1M4BF02/03/04/05 Series
KM1M4BF52/53/54 Series
KM1M4BF02/03/04/05 Series KM1M4BF52/53/54 Series Technical Reference
Manual Vol. 1
May 15.2023 Page 11 of 671 Ver 1.03
14.3.6 A/D Fault Check Function .........................................................................................507
14.4 Examples of the A/D Converter Settings.............................................................................508
14.4.1 Example of the One-time Conversion Mode settings................................................508
14.4.2 Example of the Continuous Conversion Mode settings ............................................510
14.4.3 Example of Multi A/D Converter Concurrent Conversion settings. ...........................512
14.5 Notes on Using the A/D Converter ......................................................................................515
14.5.1 Anti-noise Measures .................................................................................................515
14.5.2 Recommended Circuit for Using the A/D Converter .................................................515
15. D/A Converter .................................................................................. 517
15.1 Overview of D/A Converter..................................................................................................518
15.1.1 List of D/A Converter Functions ................................................................................518
15.1.2 List of D/A Converter Port .........................................................................................518
15.1.3 D/A Converter Block Diagram ...................................................................................519
15.2 Control Registers of D/A Converter.....................................................................................520
15.3 D/A Converter Functions .....................................................................................................521
15.3.1 Operation of D/A Conversion ....................................................................................521
16. Comparator ...................................................................................... 523
16.1 Overview of Comparator .....................................................................................................524
16.1.1 List of Comparator Functions ....................................................................................524
16.1.2 List of Comparator Interrupt Groups .........................................................................525
16.1.3 List of Comparator Ports ...........................................................................................526
16.1.4 Comparator Block Diagram.......................................................................................527
16.2 Control Registers of Comparator.........................................................................................528
16.3 Details of Comparator .........................................................................................................529
16.3.1 Specification of Comparator......................................................................................529
16.3.2 Setting Example of Comparator ................................................................................534
17. VGA (Variable Gain Amplifier)........................................................ 535
17.1 Overview of VGA.................................................................................................................536
17.1.1 List of VGA Functions ...............................................................................................536
17.1.2 List of VGA Ports.......................................................................................................536
17.1.3 List of VGA Output ....................................................................................................537
17.1.4 VGA Block Diagram ..................................................................................................537
17.2 Control Registers of VGA ....................................................................................................538
17.3 Details of VGA.....................................................................................................................539
17.3.1 Specification of VGA .................................................................................................539
17.3.2 Setting Example of VGA ...........................................................................................545
17.3.3 Setting Example of VGA Channel Round Function...................................................546
17.3.4 Cautions of VGA .......................................................................................................548
18. Multi Feedback Assist..................................................................... 549
18.1 Overview of Multi Feedback Assist Functions.....................................................................550
18.1.1 List of the Multi Feedback Assist Functions ..............................................................550
KM1M4BF02/03/04/05 Series
KM1M4BF52/53/54 Series
May 15.2023 Page 12 of 671 Ver 1.03
KM1M4BF02/03/04/05 Series KM1M4BF52/53/54 Series Technical Reference
Manual Vol. 1
18.1.2 Block Diagrams of Multi Feedback Assist Functions ................................................551
18.2 Control Registers for Multi Feedback Assist Functions.......................................................554
18.3 Synchronous Start Control Function ...................................................................................559
18.3.1 Specifications of Synchronous Start Control Function ..............................................559
18.3.2 Operation Timing of Synchronous Start Control Function.........................................560
18.3.3 Setting Example of Synchronous Start Control Function ..........................................561
18.4 Conflict Detection/Auto Avoidance Functions .....................................................................562
18.4.1 Specifications of Conflict Detection/Auto Avoidance Functions ................................562
18.4.2 Operation Timing of Conflict Detection/Auto Avoidance Functions...........................565
18.4.3 Setting Example of Conflict Detection/Auto Avoidance Functions ............................566
18.5 Blanking Function................................................................................................................568
18.5.1 Specifications of Blanking Function ..........................................................................568
18.5.2 Operation Timing of Blanking Function .....................................................................569
18.5.3 Setting Example of Blanking Function ......................................................................570
19. Power Supply Voltage Detection.................................................... 571
19.1 Overview of Power Supply Voltage Detection .....................................................................572
19.2 Power Supply Voltage Detection Control Register ..............................................................572
19.3 Detail of Power Supply Voltage Detection...........................................................................573
19.3.1 Specification of Power Supply Voltage Detection .....................................................573
19.3.2 Setting Examples of Power Supply Voltage Detection..............................................575
20. Watchdog Timer............................................................................... 577
20.1 Overview of Watchdog Timer ..............................................................................................578
20.1.1 List of Watchdog Timer Functions.............................................................................578
20.1.2 List of Watchdog Timer Interrupt Group ....................................................................578
20.1.3 Watchdog Timer Block Diagram................................................................................579
20.2 Watchdog Timer Control Registers .....................................................................................580
20.3 Detail of Watchdog Timer ....................................................................................................581
20.3.1 Specification of Watchdog Timer Overflow Detect Function .....................................581
20.3.2 Setting Example of Watchdog Timer Overflow Detect Function ...............................587
21. CRC Calculation Circuit.................................................................. 589
21.1 Overview of CRC Calculation Circuit...................................................................................590
21.1.1 List of CRC Calculation Circuit..................................................................................590
21.1.2 Block Diagram of CRC Calculation Circuit ................................................................591
21.2 Control Registers of CRC Calculation Circuit......................................................................593
21.3 Setting Example of CRC Calculation Circuit .......................................................................594
22. Clock Monitoring Circuit................................................................. 595
22.1 Overview of Clock Monitoring Function...............................................................................596
22.1.1 Outline Specification of Clock Monitoring Function...................................................596
22.1.2 Outline of Clock Monitoring Interrupt Group..............................................................597
22.1.3 Clock Monitoring Function Block Diagram ................................................................597
KM1M4BF02/03/04/05 Series
KM1M4BF52/53/54 Series
KM1M4BF02/03/04/05 Series KM1M4BF52/53/54 Series Technical Reference
Manual Vol. 1
May 15.2023 Page 13 of 671 Ver 1.03
22.2 Clock Monitoring Control Register.......................................................................................598
22.3 Detail of Clock Monitoring Function.....................................................................................599
22.3.1 Specification of Clock Monitoring Function ...............................................................599
22.3.2 Setting Example of Clock Monitoring Function .........................................................603
23. Internal Flash Memory .................................................................... 615
23.1 Overview of Internal Flash Memory.....................................................................................616
23.1.1 Outline Specification of Internal Flash Memory.........................................................616
23.1.2 Flash Memory Rewriting Method ..............................................................................617
23.1.3 Flash Memory Area...................................................................................................618
23.1.4 Data Protection Function...........................................................................................619
23.1.5 Program Area Swap Function ...................................................................................620
23.1.6 Boot Area Swap Function .........................................................................................624
23.2 Flash Memory Control Registers.........................................................................................627
23.3 Rewriting Function...............................................................................................................629
23.3.1 Execution Method for Rewriting ................................................................................629
23.3.2 Procedures for Rewriting...........................................................................................630
23.3.3 Details of Rewriting Commands................................................................................631
23.4 Cache ..................................................................................................................................634
24. Debug Interface ............................................................................... 635
24.1 Overview of Debug Interface...............................................................................................636
24.1.1 Port List of Debug Interface ......................................................................................636
24.2 Control Register of Debug Interface ...................................................................................637
24.3 Setting of Trace Clock .........................................................................................................637
24.4 Pin Connection of Serial Programmer / On-board Debugger..............................................638
KM1M4BF02/03/04/05 Series
KM1M4BF52/53/54 Series
May 15.2023 Page 14 of 671 Ver 1.03
KM1M4BF02/03/04/05 Series KM1M4BF52/53/54 Series Technical Reference
Manual Vol. 1
1. Overview
KM1M4BF02/03/04/05 Series
KM1M4BF52/53/54 Series
KM1M4BF02/03/04/05 Series KM1M4BF52/53/54 Series Technical Reference
Manual Vol. 1
May 15.2023 Page 15 of 671 Ver 1.03
1.1 Overview
This LSI is a 32-bit microcontroller with internal Flash memory. It is intended for development of
the C programming language with object-oriented program and is easy to use. It has fast feedback
processing required for control of motor.
This LSI adopts the Arm Cortex-M4F to the 32-bit microcontroller part and are equipped with internal
memory to instruction / data, DMA controller, clock generator, bus controller, interrupt controller, stand-
ard peripheral circuits (timer and serial interface and so on), PWM control circuit specialized for motor
control, and high accuracy / high speed analog circuit.
As system safety design, this LSI has the various safety mechanisms (Memory-ECC, clock error
detection, power supply voltage detection, window watchdog timer, etc.).
1.2 Product Summary
The LSI shown in Table Table 1.2-1 is described in this manual.
Table 1.2-1 Product Summary
LSI series LSI product name Pins ROM [KB] RAM [KB] Package
Instruction Data Data
KM1M4BF0
series
KM1M4BF02K 100 264 32
16
14 mm x 14 mm 0.5mm pitch
KM1M4BF02G 136 8
KM1M4BF03K 80 264 32 12 mm x 12 mm 0.5mm pitch
KM1M4BF03G 136 8
KM1M4BF04K 64 264 32 10 mm x 10 mm 0.5mm pitch
KM1M4BF04G 136 8
KM1M4BF05G 48 136 8 7 mm x 7 mm 0.5mm ptich
KM1M4BF5
series
KM1M4BF52K 100 264 32
16
14 mm x 14 mm 0.5mm pitch
KM1M4BF52G 136 8
KM1M4BF53K 80 264 32 12 mm x 12 mm 0.5mm pitch
KM1M4BF53G 136 8
KM1M4BF54K 64 264 32 10 mm x 10 mm 0.5mm pitch
KM1M4BF54G 136 8
Hint:
In this manual, the product names are classified as follows.
KM1M4BFxyz ( x = 0,5  y = 2,3,4,5   z = K,G )
Hint:
The difference between the KM1M4BF0 series and the KM1M4BF5 series is the allocation pins of
the debug function (SWDCLK, SWDD).
KM1M4BF02/03/04/05 Series
KM1M4BF52/53/54 Series
May 15.2023 Page 16 of 671 Ver 1.03
KM1M4BF02/03/04/05 Series KM1M4BF52/53/54 Series Technical Reference
Manual Vol. 1
1.2.1 Function Summary
Table 1.2-2 shows the functions of each product.
Table 1.2-2 The List of Function
Function 100 pins 80 pins 64 pins 48 pins
CPU Arm Cortex-M4F
General purpose pin 85 65 51 37
Operation mode Active mode NORMAL
Standby mode SLEEP, DEEPSLEEP
Debugger I/F Interface SWD
DMA CH number 8
Interrupt External interrupt 26 18
Timer
16-bit timer
(timer 0 to 7, 10 to 15) 14
Power control PWM
(GPWM0 to 7) 8
Noise filter Target pin External interrupt, Timer input
Communication I/F
Clock synchronous/
SPI/UART/IIC
(serial 0 to 6)
7 4
12-bit A/D
AD0 CH number 11 9
AD1 CH number 12 11 10
AD2 CH number 14 9 7 5
Total CH number 23 18 13 10
Programmable gain
amplifier(VGA)
Module number/CH num-
ber 2 / 6
Comparator Module number/CH num-
ber 4 / 2
8-bit D/A Module number 6
10-bit D/A CH number 1
Safety function
Flash memory ECC, Data protection
RAM ECC
Access area MPU (Area management, Protection),
Register protect (Protection)
System Window watchdog timer
Clock Clock monitoring (External oscillation, PLL error detection)
Communication CRC caluculation function
A/D converter A/D converter error detection
Power supply voltage POR, Power supply voltage detection
Reset Detection of reset factor immediately before
by reset factor register
KM1M4BF02/03/04/05 Series
KM1M4BF52/53/54 Series
KM1M4BF02/03/04/05 Series KM1M4BF52/53/54 Series Technical Reference
Manual Vol. 1
May 15.2023 Page 17 of 671 Ver 1.03
1.3 Features
The features of this LSI are described.
機能 特長
CPU
- Arm Cortex-M4F
 Equipped with FPU: Single precision floating point unit, IEEE754 compliant
 Equipped with MPU: Memory protect unit, 8 area can be set
Memory
- ROM access
 I-FLASH: 120 MHz 2 wait access(Min), selectable from 2 to 7
 D-FLASH: 120 MHz 5 wait access(Min), selectable from 2 to 7
- RAM access
 120 MHz 0 wait access
- Swap Function
I-Flash: Supports swap function of Boot area and Program area
Clock
- HXOCLK (External oscillation) frequency: 4 to 20 MHz
- HRCCLK (Internal high-speed oscillation) frequency : 10 MHz
- PLLCLK
 PLL Input: External high-speed oscillation
 PLL Input frequency: 4 MHz to 20 MHz
 PLL Output frequency: 120 MHz to 240MHz
- BASECLK
 Selectable from HRCCLK/HXOCLK/PLLCLK
 Start with Internal high-speed oscillation when reset is released
 Switchable to HRCCLK when a clock error is detected
- CPUCLK
 1 to 8 dividing of BASECLK
- IOCLK
 2 to 16 dividing of CPUCLK
 Clock operation/stop can be selected for each peripheral module
Reset
- Hardware reset
 Power-On Reset
- System Reset
 Reset by external pin(NRST)
 Reset by register setting
 Reset by error detection(WDT overflow, Clock error detection)
- CPU Generation Reset
 Reset by writing to AIRCR
- Reset factor can be monitored
Low power consump-
tion
- SLEEP mode: Stop CPU clock only
- DEEP SLEEP mode: Stop clocks including BASECLK
Interrupt
- Interrupt level: 16 levels
- External interrupt:
 High/Low level, Rising/Falling/Both edge
DMA
- Transfer mode: Single word transfer mode, Burst transfer mode
- Transfer unit: 8 bits/16 bits/32 bits
- Maximum transfer count: 65535 words
- Transfer factor: External interrupt, Peripheral module factor
- Register reload count: Maximum 65535 times
- Interrupt: DMA completion, reload count completion, bus error, transfer request overflow,
invalid DMA transfer request
Noise filter - Sampling type noise filter is inserted to external interrupt and timer input.
- Select sampling clock
KM1M4BF02/03/04/05 Series
KM1M4BF52/53/54 Series
May 15.2023 Page 18 of 671 Ver 1.03
KM1M4BF02/03/04/05 Series KM1M4BF52/53/54 Series Technical Reference
Manual Vol. 1
機能 特長
16-bit timer
- Interval timer count, Event count, Up-down pulse count, Phase difference pulse count
- Timer Output, PWM/complement Output(wave mode: saw-tooth waves), 1-shot Output, Chopping
waveform Output
- Input capture by external input
- Timer count start by start trigger
- A/D conversion start trigger Output
- 32-bit cascade connection
- Output protection: H/L/Hi-z Output can be selected, reading edge blanking can be set
- Timer interrupt Output control
- Task overflow detection function
- PWM Output: Dead time insert, Output shift, Duty cut, Period cut
Power control PWM
- Complementary PWM Output (Wave mode: Triangular and saw-tooth waves)
- Dead time insert, Output shift, H/L level Output can be set
- Synchronous A/D conversion trigger
- Interrupt Output control
- Output protection: H/L/Hi-z Output can be select
- Duty cut, period cut
- Double buffer update
Synchronous SIF/SPI
- 2-wire/3-wire/4-wire
- Transfer bits(2 bits to 8 bits)
- MSB/LSB transfer
- Clock polarity selection
- Continuous communication
- Output level after the final bit transmission(H/L/final data)
- Maximum transfer rate: 10 Mbps (at master) / 5 Mbps (at slave)
UART
- 1-wire/2-wire
- Character bits(5-bits to 8-bits)
- Stop bits(1-bit/2-bit)
- Parity bit: Enabled/Disabled, Parity bit type: 0/1/Even parity/Odd parity
- MSB/LSB transfer
- Maximum transfer rate: 3.3 Mbps
IIC
- Master/Slave communication
- Start condition selection: Enable/Disable
- MSB/LSB transfer selection
- Transfer format: 7-bit address format, 10-bit address format
- Maximum transfer rate: Standard Mode: 100 kbps, Fast Mode: 400 kbps,
Fast Mode Plus: 1 Mbps
12-bit A/D
- Timer 0 to 7, Timer 10 to 15, GPWM0 to 7 etc can be started synchronously
- Conversion error detection
- Conversion state Output
- Start trigger reduction function
VGA - Gain selection(2, 3, 4, 5, 6, 8, 10, 20 times)
- Set Output reference voltage by 8-bit DAC
Comparator
- Hysteresis ON/OFF
- Set reference voltage by 8-bit DAC
- Sampling type noise filter is inserted to comparator Output
- Detection mode can be selected from 1 level / 2 levels or window detection mode
8-bit D/A - VGA Output reference voltage can be generated
- Comparator reference voltage can be generated
10-bit D/A - Output the set DC voltage
Multi feedback assist
- Set the start timing of timer 0 to 7, and GPWM 0 to 7 individually
- Detect/Automatically avoid the competition of timer 0 to 7 and GPWM 0 to 7 and AD conversion
start
- Mask(Blanking) the external interrupt detection, comparator of timer 0 to 7 and GPWM 0 to 7 Output
KM1M4BF02/03/04/05 Series
KM1M4BF52/53/54 Series
KM1M4BF02/03/04/05 Series KM1M4BF52/53/54 Series Technical Reference
Manual Vol. 1
May 15.2023 Page 19 of 671 Ver 1.03
機能 特長
CRC caluculation - CRC-32/MPEG2, CRC-16-CCITT, CRC-8-ATM symbol can be generated
Safety function
- ECC function
 Check area: I-FLASH, D-FLASH, RAM
 2 bit random error detection
- Flash Erase/Program protect function
- Function to protect write access to main register
- Clock monitor function
- Window watchdog timer(internal oscillation count)
- Power supply voltage detection
- ADC fault diagnosis function which is used for internal power supply
KM1M4BF02/03/04/05 Series
KM1M4BF52/53/54 Series
May 15.2023 Page 20 of 671 Ver 1.03
KM1M4BF02/03/04/05 Series KM1M4BF52/53/54 Series Technical Reference
Manual Vol. 1
/