julian on December 13th, 2009

This program is a bit of a novelty, it uses the PIC’s watchdog timer to flash an LED. It’s probably the least sensible way to make an LED flash, but it illustrates some interesting features of the 12F683 microcontroller.
A few things to note. We intentionally don’t use the CLRWDT instruction, we want the WDT to timeout and reset [...]

Continue reading about 12F683 Flashing LED using watchdog timer

julian on December 12th, 2009

With the design of the charge controller nearly completed, thoughts turn to its robustness. Or, in other words, how easy would it be to destroy it by connecting it up all wrong?
If the battery is connected with the wrong polarity, it’s fine. Both the charge pump and the voltage regulator circuits have protection diodes, the [...]

Continue reading about Protection

julian on December 10th, 2009

With the previous battery measurement circuit, an 8.2 volt zener defined the battery voltage that would yield zero from the ADC. The equation for voltage at the ADC was
Vadc = 0.6875 (Vbatt - 8.2)
So for a target voltage of 14.2 volts, Vadc was 0.6875 x 6 = 4.125. The 8 bit ADC byte was 4.125 [...]

Continue reading about Voltage Targets

julian on December 7th, 2009

The PIC 12F683 has 3 timers, Timer0, Timer1 and Timer2.
Timer0 is an 8 bit timer with an 8 bit prescaler and is currently being used to drive the LED pattern generator. Each time Timer0 overflows, a register called ‘pattern’ is incremented and analysed to determine whether the LED should turn on or off. These patterns [...]

Continue reading about 12F683 Timers

julian on December 6th, 2009

As it stands, the charge controller has a 2-stage charge algorithm, bulk and saturation. For lead-acid batteries, a third stage is necessary called float charge.
During the bulk charge phase, all of the solar panel current is fed into the battery. As long as the battery voltage remains below the maximum permissable voltage (about 14.2 volts) [...]

Continue reading about Float Charge

julian on December 6th, 2009

It should be possible to use the LED to display both volts and tenths of a volt. This would make the charge controller’s voltmeter function much more accurate, much more useful.
Implementation would involve displaying volts first, then tenths. Volts would still be displayed with 10 subtracted, 4 flashes for 14 volts and so on. Tenths [...]

Continue reading about Tenths