CC2541PWM
//PWM初始化
void PWM_init(uint16 arr){
RGB_Callback(&PWM_DateCBs);//函数注册
P0DIR= BV(3)|BV(4)|BV(5);
//设置pwm端口为外设端口,非gpio
P0SEL= BV(3)|BV(4)|BV(5);
PERCFG = 0x03; //将UART切换到备用位置2,防止占用PWM输出
T1CTL &= 0;
T1CC0L = arr%0xFF;
T1CC0H = arr/0xFF;
//ch1
T1CC1L = 200%0xFF;
T1CC1H = 200/0xFF;
T1CCTL1 = 0x2C;
//ch2
T1CC2L = 500%0xFF;
T1CC2H = 500/0xFF;
T1CCTL2 = 0x2C;
//ch3
T1CC3L = 500%0xFF;
T1CC3H = 500/0xFF;
T1CCTL3 = 0x2C;
//star tiner1
//必须设置以下两句,否则定时器不工作, 但是我们这里只用pwm, 因此可以直接用pwm的中断, 不用t1的定时器中断, 因此不用设置
T1CCTL0 = 0x2C; // IM = 1, CMP = Clear output on compare; Mode = Compare
T1CTL = 0x02;
}
大家帮我看有没有什么问题?
参考下面这个例子,带3路PWM 例子
http://www.ti.com/tool/TIDC-BLUETOOTH-LOW-ENERGY-LIGHT?keyMatch=ble&tisearch=tidesigns
(ACTIVE) TIDC-BLUETOOTH-LOW-ENERGY-LIGHT
Description & Features
Technical Documents
Support & Training
Order Now
View the Important Notice for TI Designs covering authorized use, intellectual property matters and disclaimers.
Description
This reference design is an example of using the SimpleLink™ Bluetooth low energy CC2540T high temperature range wireless microcontroller in lighting applications. The board includes RGBW LEDs controlled by the CC2540T and is USB powered. The board can be controlled out-of-the-box by the TI BLE Multitool smart phone app.
Features
- Only Bluetooth Smart solution graded up to 125°C. Fits very well to any LED light solution
- Simple and "ready to go" design shortens time to market
- Example app works out-of-the box when broadcasting to the TI BLE Multitool app
- Full light control (power, color, color temperature) directly from your smart phone
- Fully tested design includes firmware, GUI, demo and getting started guide
View the Important Notice for TI Designs covering authorized use, intellectual property matters and disclaimers.
View available purchase options for designs kits, evaluation modules and/or the bill of materials.
$99.00(USD)
Schematic/Block Diagram
Quickly understand overall system functionality.
Download Schematic
Design Guide
Get results faster with test and simulation data that's been verified.
Download Design Guide
Design Files
Download ready-to-use system files to speed your design process. Get Viewer.
Download Design Files
Bill of Materials (BOM)
Find the complete list of components in this reference design.
Download BOM
Order Now
Part Number | Buy from Texas Instruments or Third Party | Buy from Authorized Distributor | Status | |||||||
CC2540TDK-LIGHT:
|
$99.00(USD)
|
Pricing may vary.
|
ACTIVE | |||||||
Contact a Distributor - Select a location - Albania Algeria Andorra Argentina Armenia Australia Austria Azerbaijan Belarus Belgium Bolivia Bosnia-Herzegovina Brazil Bulgaria Burundi Canada Chile China Colombia Costa Rica Croatia Cyprus Czech Republic Denmark Dominican Republic Ecuador Egypt Estonia Finland France Georgia Germany Greece Guatemala Hong Kong Hungary Iceland India Indonesia Ireland Israel Italy Jamaica Japan Kazakhstan Korea (South) Kuwait Latvia Lebanon Liechtenstein Lithuania Luxembourg Macedonia Malaysia Malta Mauritius Mexico Moldova Monaco Morocco Netherlands New Zealand Norway Pakistan Panama Paraguay Peru Philippines Poland Portugal Puerto Rico Republic of Serbia Romania Russian Federation San Marino Saudi Arabia Singapore Slovak Republic Slovenia South Africa Spain Sri Lanka Sweden Switzerland Taiwan Tajikistan Thailand Tunisia Turkey Turkmenistan Ukraine United Arab Emirates United Kingdom United States Armed Forces the Americas Armed Forces Europe Alaska Alabama Armed Forces Pacific Arkansas Arizona California Colorado Connecticut District of Columbia Delaware Florida Georgia Hawaii Iowa Idaho Illinois Indiana Kansas Kentucky Louisiana Massachusetts Maryland Maine Michigan Minnesota Missouri Mississippi Montana North Carolina North Dakota Nebraska New Hampshire New Jersey New Mexico Nevada New York Ohio Oklahoma Oregon Pennsylvania Puerto Rico Rhode Island South Carolina South Dakota Tennessee Texas Utah Virginia Vermont Washington Wisconsin West Virginia Wyoming Uruguay Uzbekistan Venezuela Vietnam Yemen |
TI Devices (1)
Order samples, get tools and find more information on the TI products in this reference design.
Part Number | Name | Product Family | Sample & Buy | Design Kits & Evaluation Modules |
---|---|---|---|---|
CC2540T | Extended industrial temperature Bluetooth low energy wireless MCU | Bluetooth Low Energy (BLE) | Sample & Buy | View Design Kits & Evaluation Modules |
Technical Documents
View the Important Notice for TI Designs covering authorized use, intellectual property matters and disclaimers.
User guides (1)
Title | Abstract | Type | Size (KB) | Date | Views |
|
378 | 30 Sep 2015 | 387 |
Design files (3)
Title | Abstract | Type | Size (KB) | Date | Views |
---|---|---|---|---|---|
|
ZIP | 1035 | 10 Sep 2014 | 56 | |
|
124 | 10 Sep 2014 | 30 | ||
|
45 | 10 Sep 2014 | 89 |
Related Tools & Software
Software (1)
- Bluetooth Low Energy Light Software
(ZIP, 134KB) 10 Sep 2014
Support & Training
As a member of myTI you can join the TI E2E™ Community where you can ask questions, share ideas and collaborate with fellow engineers and TI experts
Content is provided "AS IS" by the respective TI and Community contributors and does not constitute TI specifications. See Terms of use.
Engage in the Community
- Bluetooth® low energy Forum
Training & events
Name | Type | Date |
---|---|---|
Simplifying Multiprotocol Industrial Ethernet Communication | Video training | Wed, 07 Dec 2016 |
mmWave SDK EVM Out-of-Box Demo | Video training | Wed, 10 May 2017 |
mmWave EVMs Deep Dive | Video training | Mon, 01 May 2017 |
Advanced Phase Synchronization Capabiliites with Multiple RF PLLs using TI's LMX2594 | Video training | Wed, 19 Apr 2017 |
How to build inductive touch buttons with the LDC2114 evaluation module | Video training | Tue, 21 Feb 2017 |
See more training & events
Blogs
Wikis
Visit the TI Wiki
Your History
Products You Recently Viewed
- TIDC-BLUETOOTH-LOW-ENERGY-LIGHT
- ccstudio
- cc2530emk
- TIDC-BLUETOOTH-LOW-ENERGY-LONG-RANGE
- smartrftm-studio
About TI | Careers | Contact us |Corporate Citizenship | Investor Relations | University
Mobile apps |Mobile site |myTI account |TI worldwide |Website feedback
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and embedded processors, along with software, tools and the industry‘s largest sales/support staff.
© Copyright 1995-2017 Texas Instruments Incorporated. All rights reserved.
Trademarks |Privacy policy |Cookie policy |Terms of use |Terms of sale
CC2541PWM 相关文章: