December 10, 2011

The 12F675 - A Pic Microcontroller task Guide

The 12F675 is one of the smallest Pic Microcontrollers - it's a tiny gadget with 8 pins but it's packed with peripherals and it even has a built in 10bit Adc which can read analogue inputs from 4 pins.

It has the following internal peripherals:

Basic Microcontroller

1. Two timers.

2. An analogue comparator.

3. 10 bit Adc.

It also has an internal oscillator and internal reset circuit. This means the gadget uses minimal external components to make it work (other devices need an external crystal oscillator). Of policy it also has the usual internal programming memory, Eeprom and Ram needed for programming.

Ideas for projects:

1. 4 channel volt meter.

2. Multi channel Servo controller.

3. Temperature controller.

4. Inductance meter.

5. Touch lamp.

6. Courtesy light time delay.

Note: To get data out of the gadget you can implement a serial Rs232 transmit interface to your Pc.

Why use it?
One theorize is that because of its size its easy to put into restricted spaces e.g. For a model aircraft or model trains and it's cheaper than the larger devices.

Note: The 12F629 is the same gadget without the Adc - so it's even more cost effective.

So it's useful in designs that you would not commonly think of using a microcontroller for instance you could make a touch lamp dimmer - Note using the microcontroller means you can make far good functionality than using assorted hardware (and even change its programming later on).

With a lamp dimmer you could have an auto off delay function e.g. If no operation for an hour then turn off.

State machines
You could also implement a state machine for more complex control of the functionality e.g. Pressing once moves to the next dimming level in the current direction while press and hold changes the dimming direction.

Using a state machine while not trivial lets you control complex carrying out which you could not perform (without a great deal of effort) using assorted hardware - and the advantage of using the microcontroller is that if you get it wrong you just re code your software and test it again.

Note: The 12F675 and 12F629 use Flash programming memory i.e. They are re-programmable - you can change their functionality instantaneously with No re-wiring.

The only problems are:

1. You need to agenda the device.

2. You need a programming language.

Programming the Device
Surprisingly you can agenda the gadget using the approved 4 pin Pic serial interface - Icsp (In Circuit Serial Programming) and with meticulous create you can even join together your programmer to the same pins that your circuit uses.

Programming language
The programming language commonly recommended is accumulator and there are good reasons for using accumulator - e.g. Very fast code and smaller final code size but I would propose using a high level language such as Basic or C

This is because for accumulator you need to work at such a low level that you spend a lot of effort to do trivial tasks and this is good left to the high level language.

For the example mentioned setting up and maintaining a state machine would be very difficult in accumulator but much easier in C.

The 12F675 - A Pic Microcontroller task Guide

Wireless Internet Cameras HVAC Compressor Troubleshooting