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.

DSPIC33F ADC 12 bits single channel

Status
Not open for further replies.

midijl

Newbie level 1
Joined
Oct 12, 2011
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,291
Hi, I'm trying to configure a single Channel ADC on a DSPIC33FJ128GP202, 12 bits, on AN1 , no DMA , no sequencing , here is my init code , the issue I have here is that I'm well getting the AD1IF auto interrupt but ADC1BUF0 is always #0000 , if anybody can help, thks, my PIC is running at 80 Mhz , 40 Mips and I have other modules and software running well except this ADC module ,AVDD and AVSS are well connected , TEMP is W0 :
; Init ADC
mov #0X0001,TEMP
mov TEMP,AD1CHS0 ; channel Input is AN1
bset AD1CON1,#ASAM ; SAMP bit auto set
bset AD1CON1,#SSRC0 ; Auto sampling and convert
bset AD1CON1,#SSRC1
bset AD1CON1,#SSRC2
bset AD1CON1,#AD12B ; Select 12 Bits , 1 Chnl ADC Operation
clr AD1CON2 ; No channel scan for CH0+, Use MUX A, SMPI = 1 per interrupt, Vref = AVdd/AVss
clr AD1CON4
clr AD1CSSL
mov #0X031F,TEMP ; auto sample time and conversion clock select
mov TEMP,AD1CON3
bclr IFS0,#AD1IF ; reset ADCInterrupt flag
bset AD1CON1,#ADON ; Turn ON ADC module
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top