![image.png]

# Preface
I find that I like the HK32F030MF4P6 MCU more and more (note that there is an M in the model, and the model without M is a completely different MCU). Although in this era of ARM and RISCV flying all over the sky, the HK32F030MF4P6, with a 32MHz main frequency, 2KB RAM, 16KB Flash, and even no DMA, is a bit shabby, but it has an advantage that other MCUs cannot match, that is, the ultra-low price (the price on Taobao is about 0.98 yuan/pcs when writing this article, and it can even be as low as 0.9 yuan/pcs if you buy it in a whole package). So the performance is the same as it is more expensive, and the price is lower than it. It has a higher configuration. . .
In some simple projects such as clocks, temperature-controlled fans, and RGB color light control, if you use STM32 or ESP32, it will feel like a cannon hitting a mosquito. So for this kind of project, I usually use 51 microcontrollers. 51 is really cheap and durable. But it is too old, the C language support of the development environment is not perfect, and debugging is not convenient. The HK32F030MF4P6 is a standard ARM Cortex-M0, although the configuration is low, that is relative to other ARM MCUs. ARM is much better than 51 in terms of development environment and third-party library support. Moreover, in terms of price, 51 with the same package has no advantage over it. So later in this kind of small control project, my MCU selection basically became HK32F030MF4P6.
To develop, you need a development board, but the price of Hangshun's official development board is really unreasonable (more than 60), and I have never seen it in stock... In previous development, I have always used the official open source STM8S003 development board of LiChuang ([C711822](https://item.szlcsc.com/750602.html)), and then replaced the STM8S with HK32F030MF4P6 (yes, these two are Pin2Pin compatible...). But this is not a long-term solution, so after a long time, I still drew such a development board by myself, so that it will be much more convenient to develop in the future. Now I have also open sourced it. If any friends are also using this MCU, then I hope that my development board can help you.
# Introduction
This is a development board/evaluation board based on Hangshun HK32F030MF4P6. It can be used to develop and evaluate applications based on HK32F030MF4P6. The development board has DAPLink (based on the hardware circuit and firmware of Jixin Technology [DAPlink emulator](https://oshwhub.com/jixin002/daplink_jx)) on board, supporting SWD debugging and serial communication. The board leads out all the IO of the MCU, and also has an SPI-Flash, an OLED display, two buttons (one of which can be configured as RST) and a user LED light on board. All these peripherals can be configured to connect to the MCU through jumper resistors.
# All functions
* Based on Hangshun's highly cost-effective HK32F030MF4P6, it has a 32MHz main frequency, 2KB RAM, 16KB Flash, 448bits EEPROM and an ultra-low price. Package is TSSOP20
* Compatible with HK32F031MF4P6
* 0.96-inch 128x32 resolution OLED monochrome display, connected to the MCU using SPI
* Onboard SPI Flash memory
* Onboard reset and user buttons, of which the reset button can be reused.
* One user LED, lit at high level
* Onboard DAP-Link debugger, providing SWD debug interface and serial communication function (based on Jixin Technology [DAPlink emulator](https://oshwhub.com/jixin002/daplink_jx)).
* Interface and power supply
+ Bring out all MCU IO
+ All onboard peripherals can be disconnected from the MCU through jumper resistors
+ Use USB-TYPEC interface for power supply and DAPlink communication
+ Dedicated power supply pins can provide 5V and 3.3V power to external modules (available when powered by USB), and this pin can also be used as a power supply for the development board.
+ The power supply of the MCU is independent of the main power supply and connected through jumpers, which is convenient for testing the power consumption of the MCU or using other power supply methods to power the MCU
+ The connection between DAP-Link and MCU is connected using jumpers, and some or all of the pins can be disconnected or connected as needed. After disconnection, the onboard DAP can be used as a general debugger.
# Notes
### DAP-Link MCU selection and firmware burning
Because DAP-Link is an open source debugger, there are a large number of modified versions of DAP-LINK with different hardware and software solutions on the market. In order to reduce the difficulty of production, the official DAP-Link of Jixin Technology from LiChuang is used as the hardware and software benchmark, that is, DAP-Link 1.0 based on STM32F103C8T6. For information and firmware, please go to the official open source page of Jixin DAPLINK: [DAPlink emulator](https://oshwhub.com/jixin002/daplink_jx)
The firmware burning points reserved for onboard DAPLink are shown as follows:
![image.png]

Among them, **G represents GND, C represents SWCLK, and D represents SWDIO**. You can use other ST-LINK or DAP-LINK for burning.
### Multiplexing of onboard peripherals
The IO resources of HK32F030MF4P6 are not abundant, so SPI-Flash and OLED display share the same SPI bus, and then CS is used to select the currently activated device. When not in use, be sure to pull up the corresponding CS pin to prevent communication conflicts.
### Jumper resistors connecting peripherals to MCU
If you need to completely disconnect the onboard peripherals from the MCU, just remove the corresponding 0Ω resistor here:
![image.png]

The correspondence between different resistors and peripheral pins is as
followsResistor number | Peripheral pin | Corresponding MCU GPIO
--- | --- | ---
J0 | Power supply for all peripherals (including Flash and OLED display) | NoneJ1
| Clock signal SCLK for OLED and SPI-Flash | PD3
J2 | Input signal MOSI for OLED and SPI-Flash | PD2
J3 | Output signal MISO for OLED and SPI-Flash | PC7
J4 | Chip select signal CS for SPI-Flash | PD7
J5 | Data/instruction selection signal DC for OLED | PC5
J6 | Reset signal RST for OLED | PC6
J7 | OLED chip select signal CS | PD1
# Picture
## Operation diagram
![image.png]