Blogs

After measuring the voltage on the divider, it seemed ok, as it varied linearly with the output voltage, it was also right around what I calculated it should be it's a 90k/10k divider so the output voltage of the divider should be (and is) very close to 10% of the post voltage. However the output of the opamp (configured as a unity buffer) does not go much above 1.9v which is why the ADC tops out at ~19v.

As the desire to provide feedback from the power supply on what it is actually doing as well as what it has been commanded to do has always been present, I designed into the board the necessary connectors, voltage dividers and op amps to connect and condition the voltage from the output posts. With the board correctly configured, it is a simple task to configure and turn on the ADC and read the results.

After the PIC24 redesign, it has been my wish to use the realtime clock so that the reports to the serial port can be made with the correct time. Unfortunately when the processor loses power, the clock stops and the time is reset.

To get around this, I figured that I would use a battery and the low power characteristics of the microcontroller. When I designed the board I added the battery holder for a CR2032 and an LTC4411 from Analog/Linear to manage the switching between the power sources.

The regulator uses variable resistors to control the output voltage and current. I plan on replacing this control with a voltage level.

To generate the voltage levels I will use the PWM outputs from the microcontroller. The PWM will need to be smoothed into a steady voltage level for which I will need a low pass filter.

I went through the process of writing the heap_malloc function, and got it ready for the initial testing. I decided that I would do that in the simulator, so I added a heap_malloc of 1 byte to the main function. On the first run, the code crashed with an invalid program counter. This is the block of code with the crash

As previously mentioned, I needed to implement "malloc" and "free" in order to use cJSon.

To avoid conflict with the standard library names, and to reflect that these functions use their own data heap, I called them "heap_malloc" and "heap_free".

After making the decision to use cJSon, I set about getting the bare minimum together to see the output. I incorporated the c and h files into my project, and by following the example on the git hub page (https://github.com/DaveGamble/cJSON) I created my first JSon string.

Over the years, I have implemented several protocols to transfer data between clients and servers, both in the traditional network socket sense as well as for various projects that use serial ports. This usually comes down to throwing various ideas around and eventually settling on a "colon deliminated line" where each instruction or status report is a single line, with each element separated by a colon. While this is a simple on-wire protocol, it does require the parsing side to know how many colons to expect, as well as error handling for when there are an unexpected number of colons.

As mentioned sometime ago, now SolarDock is essentially finished, I have reopened my PSU project.

I shook the collected dust off the PCB and source code, and started looking into what was outstanding. Fortunatly I had been pretty thorough with the ticketing system built into my instance of gitlab-ce so this didn't take too long.

I confirmed that the serial port stuff worked, and set about getting the LCD character display to work. Here started the problems.

With another month of nearly flawless behaviour, I am going to have to say that SolarDock is done.

Sure there is some weirdness when turning on and off where some postcaps don't "hear" the NRF and so don't turn on or off in response to the broadcast message. This appears to be fairly random and clears up on it's own without any intervention from me.

Last weekend, we sat out on the dock for a couple of hours one evening with all of the lights on, and it worked without issue, the only effect was that it took a little longer to reach full charge the following day.

Pages

Subscribe to RSS - blogs