P89C51RD2 PWM (Resolved)

Status
Not open for further replies.

CMOS

Advanced Member level 3
Joined
Jan 6, 2004
Messages
862
Helped
94
Reputation
186
Reaction score
50
Trophy points
1,308
Location
USA
Visit site
Activity points
5,673
p89c51rd2 pwm

Hi,
Can anyone show me how to initialize PWM in P89C51RD2. How to change duty-cycle and what will be the frequency of generated PWM wave?
 

p89c51rd2 pwm

Ok I found it in Intel's 8XC51FA/FB/FC PCA Cookbook.
Code:
INIT_PWM:
MOV CMOD, #02H ; Clock input 4 250 nsec at 16 MHz
MOV CL, #00H ; Frequency of output 4 15.6 KHz
MOV CH, #00H
MOV CCAPM0, #42H ; Module 0 in PWM mode
MOV CCAP0L, #00H
MOV CCAP0H, #128D ; 50 percent duty cycle
SETB CR ; Turn on PCA timer
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…