ucsam
Advanced Member level 4

- Joined
- Oct 12, 2010
- Messages
- 119
- Helped
- 3
- Reputation
- 6
- Reaction score
- 3
- Trophy points
- 1,298
- Location
- kathmandu,nepal
- Activity points
- 2,058
hello everyone!
i know that many has already posted posts on PWM control but i am still confused about the THING!
What does PWM depend upon? i know that PWM is obtained when we have delay between input and output..but can't we that simply by:
void pwm(unsigned char value)
{
out=0;
delay(value)
out=1;
}
:?:
why do we have to use timer? i know that timer is meant to create some frequency to turn on and off the port, but once we keep some delay (from the above code) don't we automatically get frequency(as there is delay between on and off)? :shock:
I went through the following site:
Pulse Width Modulation (PWM) tutorial: 8051 example : 8051 Microcontroller Projects AVR PIC Projects Tutorials Ebooks Libraries codes
but could not get some parts:
1.What is the use of "pwm_width" in the code?
2.How do i vary the pwm signals in it?
3.Does changing the frequency vary the PWM?
4.How can i use it more easily?
Thanks
i know that many has already posted posts on PWM control but i am still confused about the THING!
What does PWM depend upon? i know that PWM is obtained when we have delay between input and output..but can't we that simply by:
void pwm(unsigned char value)
{
out=0;
delay(value)
out=1;
}
:?:
why do we have to use timer? i know that timer is meant to create some frequency to turn on and off the port, but once we keep some delay (from the above code) don't we automatically get frequency(as there is delay between on and off)? :shock:
I went through the following site:
Pulse Width Modulation (PWM) tutorial: 8051 example : 8051 Microcontroller Projects AVR PIC Projects Tutorials Ebooks Libraries codes
but could not get some parts:
1.What is the use of "pwm_width" in the code?
2.How do i vary the pwm signals in it?
3.Does changing the frequency vary the PWM?
4.How can i use it more easily?
Thanks