蓝猫淘气

[Hangshun Training Camp] Sandwich Development Board Based on HK32

 
Overview

Preface

  • I am very grateful to Hangshun Chip, Lichuang Mall, Jialichuang and other companies for providing this practical opportunity. I have always wanted to learn 32-bit microcontrollers but have not put in the practice. I just took this opportunity to make a small development board by myself.
  • Let’s take a family photo first IMG_20210328_170006.jpg

composition

  • MCU core board
  • Wireless communication module version
  • Clock, LED module version

Circuit introduction

MCU core board

About PCB

The core board of this project drew on the verification version layout of Lichuang Mall and then adjusted it.

MCU

The MCU uses hk32f103cbt6, which is slightly different from the model in the PCB, but the pins are exactly the same. The USB pins are lead out on the board, and the d+ d- of micro usb is used to connect to the outside. But because the price of the series with A is too high and the family is poor, this function has been abandoned. The circuit is as shown in the figure. The original plan was to use a jumper cap to freely switch between full speed (FULL-SPEED) and low speed (LOW-SPEED). In theory, it can be used by replacing the MCU, but it has not been verified. usb.png

Power supply

The power supply adopts USB 5V power supply, uses AMS1117-3.3 LDO chip for voltage stabilization and voltage reduction, and uses multiple capacitors for filtering.

LDO.png

serial port

For serial port debugging and programming, the CH330 serial port to USB chip is used, with a built-in crystal oscillator, which has the characteristics of less peripheral components and small size.

ch330.png

external pin

In addition, all pins have been led out, and 3V3 and 5V power supplies have been led out in one row each to facilitate the use of various peripherals.

Modular version

The module board adopts the design of a sandwich development board and can be directly inserted into the core board. Actual verification has shown that it can be inserted perfectly. However, there are some slight problems with the circuit design of the LED lights on the clock and LED module versions. First, the negative electrode of the LED is grounded, and the IO port of the MCU is used for driving, and the driving capability may not be enough; second, the current-limiting resistor in series with the LED is too large, causing the problem of low LED brightness.

Program introduction

illustrate

Because I haven't started learning 32-bit MCU development yet, I simply turned on the light. The writing framework of vscode+platformIO+arudino and keil ide were used respectively to try. Because there was a slight problem with the LED circuit design and it was difficult to take pictures and show it, I used a voltmeter to measure the high and low levels to indicate whether the LED was on or off. I put this at the end

vscode+platformIO+arudino

Install PlatformIO IDE plug-in

  • Enter the plug-in installation PlatformIO, click the first one, and then click Install.
  • After the installation is complete, you will be prompted to Reload, click on it. plug_install.png

Install stm32 device

  • After the installation is complete, an insect icon will appear, click
  • Click on Platforms platforms_install_1.png
  • Click Embeded, enter ST, appear ST STM32, click the word and click install to install
  • The installation process may take a while depending on your network. platforms_install_2.png

New Project

  • Click open under PIO HOME and click NEW Project project_new_1.png
  • Enter the project name, Borad selects STM32F103CB, and uncheck the multi-check box pointed by the arrow. project_new_2.png
  • Select the path to store the project and click Finish
  • PS: The process of creating a new project requires downloading some files. Friends with poor network environment may need to wait for a while. project_new_3.png

Configure link downloader

  • First modify the configuration file and set the link you use.
  • Click on platformio.ini to edit
  • Taking the pwlink I use as an example, enter upload_protocol = cmsis-dapSave.
  • If you are using stlink or the like, you can enter blackmagic, jlink, stlink, etc. link_add.png

Code writing and downloading

  • Back to our editing page, there will be a main.cpp in the src directory. After opening, it will be in the Arduino-specific format that we are familiar with.
  • After writing the code, click the download button in the bottom column on the left. You need to use various links to connect to your development board in advance. code_download.png

keilide

I won’t go into details on this. I also used the official routine to light the lamp. I will put the relevant files in the attachment, so you can download them for reference.

Achievements display

  • We have come to this very embarrassing part, look at the picture below
  • This is the measured PA9 IMG_20210328_152732.jpg
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2024-11-21 12:47:54

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号