setting of multiple channels for ADC in PIC C

Hello everybody,

I am very new to PIC C programming and i want to configure the control register of the ADC and program in such a manner that i can direct the ADC to happen according to my choice of channels.Like say if i want channel 1 to be activated and perform adc and then channel 2 ..then again channel 1..i shud be able to do so according to my choice. I am trasfering the digitized data thru RS232 n saving it in hex format. CAN anybody plz help me with the configuration of the control register (ADCON) which will help me to perform the adc over multiple channels and to set the interrupts and the ADC ports accordingly??? Thanks a lot eagerly waiting for responses. regards chinmayee

Reply to
romi29
Loading thread data ...

You did not say *waht* PIC you want to use. So I'll assume a PIC16 type here. It has 2 config registers: ADCON1: where you select how many and what inputs are analog inputs. Typically, you set up ADCON1 once at startup. ADCON0: where you select channel, speed and format of the conversion.

Read up on your chip's datasheet. It is everything there, even sample code.

HTH Wolfgang

--
From-address is Spam trap
Use: wolfgang (dot) mahringer (at) sbg (dot) at
Reply to
Wolfgang Mahringer

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.