|
|
View previous topic :: View next topic |
Author |
Message |
derricko
Joined: 03 Sep 2010 Posts: 8
|
16f876a mclr sAN0 |
Posted: Fri Sep 03, 2010 3:54 am |
|
|
Hi my mplab compiler on ccs language tools has shown error on the below statement
*** Error 111 "aCU_DET.c" Line 6(7,120): Unknown keyword in #FUSES "MCLR"
*** Error 12 "aCU_DET.c" Line 364(17,21): Undefined identifier MAIN sAN0
2 Errors, 0 Warnings.
Halting build on first failure
there are 2 statement on my code:
#fuses HS,NOWDT,PROTECT, BROWNOUT, PUT ,MCLR
setup_adc_ports(sAN0|sAN1|sAN2|sAN3) ;//SET 0-3 AS ANALOG
need some help. thanks |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Fri Sep 03, 2010 4:20 am |
|
|
1) You can only ever use fuses that a particular processor supports. These are listed at the top of the processor definition file.
2) The same applies to the options for things like setup_adc_ports. If definitions don't exist for particular things, it is (except in a few 'error' cases), because that particular processor doesn't support them.
Now, in your case, the 16F876A, does not support enabling/disabling the MCLR pin, so there is no MCLR or NOMCLR fuse option.
The 876A, also does not support the selection of individual ADC pins. There are only options to enable 'sets' of the pins, matching the options available in the data sheet. The combination you are trying to enable, is not one supported by the chip. Look at the data sheet, and the definitions in the include file.
Best Wishes |
|
|
derricko
Joined: 03 Sep 2010 Posts: 8
|
|
Posted: Sat Sep 04, 2010 6:29 am |
|
|
hmmm.. I am a noob in this area. May I know how to program it? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Sat Sep 04, 2010 9:57 am |
|
|
Start with the data sheet.
Section 11-2.
This shows the possible options for the A/D converter, in the table for PCFG3:PCFG0
The option you are asking for _is not available_, so there is no possibility of 'programming it'. Nearest you can get, is the third line down in the table, with A0, to A4, all analog.
Then go into the header file for the processor. Look for the section on 'setup_adc_ports'. Find the line with the same pattern of analog pins.
Use this.
Just get rid of the MCLR fuse - the processor always has MCLR enabled, hence no fuse.
Try.
If you still fail, post a really simple program (maximum of about 15 lines - just the header, and basic code), and we will then see if we can help.
Best Wishes |
|
|
derricko
Joined: 03 Sep 2010 Posts: 8
|
|
Posted: Sun Sep 05, 2010 4:50 am |
|
|
cool, i will give a try. thanks |
|
|
derricko
Joined: 03 Sep 2010 Posts: 8
|
|
Posted: Mon Sep 06, 2010 11:43 pm |
|
|
Thank you Ttelmah, I think 16f876a doesn't support well. I have got to switch to 16f886, it works. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|