Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.

Latest threads

Back
Top