• 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 » PWM Timer 1 output for CC2530
Share
Low Power RF & Wireless Connectivity
  • Forums
  • Announcements
  • Files
  • E2E Wiki
Options
  • Subscribe via RSS

Forums

PWM Timer 1 output for CC2530

This question is answered
Dusan Savic
Posted by Dusan Savic
on Jun 23 2011 06:41 AM
Prodigy110 points

Hello,

I am working on CC2530 PWM output Timer 1 on P0_2 port but when I start a program below ,I don't get pwm signals on P0_2.

This is my code :

P0DIR |= 0x04;   //  P0_2 port
P0SEL &= ~0x04;

P0_2 ^= 1; //  P0_2 set to be output

T1CTL |= 0x0f; // divide with 128 and to do i up-down mode

T1CC0L = 0xff;   // PWM signal period
T1CC0H = 0x7f;

T1CC1L = 0x78;  // PWM duty cycle
T1CC1H = 0x10;


T1CCTL1 |= 0x1c;

PERCFG |= 0x00;

Please can someone tell me what I am doing wrong and where is mistake...Thank You

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • xyzzy
    Posted by xyzzy
    on Jul 13 2011 11:44 AM
    Expert4665 points

    I have not worked with PWM using Timer1 so I hesitate to comment on your use of the T1CC1 register except: your static short T1CC1 = 0x0240; statement is working on a static variable that has the same name as the timer register -- probably not what you intended.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Dusan Savic
    Posted by Dusan Savic
    on Jul 21 2011 05:24 AM
    Prodigy110 points

    Which Timer You used and how do You solved that PWM is changing Duty cycle from exaple from 10% to 90%?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • JackieYan Yan
    Posted by JackieYan Yan
    on Jan 07 2013 00:08 AM
    Prodigy10 points

    Hi,

        How can I modify code if I want  to output PWM signal on P1.3? Thanks.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Fredrik K
    Posted by Fredrik K
    on Jan 07 2013 02:07 AM
    Genius9510 points

    Have a look in the User's Guide chapter 7.

    /Fredrik

    --
    PS. If I answered your question, please hit   Verify Answer  !

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Imtiaz Ali
    Posted by Imtiaz Ali
    on May 08 2013 03:50 AM
    Prodigy100 points

    I am using following code to get timer signal at P0_3.   It is working OK.

    But it takes 2ms for 1 time ON and 1 time OFF.  I need  that it will take 2ms for 5 times ON and 5 times OFF.

    For better understanding I have attached file.

    PERCFG  &= ~0x40;                 //select Timer  1 Alternative at Port 0 Location                                                                        
    PERCFG  |=  0x03;                 //Move USART0 and USART1 to Alternative 2 Location                                                                        
    P2DIR   = (P2DIR & ~0xC0) | 0X80; //Give priority to Timer 1                                                                        
    P0SEL   |=  0x08;                 // SET P0_3 AS PERIPHERAL                                                                        
    T1CC0L  = 0xFF;           //PWM signal period                                                           
    T1CC0H  = 0x7F;                                                                        
    T1CC1L  = 0x00;         //PWM Duty Cycle, Channel 1 (P0_3)                                                                        
    T1CC1H  = 0x01;                                                                        
    T1CCTL1 = 0x34;         //Channel 1 in compare Mode, Set output on Compare down,                                                                     
    T1CTL |= 0x01;        //Start the timer in free running Mode

    Waiting for beneficial reply.

    Thanks5824.TIMER SPEED.xls

    T1CC0L T1CTL TIME SPEED
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
12
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