Complete Guide to Selecting Hangshun MCUs for Your Application
Selecting the right microcontroller is critical for project success. This guide provides a systematic approach to Hangshun MCU selection.
Understanding Your Requirements
before selecting an MCU, clearly define: Performance requirements (MIPS, clock speed); Memory needs (Flash and SRAM); Peripheral requirements (interfaces, ADC, timers); Power constraints (active and sleep current); Cost targets (BOM and development); Environmental conditions (temperature, reliability).
Hangshun MCU Portfolio Overview
General Purpose MCUs (HS32F1xx/HS32F4xx): Cortex-M0/M3/M4 cores; 32KB-1MB Flash; Rich peripheral set; Best for: Industrial control, consumer electronics, general embedded.
Touch Control MCUs (HS32T0xx): Integrated capacitive touch; 6-24 channels; Water rejection technology; Best for: Home appliances, HMI panels, consumer devices.
Motor Control MCUs (HS32M1xx/HS32M2xx): Dedicated motor control peripherals; FOC algorithm support; Integrated gate drivers; Best for: BLDC drives, servo systems, power tools.
Wireless MCUs (HS32B1xx/HS32S1xx): BLE 5.0 or Sub-1GHz; Ultra-low power; Integrated protocol stacks; Best for: IoT sensors, smart home, asset tracking.
Selection Decision Tree
step 1: Application Category - Touch interface required? �?Touch Control MCU; Motor control needed? �?Motor Control MCU; Wireless connectivity? �?Wireless MCU; General processing? �?General Purpose MCU.
Step 2: Performance Level - Basic control (simple loops): Cortex-M0 @ 48MHz; Medium complexity (multiple tasks): Cortex-M3 @ 72MHz; High performance (DSP, complex algorithms): Cortex-M4 @ 168MHz with FPU.
Step 3: Memory Sizing - Small applications: 32-64KB Flash, 4-8KB SRAM; Medium applications: 128-256KB Flash, 16-32KB SRAM; Large applications: 512KB-1MB Flash, 64-128KB SRAM.
Step 4: Peripheral Requirements - List all required interfaces; Check pin availability in target package; Consider future expansion needs; Verify special features (USB, Ethernet, CAN).
Cost Optimization Strategies
select minimum viable MCU for application; Use internal oscillators where precision allows; Leverage integrated peripherals to reduce external components; Consider package size vs. PCB cost trade-offs; Plan for volume pricing tiers.
Migration Considerations
hangshun MCUs are pin-compatible with STM32 in many cases; Software migration using HAL libraries; Register-level compatibility for direct porting; Migration guides available from BeiLuo FAE.
Getting Started
after selection: Order development kit; Download SDK and documentation; Review application notes; Contact FAE for design review support.
💡 FAE Insights
📋 Customer Cases
Industrial Automation Company
Industrial Control
Challenge
Customer was over-specifying MCU requirements, planning to use expensive Cortex-M4 MCU for basic control application
Solution
FAE reviewed application requirements and recommended HS32F103C8T6 Cortex-M3 MCU instead.
Customer Feedback
"The FAE's recommendation was spot-on - we were about to over-engineer our design. The HS32F103C8T6 handled all our requirements perfectly at a much lower cost. BeiLuo's support throughout the design process was excellent."
Frequently Asked Questions
1. How do I determine the right memory size for my application?
Memory sizing involves estimating code and data requirements: Flash memory - Calculate application code size (include libraries, RTOS if used); Add margin for future firmware updates (typically 20-30%); Consider bootloader requirements; Example: 50KB code + 20KB libraries + 30% margin = 91KB �?select 128KB Flash part. SRAM - Stack usage: 1-4KB depending on call depth; Heap: If using dynamic allocation; Global variables and buffers; RTOS requirements: 2-10KB; Example: 2KB stack + 8KB heap/globals + 4KB RTOS = 14KB �?select 20KB SRAM part. Tips: Start with evaluation kit and check actual memory usage; Use compiler optimization to reduce code size; Consider external memory for large data buffers.
2. When should I choose Cortex-M4 over Cortex-M3?
Choose Cortex-M4 when your application requires: DSP capabilities - Signal processing algorithms; FFT, filtering operations; Audio processing; Motor control with complex algorithms. Floating-point operations - Mathematical calculations; Sensor fusion; Control algorithms with real numbers. Higher performance - Complex real-time processing; Multiple concurrent tasks; Graphics or UI rendering. The FPU (Floating-Point Unit) in Cortex-M4 provides 10-20x speedup for floating-point calculations vs. software emulation. For general control applications without these requirements, Cortex-M3 offers better cost-effectiveness. The HS32F103 (Cortex-M3) and HS32F405 (Cortex-M4) are pin-compatible in many packages, allowing easy migration if performance needs change.
3. What peripherals are essential for industrial applications?
Industrial applications typically require these peripherals: Communication - UART: Modbus, HMI communication; SPI: Sensor interfaces, external Flash; I2C: EEPROM, sensors; CAN: Industrial networks, vehicle communication; Ethernet: Network connectivity (if available). Analog - ADC: Sensor reading, monitoring; 12-bit minimum, 16-bit preferred; Multiple channels for multi-sensor systems; DAC: Analog output control (if needed). Timers - PWM: Motor control, power conversion; Input capture: Speed measurement, timing; Watchdog: System reliability. Protection - Brown-out detection; Clock security; Temperature sensor. The HS32F103 series includes all these peripherals, making it suitable for most industrial applications.
4. How do I migrate from STM32 to Hangshun MCUs?
Migration from STM32 to Hangshun is straightforward due to compatibility: Pin compatibility - Many Hangshun MCUs are pin-to-pin compatible with STM32; Check pinout tables for exact mapping. Software compatibility - Hangshun HAL library follows STM32 HAL structure; Similar APIs and register structures. Migration steps: Replace STM32 HAL with Hangshun HAL; Update clock configuration; Adjust linker scripts; Test timing-critical code. Tools: Use same Keil/IAR/GCC toolchains; Same debuggers (ST-Link, J-Link). Support: BeiLuo provides migration guides; FAE assistance available. Typical migration effort: 1-2 weeks for established projects.
5. What development tools do I need for Hangshun MCUs?
Required development tools: IDE - Keil MDK-ARM (recommended), IAR Embedded Workbench, or STM32CubeIDE with GCC. Debugger - HS-Link (Hangshun), ST-Link/V2, J-Link, or ULINK; SWD interface support. Development Kit - Evaluation board for target MCU; Power supply and cables. Software - Hangshun HAL library; Example code and documentation; Flash programming utilities. Optional - Logic analyzer for debugging; Oscilloscope for analog signals; Protocol analyzers for communication. BeiLuo provides complete development kits with all necessary hardware and software.