PIC Microcontrollers: Know It All

Studying devices such as the baseline PIC5x series (by which I mean PIC16F5x and PIC12F50x chips) allows us to learn about the basics behind PIC programming. The simplicity and low cost of these entry-level devices are definite advantages; however, this also means they lack some useful features. These features include analog to digital conversion (measuring an analog voltage), interrupts (which save having to test inputs manually), and an EEPROM (a bank of data that stays intact even when you remove power). These features are all found on a rather handy little 8-pin device called the PIC12F675. It is worth noting that this is a more "typical" kind of PIC microcontroller (rather than the simple PIC5x series) and so if you come across a new PIC microcontroller it is more likely to behave like this one. If you decide that 6 I/O pins are too few, there is a 14-pin version called the PIC16F676, which is essentially identical to the PIC12F675 but has 12 I/O pins.
Looking at the pin layout of the PIC12F675 in Fig. 10.1, you should notice similarities and differences between it and the PIC12F508 of the previous chapter. You will also see that some of the pins are labelled AN0, AN1, AN2 and AN3: these can be made analog inputs. VREF (pin 6) can be made the voltage reference for the other analog inputs (i.e., the PIC microcontroller compares the voltage at the other pins with the voltage on the VREF pin). INT...