How about it? Experiments of the third kind , take 999999. Update Programming, and it works!
The avid reader and PIC expert would have noticed in the previous picture:
formatting link
The 18F14K22 has 20 pins, and I used the wrong IC socket as connector. Put it in the programmer and id not even notice,,, Vpp goes to the wrong pin..... I expected a dead PIC, but those PICs are strong, it survived, it programmed OK after replacing that connector with a 20 pin one... The idea of breaking out the chip and wiring it again ... not something for people with sensitive nerves and little patience.
Here the programming setup:
formatting link
The USB stick holds the software sources, I had to move to a different location as the programmer needs a PC with parallel printer port. The little black box (I have loads of these little black boxes they are great for small PIC projects) holds a RS232 to logic level interface. Below that a supply of 18F14K22 Microchip PICs.... Luckily they were not needed for replacement... That pink thing top right has nothing to do with electronics, but is normally used under a cup of coffee.
Most amazing of all, after programming the initial test works! Now that is a rare thing for 5000 lines of code that was not checked on any hardware, I deserve an award for that, Of course I used old libraries I wrote, but even then it amazes me. Connected it to the RS232, and it immediately said hello at the correct baudrate:
formatting link
I pressed 'D" for debug, and it started outputting the ADC values one per second. The first one is 779 or 780 for measuring the 2.5 V MCP1525 reference against the PIC internal 1024mV reference, there is a 1k versus 2k2 divider, lets see: ( (1000 / (1000 + 2200) ) * 2.5) = .78125 V. If 1.024 V is 1024 steps of the ADC then we should see 781, there is tolerances in both PIC internal reference and the MCP1525 reference, close enough. The 1 step change (one bit jitter) is to be expected, no averaging done in debug mode, just directs the ADC. The second ADC channel is not connected as moved the battery voltage measurement to the PIC on the main board, but it is still in this software version. The next channel is the voltage over the 1N4148 diode temperature sensor, it has 12k to +5 here, a few uA, and this matches what I measured over that diode.
The last 2 channels are the light and dark channel and over-range as the box is open and light floods in.
Wow!
Enough for today I think.
I am so amazed it works first time... :-)