BP45F4NB/BP45FH4NBBP45F4NB/BP45FH4NBPower Bank Flash MCUPower Bank Flash MCUBlock Diagram D1+ ~ D2+ USB D1 & D2 D1+ ~ D2+ 2 USB Detectors Analog to Digital IAP Pin-Shared Converter With Port D 12-bit AN0~AN10 ADC OCPnAO Reset ROM RAM Pin-shared with Port A, C & D Circuit 4K × 16 256 × 8 VDD VREF INT0~ Interrupt Stack OPA 1.2V INT1 Controller Pin-shared 8-level LVD/LVR with Port A Pin-shared Analog Peripheral with Port C Watchdog Timer OUVP OCP AX/BX Level 8-bit MCU Core s 5V LDO Bu Shift Protection Circuits CX/DX SYSCLK For BP45FH4NB only PWMH PWM + 80mA Dead Time MOS Driver Time PWML Bases LIRC 32kHz MUX PWM Pin-shared Pin-Shared HIRC with Port B With Port D 30MHz 10-bit PTM Port A PA0~PA3, Driver PA6~PA7 VDDIO V Clock System DDIO 10-bit STM Port B PB0~PB7 Driver Pin-shared Function Port C VDD/AVCC VDD/AVCC * PC0~PC5 Driver USIM VSS/AVSS V Port D SS/AVSS PD2~PD7 Driver I/O Digital Peripherals :Pin-share node *:USIM including SPI, I2C & UART Pin Assignment PA0/CTCK1/ICPDA/OCDSDA 1 24 PB0/PWMH PA2/PTCK/ICPCK/OCDSCK 2 23 PB1/PWML PC5/INT1/CTCK0 3 22 VDD/AVCC PB7/SCS/UVPO 4 21 VSS/AVSS PB4/SCK/SCL 5 20 PC2/OCP1I PB5/SDI/SDA/URX/UTX 6 19 PC0/OCP0I PB6/SDO/UTX 7 18 PA1/AN9/BATV PD4/AN0/D1+/SCK/SCL 8 17 PA3/AN7 PD5/AN1/D1-/SDI/SDA/URX/UTX 9 16 PD3/CTP1/OCP0COUT PD6/AN2/D2+/SDO/UTX 10 15 PA7/AN4/VREF PD7/AN3/D2-/SCS 11 14 PA6/AN10/OUVPI PD2/VDDIO/OVPO 12 13 PC4/INT0/AN5/CTP0 BP45F4NB/BP45V4NB24 SSOP-A Rev. 1.00 8 December 07, 2020 Rev. 1.00 9 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