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.

need help in handling ADC in PIC using ASM

Status
Not open for further replies.

bhaskaran

Newbie level 6
Joined
Nov 27, 2004
Messages
13
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
91
pic adc code in asm

i have tried to capture the data from the ADRESL and ADRESH , when ever iam moving this data to any buffer my system get hang.

kindly help me in solving this problem.(using assembly language )
 

adc pic hangs

if we are currently in bank 0

movf ADRESH,w
movwf adch
banksel ADRESL
movf ADRESL,w
banksel ADRESH
movwf adcl

now you have the information in adc registers in adch and adcl
 

adc asm pic

i have changed the bank accordingly. the actual status of my project is, when i moved the data of ADRESL directly to the port it is showing some reading but when ever i moved to any buffer, no value is displayed.
 

pic adc code in asm

hi. i could't understant the problem exactly but the code i sent should work...
perhaps you could't load correct values to ancon0 and adcon1...
don't forget: to load adresl register to any port, after taking asresl value to w, you have to pass bank0...otherwise you will change the tris register....
perhaps you should send your code.....
and i recomment that document:
https://ww1.microchip.com/downloads/en/DeviceDoc/adc.pdf
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top