Thursday, May 10, 2012

PIC Fever

CAUTION: HIGHLY CONTAGIOUS AND NO CURE FOUND YET


Greeting Everyone!!!!!!!!!!!!!!!

That's right - We have got the PIC Fever and its very contagious.

A little history or recap rather of the PIC's we have worked on:

The last is indeed PIC18F4520, and not a 16F series. The RnD team has moved on to higher series because the work being done does demand higher versions and added features.

Before moving on to the 18F series family, a quick review of what the 16F family offered and a few things common in 16F84a, 16F628A and 16F887:

  • 8-BIT Micro-controller
  • Operating Speed of 20MHz
  • Direct, Indirect and Relative Addressing modes
  • Eight-level deep hardware stack
  • 35 single-word instructions
All though these maybe some of the similarities which are prominent, we do have additional features in the 16F series.

The programming language is Assembly Level Language and  the program can be ported into different PIC 16F series with little changes. The changes are mentioned in the migration documents available in Microchip site. For instance, migrating from 16F84A to 16F628A is quite simple where you have to just turn-off the comparators in the 16F628A and also change the code-block address to 20H since 16F628A starts at 20H.

Most important is the CONFIG bits in the 16F series, the 16F84A as the least number of configuration bits, 16F628A as a little more due to the added features and then 16F887 has the two line CONFIG definition as then are a lot of features.A small example is, 16F84A has to have a external crystal oscillator, 16F628A has Internal precision 4MHz as well as an option for external and the 16F887 has an internal 8MHz variable and an option for external oscillator.

The list can keep going on for difference's and similarities between the PIC 16F series. So, the question is how do we know which PIC to choose? well, simplest answer is define the project function, read the datasheet, see if the  required feature for the project is available and voila you have a PIC for your project.

The same mantra was followed for another project in the RnD labs and we had to choose another PIC family series for the project. Thus, we stumbles upon the PIC 18F series family. So why did we really choose the 18F, well the project required us to use more stack area and since the 16F series were limited to just 8 levels we moved on to 18 F because it had 31-levels of stack which is far more greater than required.

Small doubt, why no use software stack method? The truth is we are not sure how this is done and there are few sites with great info on this and we are trying out the possibilities of software stack method. Meanwhile, as the current project deadline approaches, we have taken the shortcut and chosen a 18F series to solve the problem.

When it comes to programming the 18F, it is still the Assembly Level Language but the op-codes and style of accessing the Special Function Registers and Access Bank in the 18F is very much different.  Also, the 18F series has an extended Instruction Set with about 75 Instructions. So, with a little change of programming style and datasheet, one can migrate from 16F to 18F quite easily. Also, I have come across that there is not a single place on the internet where a proper migration from 16F to 18F is available. So, we have decided to host a document with necessary changes and migration notes soon enough in our Download Tab.

Stay tunes for more updates. Suggestions and idea will be worshiped in our RnD Labs.

 


 

No comments:

Post a Comment