- This topic has 3 replies, 3 voices, and was last updated 12 years, 7 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
|
Microcontroller › 8051 › PWM FOR 8051 BY FRESHLIFE
please, i need pwm with 8051
Sir, for implementing pwm you have to use timers. Use them with a bit of logic and you will have your pwm.
void pwm();
void main()
{
led=1;
pwm();
led=0;
pwm();
}
void pwm()
{
TMOD=0x01;
TH1=0x67; //set the value of the delay
TL1=0xff;
TR1=1;
while(TF1==0);
TR1=0;
}
Hello,
What do you think about the next link?
http://www.engineersgarage.com/forums/8051/pwm-what-servos-need-at89c51rd2
BR
CST