PWM in PCA

Status
Not open for further replies.

pshaik

New Member
Hello all,

I am working with AT89C51CC01. My task is to get PWM as o/p, for this i write the following code. please check this code.

void main()
{
CMOD = 0x02; // Setup PCA timer

CL = 0x00;
CH = 0x00;

CCAPM0 = 0x42; // Setup PCA module 0 in PWM mode.

CCAP0L = 0x00; // Set the initial value same as CCAP0H
CCAP0H = 0x80; // 50% Duty Cycle 128d

CR = 1; // Start PCA Timer.

while (1)
{}
}

I test this program last weeek, at that time it gives pwm as o/p but when i test this today then it´s not working.
I don´t understand wht is the problem?
If any one have idea abt this problem then please reply me

thanks in advance.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…