2876 views|2 replies

3836

Posts

19

Resources
The OP
 

msp430 PWM period calculation [Copy link]

Example: P4DIR |= BIT1+BIT2+BIT3; // P4.1 - P4.3 output P4SEL |= BIT1+BIT2+BIT3; // P4.1 - P4.3 TBx options TBCCR0 = 512-1; // PWM Period TBCCTL1 = OUTMOD_7; // CCR1 reset/set TBCCR1 = LightCDPM; // CCR1 PWM duty cycle TBCCTL2 = OUTMOD_7; In the up-counting mode, CCR0 is used for period timing and CCR1 for PWM duty cycle adjustment. TA1 -> PWM output: 512 (that is, CCR0 value) X timer count clock = PWM period 128 (if it is CCR1 value) X timer count clock = PWM duty cycle Actually it is 512 clock cycles. Assuming that your timer B uses 8M clock, the actual PWM period = 512/8M = 64us


This post is from Microcontroller MCU

Latest reply

Very useful, thanks for sharing  Details Published on 2018-12-25 11:13
 

3180

Posts

0

Resources
2
 
Top one . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
This post is from Microcontroller MCU
 
Personal signature为江山踏坏了乌骓马,为社稷拉断了宝雕弓。
 

6366

Posts

4936

Resources
3
 
Very useful, thanks for sharing
This post is from Microcontroller MCU
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list