My first major PIC project is coming along nicely (after a long summer break on the shelf
).
Basically it is a solar panel / light controller. The PIC monitors the output of the solar panel. When the voltage drops below a settable level, an adjustable timer is started. When the timer expires, the light is turned on.
After the light comes on, another timer is started. The battery level is monitored. The light is turned off when the second timer expires or when the battery level drops below a settable amount, whichever comes first.
The project has an LCD panel and a couple of buttons to allow setting of the various functions of the timer.
The current code design is a little crude. Right now it polls the analog input for the voltages and binary inputs for button press. The timer is also polled until it reaches the given value.
I currently save a little power by only lighting the backlight after a button press. The light is turned off after one minute of no buttons being pressed.
I would like to save more power.
Can I also use the same output that powers the backlight to turn off and on the LCD itself?
How can I improve my project and save more power using sleep?
I guess where I maybe need the most help is how to monitor my analog inputs without having to poll them. I don't need details, just pointed in the right direction, though a ling to a sample project would help.
I seem to remember reading something about comparators.
Basically it is a solar panel / light controller. The PIC monitors the output of the solar panel. When the voltage drops below a settable level, an adjustable timer is started. When the timer expires, the light is turned on.
After the light comes on, another timer is started. The battery level is monitored. The light is turned off when the second timer expires or when the battery level drops below a settable amount, whichever comes first.
The project has an LCD panel and a couple of buttons to allow setting of the various functions of the timer.
The current code design is a little crude. Right now it polls the analog input for the voltages and binary inputs for button press. The timer is also polled until it reaches the given value.
I currently save a little power by only lighting the backlight after a button press. The light is turned off after one minute of no buttons being pressed.
I would like to save more power.
Can I also use the same output that powers the backlight to turn off and on the LCD itself?
How can I improve my project and save more power using sleep?
I guess where I maybe need the most help is how to monitor my analog inputs without having to poll them. I don't need details, just pointed in the right direction, though a ling to a sample project would help.
I seem to remember reading something about comparators.
