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 .
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet