In any case, you stated the PIC detects line frequency. Maybe this explains the purpose of pin 5? I believe the PIC has an internal oscillator, so the blinking rate of the LED may be a divided frequency of the oscillator; or maybe it's divided from the 60Hz and pin 5 serves more than just initially detecting frequency.
Yes, no, the latter
. The purpose of pin 5 is to detect the mains cycle - specifically when the mainis cycle crosses close to zero. This event is used in the initialisation to determine the mains frequency. The period of the mains cycle is measured against the PIC's initernal oscillator (whihc is assumed to be about 4 MHz.) The PIC will remain in this initialisation until it obtains a measurement of the mains frequency that lies in the range 48 to 54 Hz, or 54 to 62 Hz.
Now that the PIC knows the mains frequency to be either 50 or 60 Hz, it defines a tenth of second count as either 10 or 12 - this is the number of half-cycles of mains in a tenth of a second.
From here on, the PIC sits in a loop that is synchronised (via pin 5) to the main half-cycles. It must be! It needs to know when to fire the triac.
So we have a loop of code that runs every half-cycle of the mains. We can use the value(s) determined in the initialisation to increment a tenths of a second timer. And the tenth of second counter can be used to determine seconds, and the seconds to minutes. The reason for the tenths of second counter (rather than going directly to seconds), is that the heating of the iron occurs in tenth-second bursts. The length of each burst can be divided into either 10 or 12 units, which gives a semi-proportional heat control. In normal operation the LED flashes (if enabled) with the heating of the iron; in other situations the LED flashes at the rate set by the least significant bit of the tenths counter.
All the timing and synchronisation is inherently linked to the mains cycles via pn 5. The actual frequency of the PIC's oscillator is secondary (although it must be "close-enough" to get through the initialisation stage).
Conclusion: Pin 5 must "wobble" at the mains frequency or the PIC don't go!
Also, on page 3 of the manual, it states setting the dial to 600 degrees F for a factory reset. At least once with the old PIC I did a "factory reset", however, I didn't put the face plate on to see where the dial is, but know the middle point of the poteniometer is 600 degrees F.
Ok, let me clarify what I meant. The manual is not wrong, but it does not tell lthe whole story. If you power-up with the magic pencil in place, one of four things happen:
1. Dial at minimum ( less than 400F), the LED flash enable flag is cleared (i.e. the LED will flash when the iron is heating).
2. Dial at maximum (greater than 800F), the LED flash enable flag is set - the LED does not flash during normal operation.
3. Dial (as read by the PIC) is between 525 and 675F. Set tip-offset temperature to zero. Assume the operator has set the knob to 600F and take difference as an offset to the dial reading, i.e. calibrate the dial.
4.If none of the above - do nothing.
Although, now that I think of it, when I installed the new PIC, I just turned on the iron and waited without seeing the LED blink. From what I believe you've stated, a new PIC wouldn't have values from the original PIC, so the new PIC should have set flags and blinked the LED (unless I misinterpreted your explanation).
Yes. I think you have the gist of what I was saying/thinking. All the "information" to create a fully working soldering station is baked-in to the firmware of the PIC.
Location 1 : Tip offset temperature. One byte that saves the tip-offset temperature in 2Cs Fahrenheit.
What is 2Cs?
Two's compliment. I.e. the values in the one byte are assumed to range from -128 to 127.