The 12F675 - A PIC Microcontroller Project Guide

The 12F675 is one of the smallest PIC MicrocontrollersState machines
- it's a tiny device with 8 pins but it's packed withYou could also implement a state machine for more
peripherals and it even has a built in 10bit ADC whichcomplex control of the functionality e.g. pressing once
can read analogue inputs from 4 pins.moves to the next dimming level in the current direction
It has the following internal peripherals:while press and hold changes the dimming direction.
1. Two timers.Using a state machine while not trivial lets you control
2. An analogue comparator.complex operation which you could not achieve
3. 10 bit ADC.(without a great deal of effort) using discrete
It also has an internal oscillator and internal reset circuit.hardware - and the advantage of using the
This means the device uses minimal externalmicrocontroller is that if you get it wrong you just re
components to make it work (other devices require ancode your software and test it again.
external crystal oscillator). Of course it also has theNote: The 12F675 and 12F629 use Flash programming
usual internal programming memory, EEPROM andmemory i.e. they are re-programmable - you can
RAM needed for programming.change their functionality instantaneously with NO
Ideas for projects:re-wiring.
1. 4 channel volt meter.The only problems are:
2. Multi channel Servo controller.1. You need to program the device.
3. Temperature controller.2. You need a programming language.
4. Inductance meter.Programming the Device
5. Touch lamp.Surprisingly you can program the device using the
6. Courtesy light time delay.standard 4 pin PIC serial interface - ICSP (In Circuit
Note: To get data out of the device you canSerial Programming) and with careful design you can
implement a serial RS232 transmit interface to youreven connect your programmer to the same pins that
PC.your circuit uses.
Why use it?Programming language
One reason is that because of its size its easy to putThe programming language normally recommended is
into restricted spaces e.g. for a model aircraft or modelassembler and there are good reasons for using
trains and it's cheaper than the larger devices.assembler - e.g. very fast code and smaller final code
Note: The 12F629 is the same device without the ADCsize but I would recommend using a high level
- so it's even more cost effective.language such as Basic or C
So it's useful in designs that you would not normallyThis is because for assembler you need to work at
think of using a microcontroller for instance you couldsuch a low level that you spend a lot of effort to do
make a touch lamp dimmer - Note using thetrivial tasks and this is better left to the high level
microcontroller means you can make far betterlanguage.
functionality than using discrete hardware (and evenFor the example mentioned setting up and maintaining
change its programming later on).a state machine would be extremely difficult in
With a lamp dimmer you could have an auto off delayassembler but much easier in C.
function e.g. if no activity for an hour then turn off.