cc2541之pwm笔记
来源:互联网 发布:c语言第五版 编辑:程序博客网 时间:2024/06/08 03:05
cc2541有四路timer,其中timer2为rtos使用,所以我们可以使用timer1、timer3、timer4。 其中timer1、timer2是16位的,timer3、timer4是8位的。
timer1 有5个通道,其中通道0输出比较功能较少,使用时需要特别注意。
timer3、timer4各拥有两个通道。
timer对应的io map如下图所示:
其中timer3、timer4输出pwm的配置代码如下(以timer4为例):
timer1输出pwm的配置代码如下:
1、timer1如果使用port0引脚,则需要注意To have all Timer 1 channels visible in the alternative 1 location, move both USART 0 and USART 1 to
the alternative 2 location, 及使uart0和uart1的peripheral 功能设置为alt2
2、如果开了timer中断功能,一定要添加中断处理函数,不然会跑飞。
特别注意:
timer1输出pwm不稳定的现象,可以通过以下两个设置解决。
1:需要把POWER_SAVING关闭或者在INIT函数里加osal_pwrmgr_device(PWRMGR_ALWAYS_ON);
2:必须关闭CLK自动分频,HCI_EXT_ClkDivOnHaltCmd( HCI_EXT_DISABLE_CLK_DIVIDE_ON_HALT );!
0 0
- cc2541之pwm笔记
- cc2541之pwm笔记
- 【BLE】CC2541之PWM
- 【BLE】CC2541之PWM控制直流电机
- CC2541/CC2530 pwm
- 【cc2541历程】按键控制PWM调光
- 低功耗蓝牙cc2541学习笔记之LED-1
- 低功耗蓝牙cc2541学习笔记之LED-2
- 低功耗蓝牙cc2541学习笔记之协议栈简介
- 【CC2541】CC2541之HAL层KEY分析
- 【BLE】CC2541之notify
- 【BLE】CC2541之按键
- 【BLE】CC2541之RSSI
- 【BLE】CC2541之OLED
- 【BLE】CC2541之indicate
- 【BLE】CC2541之timer3
- 【BLE】CC2541之看门狗
- 【BLE】CC2541之SNV
- angular.js 错误:Error: [$injector:modulerr] 原因
- C#使用UdpClient发送和接收UDP数据示例
- 二叉排序和二叉查找
- log4j.properties配置详解
- git [packet_write_wait connection to xx.xx.xx.xx Broken pipe]解决办法
- cc2541之pwm笔记
- redux的connect解读2
- 解决:The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or t
- EM推导
- mysql5.7 修改密码update password提示找不到password字段
- C# 中Struct与Class区别
- Python爬虫入门 (二)
- docker命令
- eclipse调试android程序时,log太多