Setting up ASM to use the PIC16F88 device.
Posted: Fri Nov 18, 2005 12:40 pm
I thought I would post this as it's a question we get a lot.
When the Assembly course was written the standard educational PICmicro was the PIC16F84.
The course was written with this device in mind.
Since then other PICs such as the 16F88 have become popular for educational use as they have additional features, such as Analogue inputs that give them more flexability.
A decision was taken to supply or new development boards with 16F88 devices.
Generally the courses can be used as they are for learning how to write Assembly.
However there are two important differences that need to be taken into account.
The 16F88 is set up so that the Analogue inputs are on by default. Unless you turn them off the Port A and Port B RB6 and RB7 pins will be analogue, and not available as digital outputs.
At the beginning you can just use the bit of code from the page β€Getting Started\Using E-blocks with the tutorialsβ€ as is.
e.g.
BSF 3, 5
CLRF H’9B’
BCF 3, 5
At the beginning you do not need to know what this code does, just that you need to add it to beginning of your code.
Later on, when you have become used to working with Assembly you will begin to understand what the code means, and how to rewrite it for added readability, which is what the second version does.
When you finally read about the Analogue ports the meaning of the code will become apparent and you will be able to modify the code if Analogue inputs are needed.
The second __Config issue is because the example files have embedded config words based on 16F84 configuration settings.
These settings were put there so that beginners could run the tutorials without worrying about how to configure the 16F84.
If a _Config is found in a file it takes presidence over the config as currently set up in the software.
This is useful for beginners who are unsure what XT and RC and Watchdogs etc. do.
However now that users may have a variety of devices, especially the 16F88, we have the problem that a config word suitable for the 16F84 may not be suitable for other devices.
So if you are using a 16F88 for instance you will need to comment out the _Config in the asm code.
You will need to understand and check the configuration settings now, something you did not need to do with the 16F84.
There is a section on the page giving examples and a brief description of the main settings to consider.
Please refer to this page for details.
When the Assembly course was written the standard educational PICmicro was the PIC16F84.
The course was written with this device in mind.
Since then other PICs such as the 16F88 have become popular for educational use as they have additional features, such as Analogue inputs that give them more flexability.
A decision was taken to supply or new development boards with 16F88 devices.
Generally the courses can be used as they are for learning how to write Assembly.
However there are two important differences that need to be taken into account.
The 16F88 is set up so that the Analogue inputs are on by default. Unless you turn them off the Port A and Port B RB6 and RB7 pins will be analogue, and not available as digital outputs.
At the beginning you can just use the bit of code from the page β€Getting Started\Using E-blocks with the tutorialsβ€ as is.
e.g.
BSF 3, 5
CLRF H’9B’
BCF 3, 5
At the beginning you do not need to know what this code does, just that you need to add it to beginning of your code.
Later on, when you have become used to working with Assembly you will begin to understand what the code means, and how to rewrite it for added readability, which is what the second version does.
When you finally read about the Analogue ports the meaning of the code will become apparent and you will be able to modify the code if Analogue inputs are needed.
The second __Config issue is because the example files have embedded config words based on 16F84 configuration settings.
These settings were put there so that beginners could run the tutorials without worrying about how to configure the 16F84.
If a _Config is found in a file it takes presidence over the config as currently set up in the software.
This is useful for beginners who are unsure what XT and RC and Watchdogs etc. do.
However now that users may have a variety of devices, especially the 16F88, we have the problem that a config word suitable for the 16F84 may not be suitable for other devices.
So if you are using a 16F88 for instance you will need to comment out the _Config in the asm code.
You will need to understand and check the configuration settings now, something you did not need to do with the 16F84.
There is a section on the page giving examples and a brief description of the main settings to consider.
Please refer to this page for details.