Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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,610
#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?
 

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,610
16f688 adc

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

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
422
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.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top