Feb 23, 2006 #1 D david90 Advanced Member level 1 Joined May 5, 2004 Messages 423 Helped 9 Reputation 18 Reaction score 4 Trophy points 1,298 Activity points 3,611 #include <16F688.h> #use delay(clock=8000000) #fuses INTRC_IO,NOWDT,NOPROTECT,NOPUT void main() { int a; setup_oscillator(OSC_8MHZ|OSC_INTRC); SETUP_ADC_PORTS(sAN0); SETUP_ADC(ADC_CLOCK_INTERNAL); a=READ_ADC(); } Click to expand... Is the code above correct for setting up an 8mhz internal oscillator and ADC? Also is "int" an 8 bit?
#include <16F688.h> #use delay(clock=8000000) #fuses INTRC_IO,NOWDT,NOPROTECT,NOPUT void main() { int a; setup_oscillator(OSC_8MHZ|OSC_INTRC); SETUP_ADC_PORTS(sAN0); SETUP_ADC(ADC_CLOCK_INTERNAL); a=READ_ADC(); } Click to expand... Is the code above correct for setting up an 8mhz internal oscillator and ADC? Also is "int" an 8 bit?
Feb 24, 2006 #2 D david90 Advanced Member level 1 Joined May 5, 2004 Messages 423 Helped 9 Reputation 18 Reaction score 4 Trophy points 1,298 Activity points 3,611 16f688 adc little help? How do I configure a PIC to use its 8mhz internal clock with CCS C?
Feb 24, 2006 #3 hugo Full Member level 6 Joined Dec 31, 1999 Messages 322 Helped 49 Reputation 98 Reaction score 23 Trophy points 1,298 Location canada Activity points 2,148 intrc_io con pic c Hi, Just go to this nice forum : https://www.ccsinfo.com/forum/ you'll get happy...
intrc_io con pic c Hi, Just go to this nice forum : https://www.ccsinfo.com/forum/ you'll get happy...
Feb 27, 2006 #4 necati Member level 1 Joined Mar 27, 2003 Messages 40 Helped 8 Reputation 16 Reaction score 8 Trophy points 1,288 Location turkey Activity points 471 que es set_tris_a(0b00000001); #include <16F688.h> #device adc=10 #use delay(clock=8000000) #fuses INTRC_IO,NOWDT,NOPROTECT,NOPUT int16 a; void main(){ set_tris_a(0b00000001); SETUP_ADC_PORTS(sAN0); SETUP_ADC(ADC_CLOCK_INTERNAL); while(true){ set_adc_channel(0); a=READ_ADC(); delay_ms(10); }}
que es set_tris_a(0b00000001); #include <16F688.h> #device adc=10 #use delay(clock=8000000) #fuses INTRC_IO,NOWDT,NOPROTECT,NOPUT int16 a; void main(){ set_tris_a(0b00000001); SETUP_ADC_PORTS(sAN0); SETUP_ADC(ADC_CLOCK_INTERNAL); while(true){ set_adc_channel(0); a=READ_ADC(); delay_ms(10); }}