View previous topic :: View next topic |
Author |
Message |
nhh
Joined: 24 Mar 2006 Posts: 1 Location: Vietnam
|
ADC-Help me |
Posted: Sun Mar 26, 2006 9:54 pm |
|
|
Hi!
I'm studying ADC PIC16F877A.Who can help me?
Why is there a faulse in this code
Code: | #device PIC16F877A *=16 ADC = 10
|
Thanks! |
|
|
Ttelmah Guest
|
|
Posted: Mon Mar 27, 2006 5:58 am |
|
|
There isn't...
However it depends on what else is in the code,and where you put it. To use the standard 'defines', you need:
#include <16F877A.H>
as the first line of your code.
If you then try to set the processor 'type', you will get a complaint, since it is already set in this include file.
So:
#include <16F877A.H>
#device *=16 ADC=10
As the first two lines of the code, is the normal way of including the standard defines, and setting the options you need.
Best Wishes |
|
|
Charlie U
Joined: 09 Sep 2003 Posts: 183 Location: Somewhere under water in the Great Lakes
|
|
Posted: Mon Mar 27, 2006 7:54 am |
|
|
Also, the compiler doesn't like spaces around the '=' in the device declarations. You get the "Can't change device type this far into code" error message. |
|
|
|