Whew! A nice resolution to a very, very frustrating day of debugging.
See, i was getting a zero reading from the thermocouple (as reported by the MAX6675 to the PIC 12F683). Now, if the thermocouple was disconnected (UNcoupled, as it were), the MAX sets a bit saying the thermocouple is missing (actually, an open circuit), and the code checks the bit and aborts the session when set.
But there was no program abort (i can tell because the red LED goes out when it should be on, and the green LED flashes a special pattern - 2 quick dits with a 2 second period - so that wasn't the problem.
Now, along the way to checking the code as a possible cause of the zero reading, i noticed the eePROM was getting cleared just as soon as the chip was programmed. So that HAD to be a coding problem.
So began an unfruitful 4 hours of code checking and cross-checking and getting nowhere.
Then, for no good reason it dawned on me to try a different PIC chip (i've been buying parts for 5 devices at a time -- hoping to built at least one functional vape and maybe a spare, cause, damn it all, the just broken prototype has proven, beyond a shadow of a doubt, the need to ALWAYS have a spare vape).
So i popped a spare PIC into the programmer, and the eePROM value stayed set the way it should be set. DUH! Like i say, i'm not a hardhead -- i'm a softie through and through (balls to bone, as the Oracle would say).
Put the correctly programmed PIC into the vape chassis, and then i was hot to go (so to speak).
Now, back to the problem of the zero reading from the thermocouple ...
If i held the thermocouple , jiggled it, wiggled the MAX, i could get a sporatic reading. So i disassembled the probe i had rigged up, uncoupled it from the MAX and fashioned a new pcb attachment. Still, the readings were erratic.
Using a continuity tester (for the 10th time) i sensed a weak PCB connection to one of the pins on the MAX - the one for the thermocouple + lead. Resoldered that pin, and the damn thing is working again.
This hassle got started during testing late last night -- the bare lead of the thermocouple must have touched the coil, created a path to ground, and immediately melted (the teflon insulation, too). Damn these batteries are intense.
And, now that i think about it, i'll just bet the eePROM on the PIC got fried at the same time. Damn good thing these parts are all so cheap.
So i finally got to take the afternoon toke at about 11:00pm. The batteries are re-charging now. It's getting late. Time to go to bed. Hopefully tomorrow i can make up some of the work i skipped to do this debugging.
But i had to get it done for a special visitor to the digital cave tomorrow and Saturday -- i just HAD to have a working vape i'll sleep well tonight.