当前位置:网站首页>Using domestic MCU (national technology n32g031f8s7) to realize pwm+dma control ws2812

Using domestic MCU (national technology n32g031f8s7) to realize pwm+dma control ws2812

2022-06-11 11:05:00 Jiahe Tiancheng

One 、 Technical background

         Previously migrated to STM32 To do it MCU, But these two years STM32 Outrageous prices and supply conditions directly dissuade most Internet enterprises . domestic MCU Manufacturers also seize the opportunity , Seize the market rapidly , National technology is a typical manufacturer .

         In many cases , A consumer intelligent hardware product in the home category , It is necessary to have a status light . We may have learned at the beginning 、 The lead type is used RGB, Long like this :

        

         It usually has 4 One pin :

                 Anode / The cathode ( According to Gongyang / Common Yin type );

                R(red);

                G(green);

                B(blue).

         For miniaturization, of course , such RGB There will also be various patch types .

        If you want to control it , We usually configure it RGB Three pin current limiting resistor , According to the level state of different pins, the luminous color of the status lamp is realized . But there's a problem : Color is not easy to control accurately , and IO More resources :3 individual .

        and WS2812 Achieved through 1 individual IO send out 24bit Data to accurately control the color function of lamp beads and the miniaturization of patches . So it has high application value .

        Before that STM32 Through PWM+DMA To control WS2812 The function of , There are also many online tutorials , No more details here . This time I come to realize the present N32G031xxxx Implemented on PWM+DMA To control it .

原网站

版权声明
本文为[Jiahe Tiancheng]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206111044295460.html