How do I configure a PIC to use its 8mhz internal clock with CCS C?

Status
Not open for further replies.

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();


}

Is the code above correct for setting up an 8mhz internal oscillator and ADC? Also is "int" an 8 bit?
 

16f688 adc

little help? How do I configure a PIC to use its 8mhz internal clock with CCS C?
 

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);

}}
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…