Spradecom
Joined: 01 Jun 2011 Posts: 19 Location: INDIA
|
Can use PWM in Timer0 interrupt |
Posted: Tue Aug 02, 2011 12:41 am |
|
|
I am using 16F684 to read 2 ADC channel and generate PWM according to ADC input. Channel 5 reads input supply and channel 2 reads temp using NTC with preset by making divider. If channel 5 input is in between 3-4.5 then it give duty output from 0.2 to 100%, below 3V input duty Out remains at 0.2% and above 4.5V output remains at 100%.
Also PWM output varies in accordance with reading temp. Using channel 2 if channel 2 input voltage is below 3.700V (< 60 deg temp.) then PWM output remain as output from channel 5, and if channel 2 input voltage above 4.090V (> 75 deg temp.) and channel 5 input above 20% then PWM output remain as 20% duty. Else if input of channel 5 below 20 % then output same as input to channel 5. I'm facing a problem when temp temp rise from 60 to 75 deg. When level change from one count to another it gives a fluctuation in PWM duty. Can anyone give me idea to avoid fluctuation ? |
|