[email protected]
Joined: 13 Jan 2014 Posts: 1
|
Need help........ |
Posted: Mon Jan 13, 2014 4:53 am |
|
|
i am using ccs 5 compiler , for pic16f877a, i have problems with adc
when i use this pre processor directive "#DEVICE ADC=10" it showing error , is there any other options for using 10 bit resolution adc.. plese help me.......... |
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Mon Jan 13, 2014 8:13 am |
|
|
#DEVICE ADC=10, is correct
Key is though it must be right at the top of the code. So:
Code: |
#include <16F877A.h>
#device ADC=10
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#use rs232(baud=9600, UART1, ERRORS)
|
It _won't_ be accepted, if it is after other things. It'll work after the fuses, but not after the delay, and/or the RS232 declaration.
Best Wishes |
|