• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Low Power RF & Wireless Connectivity » Low Power RF Proprietary Software & SimpliciTI Forum » CC2530 Timer3 PWM
Share
Low Power RF & Wireless Connectivity
  • Forums
  • Announcements
  • Files
  • E2E Wiki
Options
  • Subscribe via RSS

CC2530 Timer3 PWM

CC2530 Timer3 PWM

This question is not answered
stephen cline
Posted by stephen cline
on May 21 2010 13:49 PM
Prodigy210 points

I am using a CC2530 and I want to use timer 3 to PWM two LEDs that are on my board.  I have the LEDs connected to the correct Pins (Port 1, bits 3 and 4) and I have made sure no other functions on the chip are using timer 3.  Since I want to use both ports for seperate PWMs I chose free running mode (0x00 to 0xFF) and compare mode 5 (set on compare, clear on 0xFF.  However this does not seem to be working, when I turn either of the P1SEL bits high (whichever LED I want to be on) that port just goes high, no PWM.  I have verified through debug that the timer is running and the correct P1SEL bits are getting set.  Here is a code snippet:

 

 

#define GRN_LED_PWM               (0x4F)
#define RED_LED_PWM               (0x07)
#define GRN_LED_ON                {P1SEL |= BIT4;}
#define GRN_LED_OFF               {P1SEL &= ~BIT4; P1 &= ~BIT4;}
#define RED_LED_ON                {P1SEL |= BIT3;}
#define RED_LED_OFF               {P1SEL &= ~BIT3; P1 &= ~BIT3;}

//Initialize Timer3 for LED PWM and I/O
    P1DIR |= BIT4 + BIT3;
    T3CTL |= BIT7 + BIT6 + BIT5 + BIT2;
    T3CCTL0 |= BIT5 + BIT3 + BIT2;
    T3CC0 = RED_LED_PWM;
   
    T3CCTL1 = T3CCTL0;
    T3CC1 = GRN_LED_PWM;
   
    T3CTL |= BIT4;                           //Start Timer 3

 

If anyone has any advice I would greatly appreciate it.

CC2530 PWM timers 2.4GHz timer 3
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Peder
    Posted by Peder
    on May 26 2010 02:37 AM
    Intellectual1785 points

    Hi Stephen,

    Even if no other peripherals that use P1 are switched on, they are still taken into account in the priority for use of the P1 pins. You will probably need to set some priority bits to make sure Timer 3 has control of the P1 pins. Section 7.6.2 in the user guide may help:

    "P2SEL.PRI2P1 and P2SEL.PRI3P1 select the order of precedence when assigning several peripherals to Port 1. The Timer 3 channels have precedence when both bits are set high."

    I hope that helps.

    Peder

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • liangliang lou
    Posted by liangliang lou
    on Aug 20 2012 01:44 AM
    Expert1870 points

    Hi Stephen,

      have you solve this problem,i recently encountered  the problem as similar as you,i want the timer3 of CC2530 to generate PWMs on P1.3 ,but no thing was get,if you solved the problem,can you share how you resolvethe process of the problem,thank you.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

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-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use