Saturday, June 6, 2009

Is the PIC 16F84 Dead? - The Most Popular Microcontroller Of All Time

Is the 16F84 too old for your electronic projects?

If you don't know what a 16F84 is then you have never heard of Microchip(R) - a company that creates powerful stand alone microcontrollers. A microcontroller is simply a very small computer but unlike standard computing systems everything is contained within the device itself. There are no external peripherals such as RAM, EPROM, I/O devices.

If you are looking for an easy way to create your own projects then microcontrollers fit the bill because they:

  • Are very Small (some have 8 pins and even smaller have 5).
  • Have many internal peripherals.
  • Are based on reprogrammable internal memory
  • Have built in timers.
  • Have internal RAM.

In short they are ideal for controlling your projects -- all you have to do is program them.

This is one of the spectacular advantages over doing discrete designs since if you make a mistake in a discrete design you will have to debug and re-wire. With a microcontroller you can just re-program the device in circuit (having simulated the code to figure out the mistake first).

Even better is the fact that you can make advanced projects, because internally the peripherals operate quite fast e.g. you could create a 50MHz frequency counter using no external components (except a display).

Languages

In fact you can program them in many different languages but the most popular is machine code. The reason for it's popularity is the fact that MicroChip(R) created all the tools necessary for development of a machine code program for free so you will find many many examples of assembler code on the internet.

Personally I don't like machine coding in assembler (although I can use it if needed e.g. for speed) because it takes a huge amount of time compared to using a high level language. In fact I would say it takes 10 times as long with assembler. Also assembler is a totally unstructured language; meaning that it is very hard to maintain i.e. if you want to add a module then you probably have to review the whole of the code whereas with a high level language areas of code are protected saving you from making mistakes.

Microchip has released many hundreds of different devices (now vastly improved over the 16F84) but the fundamental operation of each one is based on the original design and even if you only studied the original 16F84 (OK there was a 16C84) you would have a pretty good idea of how all of the range of devices work.

That is the great power of the MicroChip(R) devices i.e. you learn something using one device and you are adding to your knowledge for the whole range - for instance to program a 12F675, 16F84, 16F88 or 16F877 you need to know only about ICSP because that interface is shared across the whole range. This means your learning curve is greatly reduced.

Of course there are some specialized peripherals that are for professional developers such as driving the pins of a dedicated LCD but you only need to concentrate on the standard peripherals (good examples are in the 12F675, 16F88, 16F628 and 16F877).

Peripherals

In fact there are about 15 standard internal peripherals for the modern (16F range) device whereas the 16F84 has only one.

This is why I believe that the 16F84 has had a good running but it's now time to say goodbye to it. Other reasons for this are that it has a quarter the memory size of a 16F88 and now costs about 5 times as much.

Note The 16F88 and 16F628 borrow heavily from the 16F84 even having the same pinout so you won't have any trouble if you are already used to a 16F84.

Summary

The 16F84 is probably too old for serious design because there are newer (backwards compatible) devices that will allow you to create far more capable projects.

John Main's website provides microcontroller resources and free projects which are fully documented and include schematics and source code.

You can find example of a 50MHz Seven segment here: Frequency counter circuit. This uses a 16F877 as the microcontroller.

Vist this site for more: http://www.best-microcontroller-projects.com

No comments:

Post a Comment