| The 12F675 is one of the smallest PIC Microcontrollers | | | | State machines |
| - it's a tiny device with 8 pins but it's packed with | | | | You could also implement a state machine for more |
| peripherals and it even has a built in 10bit ADC which | | | | complex 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 external | | | | microcontroller is that if you get it wrong you just re |
| components to make it work (other devices require an | | | | code your software and test it again. |
| external crystal oscillator). Of course it also has the | | | | Note: The 12F675 and 12F629 use Flash programming |
| usual internal programming memory, EEPROM and | | | | memory 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 can | | | | Serial Programming) and with careful design you can |
| implement a serial RS232 transmit interface to your | | | | even 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 put | | | | The programming language normally recommended is |
| into restricted spaces e.g. for a model aircraft or model | | | | assembler 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 ADC | | | | size 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 normally | | | | This is because for assembler you need to work at |
| think of using a microcontroller for instance you could | | | | such a low level that you spend a lot of effort to do |
| make a touch lamp dimmer - Note using the | | | | trivial tasks and this is better left to the high level |
| microcontroller means you can make far better | | | | language. |
| functionality than using discrete hardware (and even | | | | For 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 delay | | | | assembler but much easier in C. |
| function e.g. if no activity for an hour then turn off. | | | | |