- This topic has 9 replies, 3 voices, and was last updated 7 years, 6 months ago by .
Viewing 10 posts - 1 through 10 (of 10 total)
Viewing 10 posts - 1 through 10 (of 10 total)
- You must be logged in to reply to this topic.
|
Microcontroller › 8051 › How to control a PWM signal with counters in 8051
Hi,
How to generate a counter for a PWM signal,
i.e., I'm getting a PWM output of 10hz frequency,and I have taken another port[for this port I need to use a counter]
and this port should toggle on/off and this signal I need to control with the generated
pwm signal by using counter operation.
For example: if counter is 0 the pwm signal should be HIGH[till it becomes 1].
Thanks in advance.
Skylite
ur question is confusing
PWM is generated using timers – inbuilt timers
why u r using counters for it
plz explain your problem in detail so we can help you
Yes PWM is generated using timers, and i'm getting the output of it,which i'm generating in different port.
Now I have taken a seperate I/O port, where i'm getting the signal high and low, now my question is
how to control this signal for particular count/timer period[say for about maximum 5 to 10 minutes the
signal should be high and next it should be low]
Here is the part of the code:
sbit CLOCK = P2^3;
unsigned char check = 1;
void timer1_ISR`(void)
{
//timer tick functions
if(check == 0)
{
CLOCK = 0;//getting a low signal
}
else
{
CLOCK = ! CLOCK;//toggling high& low
}
}
I'm checking this in the isr routine.
Hope I have not confused, please let me know where i'm going wrong.
do you mean you are getting pwm on say port A continuously now you want this signal on port B say for 5mins…once this 5 mins are over this signal will not be on port B….and by the time on port A this signal will exist continuously. ..
am I correct?
for wht duration you have configured timer? ? means how much is time interval of pwm singal is high or low
But I'm not generating a PWM signal on portB, just a high and low pulse,
later i'm using a transistor circuit for switching, now my concentration is only on
portB to how to hold a signal , not on portA.
hi can u mail all your code on my id [email protected]
means initially you want high low pulses in port a later on it will be on port b now fot 5 mins
Ok i'll mail complete code.