当前位置:网站首页>使用国产MCU(国民技术 N32G031F8S7) 实现 PWM+DMA 控制 WS2812
使用国产MCU(国民技术 N32G031F8S7) 实现 PWM+DMA 控制 WS2812
2022-06-11 10:44:00 【嘉禾天成】
一、技术背景
之前移植使用STM32来做MCU,但是这两年STM32离谱的价格和供货情况直接劝退大部分互联网企业。国产的MCU厂家也抓住机会,迅猛抢占市场,国民技术是较为典型的一个厂家。
在很多时候,一个消费性的居家类别的智能硬件产品,有一个状态灯是很有必要的。我们可能一开始了解到、使用的是引线型的RGB,长这样:

它一般是有4个引脚:
阳极/阴极(根据共阳/共阴类型);
R(red);
G(green);
B(blue)。
当然为了小型化,这种RGB也会有各种贴片型的。
如果要控制它的话,我们一般是通过配置它RGB三个引脚的限流电阻,再根据不同引脚的电平状态来实现状态灯的发光颜色。但是这样会有个问题:颜色不容易精准控制,而且IO资源占用较多:3个。
而WS2812实现了通过1个IO发送24bit数据来精准控制灯珠颜色功能和贴片小型化。因此它具有很高的应用价值。
之前有在STM32上实现了通过PWM+DMA来控制WS2812 的功能,网上也有很多教程,这里不再详述。本次来实现在N32G031xxxx上实现PWM+DMA来控制它。
边栏推荐
- Window management learn more about windowmanagerservice
- Gamefi: everything you need to know about the "play and earn" game economy
- Where is it safer to open an account for soda ash futures? How much money can you do?
- Pyspark case series 4-dataframe output to a single folder solution
- 新西兰是道路安全做的最好的国家之一
- Half of the property rights of the house are registered in the woman's name when they are in love, and they want to return after they break up
- Taking the cooperation between different banks as an example, the construction of small program ecology
- Mxnet construction and implementation of alexnet model (comparison with lenet)
- 5. read the specified pathname -dirname
- NFT products are alive
猜你喜欢

金仓数据KingbaseES 批量创建数据库对象

DROID-SLAM: 用于单目双目RGBD相机的深度视觉SLAM

Using ribbon to realize client load balancing

Arbitrum infrastructure: a quick start

Distance measurement - Euclidean distance

Mn Monet pagoda host system v1.5 release

Implementation of competition scoring system based on C language

金仓数据库KingbaseES中的sys_checksums坏块检测功能

New Zealand is one of the best countries for road safety

基于C语言实现比赛评分系统
随机推荐
Development and source code construction of digital collection system
Gamefi: everything you need to know about the "play and earn" game economy
杰理之BLE SPP 开启 pin_code 功能【篇】
Jerry's acquisition of ble distinguishes between reset and wake-up [chapter]
Working principle analysis of rxjs fromEvent
数字藏品app系统源码
Online files are not transferred to Base64
Jszip get the file of the specified file in the uploaded zip package
Golang compilation and linking parameters, runtime
Source code of digital collection app system
SWUST oj668: the thief ran away
Yibentong 1122: calculating saddle point
Sys in kingbasees_ Checksums bad block detection function
985高校博士因文言文致谢走红!导师评价其不仅SCI写得好...
白屏时间、首屏时间
Metro roadmap cloud development applet source code and configuration tutorial
Content-Type: multipart/form-data; boundary=${bound}
Why does a ddrx power supply design require a VTT power supply
Distance measurement - Euclidean distance
Electron桌面端开发(开发一个闹钟【完结】)