Mar 14, 2004 #1 C 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 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?
Mar 15, 2004 #2 C 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 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
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