BP45F4NB/BP45FH4NBBP45F4NB/BP45FH4NBPower Bank Flash MCUPower Bank Flash MCUFeaturesCPU Features • Operating voltage ♦ fSYS=7.5MHz: 2.6V~5.5V ♦ fSYS=15MHz: 3.3V~5.5V • Up to 0.27μs instruction cycle with 15MHz system clock at VDD=5V • Power down and wake-up functions to reduce power consumption • Oscillator types: ♦ Internal High Speed 30MHz RC – HIRC ♦ Internal Low Speed 32kHz RC – LIRC • Multi-mode operation: FAST, SLOW, IDLE and SLEEP • Fully integrated internal oscillators require no external components • All instructions executed in 1~3 instruction cycles • Table read instructions • 115 powerful instructions • 8-level subroutine nesting • Bit manipulation instruction Peripheral Features • Flash Program Memory: 4K×16 • Data Memory: 256×8 • Watchdog Timer function • In Application Programming – IAP • Up to 26 bidirectional I/O lines • Two pin-shared external interrupts • Multiple Timer Modules for time measurement, compare match output or PWM output or single pulse output function • One complementary PWM output with dead time control • Two over current protections (OCPn) with interrupt • Over/Under voltage protection (OUVP) with interrupt • USB charge/discharge auto detection function • Dual Time-Base functions for generation of fixed time interrupt signals • 11 external channel 12-bit resolution A/D converter with an internal reference voltage VVR • Universal Serial Interface Module – USIM for SPI, I2C or UART communication • Low voltage reset function • Low voltage detect function • One integrated LDO: 5V output − BP45FH4NB only • 2 level shift output pins − BP45FH4NB only • Package types: 24/28-pin SSOP, 28-pin QFN Rev. 1.00 6 December 07, 2020 Rev. 1.00 7 December 07, 2020 Document Outline Features CPU Features Peripheral Features General Description Selection Table Block Diagram Pin Assignment Pin Description Level Shift Input/Output Relationship and Reset Condition Absolute Maximum Ratings D.C. Characteristics Operating Voltage Characteristics Operating Current Characteristics Standby Current Characteristics A.C. Characteristics High Speed Internal Oscillator – HIRC – Frequency Accuracy Low Speed Internal Oscillator Characteristics – LIRC Operating Frequency Characteristic Curves System Start Up Time Characteristics Input/Output Characteristics Input/Output (without Multi-power) D.C Characteristics Input/Output (with Multi-power) D.C Characteristics Memory Characteristics LVR/LVD Electrical Characteristics A/D Converter Electrical Characteristics Over/Under Voltage Protection Electrical Characteristics Over Current Protection Electrical Characteristics USB Auto Detection Electrical Characteristics LDO Regulator Electrical Characteristics Level Converter Electrical Characteristics Power-on Reset Characteristics System Architecture Clocking and Pipelining Program Counter Stack Arithmetic and Logic Unit – ALU Flash Program Memory Structure Special Vectors Look-up Table Table Program Example In Circuit Programming – ICP On-Chip Debug Support – OCDS In Application Programming – IAP Data Memory Structure Data Memory Addressing General Purpose Data Memory Special Purpose Data Memory Special Function Register Description Indirect Addressing Registers – IAR0, IAR1, IAR2 Memory Pointers – MP0, MP1L/MP1H, MP2L/MP2H Accumulator – ACC Program Counter Low Byte Register – PCL Look-up Table Registers – TBLP, TBHP, TBLH Option Memory Mapping Register – ORMC Status Register – STATUS Oscillators Oscillator Overview System Clock Configurations Internal High Speed RC Oscillator – HIRC Internal 32kHz Oscillator – LIRC Operating Modes and System Clocks System Clocks System Operation Modes Control Registers Operating Mode Switching Standby Current Considerations Wake-up Watchdog Timer Watchdog Timer Clock Source Watchdog Timer Control Register Watchdog Timer Operation Reset and Initialisation Reset Functions Reset Initial Conditions Input/Output Ports Pull-high Resistors Port A Wake-up I/O Port Control Registers I/O Port Power Source Control I/O Port Source Current Control Pin-shared Functions I/O Pin Structure Programming Considerations Timer Modules – TM Introduction TM Operation TM Clock Source TM Interrupts TM External Pins Programming Considerations Compact Type TM – CTM Compact Type TM Operation Compact Type TM Register Description Compact Type TM Operating Modes Periodic Type TM – PTM Periodic Type TM Operation Periodic Type TM Register Description Periodic Type TM Operation Modes Complementary PWM Output with Dead Time Dead Time Insertion Complementary PWM Registers Analog to Digital Converter A/D Converter Overview A/D Converter Register Description A/D Converter Reference Voltage A/D Converter Input Signals A/D Converter Operation Conversion Rate and Timing Diagram Summary of A/D Conversion Steps Programming Considerations A/D Conversion Function A/D Conversion Programming Examples Universal Serial Interface Module – USIM SPI Interface I2C Interface UART Interface Over Current Protection Over Current Protection Operation Over Current Protection Registers Input Voltage Range OCP OPA and Comparator Offset Calibration Over/Under Voltage Protection OUVP Circuit Operation OUVP Register Description OVP and UVP Comparator Offset calibration USB Auto Detection D1+/D1- and D2+/D2- for Auto Detection USB Auto Detection Registers Interrupts Interrupt Registers Interrupt Operation External Interrupts A/D Converter Interrupt Over Current Protection Interrupt Over Voltage Protection Interrupt Under Voltage Protection Interrupts Multi-function Interrupts Timer Module Interrupts USIM Interrupt Time Base Interrupts LVD Interrupt Interrupt Wake-up Function Programming Considerations Low Voltage Detector – LVD LVD Register LVD Operation Application Circuits Instruction Set Introduction Instruction Timing Moving and Transferring Data Arithmetic Operations Logical and Rotate Operation Branches and Control Transfer Bit Operations Table Read Operations Other Operations Instruction Set Summary Table Conventions Extended Instruction Set Instruction Definition Extended Instruction Definition Package Information 24-pin SSOP (150mil) Outline Dimensions 28-pin SSOP (150mil) Outline Dimensions SAW Type 28-pin QFN (4mm×4mm) Outline Dimensions