smallembedded

【CW32】BrushlessMotor

 
Overview

Foreword:

-In the current electronics market where supply is changing rapidly, domestic chip manufacturing technology is gradually maturing, and domestic chips are worth considering. . .

-Wuhan Xinyuan Semiconductor and Shenzhen Lichuang E-Commerce Co., Ltd.  

-Lichuang Mall, a one-stop component procurement platform, is really easy to use! Lots of information.

-Chuangxin Workshop Technology (Shenzhen) Co. , Ltd. Programs are delivered online and burned securely in the cloud.

 

Figure 1: Overall renderings

Plan ideas:

  1.Hardware design

a. Power supply part: 12V adapter power supply and USB dual power supply mode. Dual power supplies will provide effective current output capabilities in high power projects.

     

 

 

b. Main control part: Today’s protagonist is CW32F030C8, a high-performance ARM 32-bit core chip.

 

c. Program download and serial port communication: both PWLINK and Jlink are available. It adopts SW download method and supports online debugging. It can be done with a simple 5P socket!

 

d. Function part: - 0.96'' OLED, you can get a 128*64 small screen with IIC protocol for about 10 yuan from a certain store!

 - Beep buzzer, I made it into a small module, using latex base links for easy cutting!

 - Extended TFTLCD, 4.3-inch true color touch screen! I boldly tried to drive it once, and it drove perfectly under the 32-bit ARM core!

  

 

 

  2. Software writing (By MDK5 compiler)

a. Function introduction: system solution

-->Initialize the system clock 24M after power-on, initialize OLED, etc.

-->Enter the main loop, because the knob potentiometer is not used, and given a fixed value, the motor will enter the start-up state.

-->Complete

 

b. Logic code: select the key points to focus on.

--accomplish:

1>Voltage collection:

The voltages of the three phases of UVW are read by switching a single channel at a time through DMA according to the routine! After reading, the read value is refreshed every 100ms in the main function!

 

2>PWM output:

This chip has an ATIM advanced timer and supports 6 independent PWM outputs and 3 pairs of complementary PWM outputs.

-Upper bridge PWM: U+ PA8; V+ PA9; W+ PA10

-Lower bridge GPIO: U- PB13; V- PB14; W- PB15

 

3>OLED display 128*64: simple IO simulation IIC

xOLED_ShowStr(....): Display string. @Parameters: x coordinate, y page number, the string to be displayed "starting point coordinates (x: 0~127, y: 0~7)". TextSize font size.

xOLED_ShowNum(....): Display numbers and variables. @Parameters: x coordinate, y page number, value to be displayed (0-9999). TextSize font size.

void xOLED_DrawBMP(....): Display bitmap. @Parameter: x0 starting point x, y0 starting point y, x1 end point x, y1 end point y, BMP[] bitmap array.

 

4>Beep: Three wires: power, ground, and switch. If the switch is set high, it will beep, if it is set low, it will stop. Simple driver logic.

 

5>(Expansion)TFTLCD: In the system, you can switch to 3.3V power supply mode, and there is a 28P interface on the back of the main control board.

 

 

 

 

 

Show results:

 

Figure: Startup interface

 

          Figure: LED indicator light                     

 

Figure: LCD driver demonstration

 

Precautions:

        *note1: When downloading, select the SW download method.

       

 

Motor materials:

        *note1: A certain treasure .

 

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-07-07 00:16:27
  • About debugging issues of wireless module NRF24L01
  • CC3200launchpad+AUDBOOST
  • Serial port output problem
  • DIY RF Power Amplifier - Record the whole process
  • Problems encountered when LCD1602 scroll screen display
  • Please advise

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

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号