Continue to Site

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 to use ADC channels simultaneously in pic16f877a

Status
Not open for further replies.

summerof69.kunal

Newbie level 6
Joined
Apr 25, 2010
Messages
13
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
sikkim
Activity points
1,457
hi..i want to use 3 adc channels simultaneously in pic16f877A..for one channel it is
set_adc_channel(1);
delay_ms(1000);
x=read_adc();

what would b the ccs coding if i want to use 3 channels simultaneously...plz send me the coding
 

Write your code like that

Code:
set_adc_channel(0);
delay_ms(10);
value1=read_adc();
  
set_adc_channel(1);
delay_ms(10);
value2=read_adc();

set_adc_channel(2);
delay_ms(10);
value3=read_adc();
 
There is only one ADC in the 16F877A so you can't take simultaneous measurements.

I don't use CCS but I would guess the best you could do is rotate channel numbers in the set_adc_channel() instruction.

Brian.
 

Hi,
I dont know ccs coding, but you can sample the 3 channels (external) at same time and read it out sequentially into your PIC...
K.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top