This project is a project I chose during the final exam of the basic class of Lichuang’s summer training camp. It can also be regarded as my first project from the bottom up from circuit design to programming. There are definitely a lot of shortcomings in terms of design. On the one hand, it is released so that all electronic enthusiasts can see it and give some suggestions. On the other hand, it is also a summary of my work this week.
The main control chip I chose is stm32f103c8t6. I chose this simply because I am more familiar with stm32, it is easier to use, and the price is not high. In fact, it should be cheaper to use STC chips, but I have never used it and I am too lazy to learn. . , and then the touch chip is RH6016CB. This later proves that the touch is very sensitive. It needs to be noted that you must carefully read the touch panel pcb wiring requirements in the datasheet. The point to note is that many lights use WS2812B. This is Mo Gong Recommended, because there are always problems when transplanting drivers written by others, so I wrote a driver myself and used spi. In addition, because I was relatively naive, I didn’t read the datasheet carefully and ran into a lot of pitfalls. For example, the encoding time of 01code is wrong. In addition, there are some commonly used electronic components. You can see the schematic diagram.
When I was drawing the first version of the schematic diagram, I actually connected the input and output of ws2812b backwards. After I bought it and checked it for a long time, I realized that I was in tears. Later I drew a new one and simply changed the light panel into a circle.
Because ws2812b uses 5v power supply, and the main control uses 3.3v power supply. Therefore, the intermediate communication requires a conversion circuit. For other circuits, please refer to the datasheet.
The program is actually relatively simple, but because I haven't programmed stm32 for a long time, it still took a few days. I also encountered various strange bugs in the process, and later found out that it was my own negligence. The most important aspect is the driver writing of ws2812b. At first I wanted to use SysTick to drive the delay directly, but later I found that it took up too many system resources and seemed impossible to implement. Using spi directly, the spi 9M transmission rate uses two bytes to represent one bit. Then just use four exti interrupts to press the button. The touch chip will turn to high level when touched, so it is very convenient to use. In addition, I remember a very painful lesson. The default priority level of SysTick is the lowest, so if you want to use SysTick to delay other interrupts. Be sure to adjust SysTick's interrupt priority level.
Attention, I forgot to draw the reset circuit on the main control board, so now there are only two ways to re-run the picture after power failure: 1. Re-download 2. Manually reset by yourself (use a wire to connect the reset pin to ground) (Crying) There is only the main control board in this project link, and there is a program for the lights in the attachment here https://lceda.cn/editor#id=27e17fd0c07e4d90998ec2b942c5174f|6fa1e21537bc41fb8fcd97d4095d8215
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