khansaab21
Advanced Member level 4
pwm in 8051
Hello friends.
I have selected automatic temperature control as my semester project. I have almost developed the code in C. But there is one logical error in the code which I am unable to remove.
Basically there are 2 temperatures.
1. User input from keypad (desired temperature).
2. Obtained from ADC connected to LM35 (surrounding temperature).
Both temperatures are of two digit and in packed BCD form.
What i want is the difference of two temps and a pulse proportional to the difference driving the fan. When the difference is 0, the (min) on time of fan is 10 ms. The on time increases linearly with the difference.
The problem is when these temp values are supplied to the formula evaluating the on time of the fan, it doesnt respond as desired. Instead the on time is always at random. But, when decimal values are forced in the formula, it does respond as it should be in the former case.
Plz help me.
Hello friends.
I have selected automatic temperature control as my semester project. I have almost developed the code in C. But there is one logical error in the code which I am unable to remove.
Basically there are 2 temperatures.
1. User input from keypad (desired temperature).
2. Obtained from ADC connected to LM35 (surrounding temperature).
Both temperatures are of two digit and in packed BCD form.
What i want is the difference of two temps and a pulse proportional to the difference driving the fan. When the difference is 0, the (min) on time of fan is 10 ms. The on time increases linearly with the difference.
The problem is when these temp values are supplied to the formula evaluating the on time of the fan, it doesnt respond as desired. Instead the on time is always at random. But, when decimal values are forced in the formula, it does respond as it should be in the former case.
Plz help me.