當前位置:編程學習大全網 - 網站源碼 - zigbee怎麽在協議棧裏輸出pwm波

zigbee怎麽在協議棧裏輸出pwm波

void Timer1Pwm_init(void)

{

PERCFG &= ~0x40; // Select Timer 1 Alternative 0 location

P2DIR = (P2DIR & ~0xC0) | 0x80; // Give priority to Timer 1

P0SEL |= 0x08; // Set P0_3 to peripheral

T1CC0L = 0xff; // PWM signal period

T1CC0H = 0x7f;

T1CC1L = 0x78; // PWM duty cycle

T1CC1H = 0x10;

T1CCTL1 = 0x1c;

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

return ;

}

void start_pwm(void)

{

Timer1Pwm_init();

return ;

}

#if 0

/*irq function*/

#pragma vector=T1_VECTOR

//__interrupt void T1_IRQ(void)

volatile unsigned char count = 0;

__interrupt void _irq_timer1(void)

{

//TODO....

}

#endif /*_irq_timer1*/

  • 上一篇:源代碼選股用什麽軟件
  • 下一篇:運營調度系統源代碼
  • copyright 2024編程學習大全網