CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

dsPIC30F4011 ADC at 1MSPS

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
trevisan



Joined: 22 Aug 2008
Posts: 1
Location: Brazil

View user's profile Send private message Send e-mail

dsPIC30F4011 ADC at 1MSPS
PostPosted: Fri Aug 22, 2008 12:23 pm     Reply with quote

Can anyone tell me how to configure the ADC to work at 1MSPS.
Gendrick PeƱalver
Guest







Read ADC
PostPosted: Mon Aug 25, 2008 7:35 pm     Reply with quote

Hi, I use this code, in asembler, for read all ADC in the 30F4011, read the data sheet
for undestend that, exuse my English..


.equ __30F3011, 1
.include "p30f3011.inc"

_main:
CALL _VisualInitialization

;*******************
mov #0X0038, w0
mov w0, ADPCFG

mov #0X0000, w0 ;0000, canal 0
mov w0, ADCHS

mov #0X0000, w0
mov w0, ADCSSL

mov #0X0B02, w0
mov w0, ADCON3

mov #0X80E4, w0 ;AD=off, idle=0,enteros,E=1110
mov w0, ADCON1 ;111 =interno, ASAM y SAMP=0

MOV #0X0004, W0
MOV W0, ADCON2

BSET ADCON1, #15 ;AD =On

BCLR IEC0, #11

mov #0x1000, W0 ; Nivel de INTRR ADc =1
mov W0, IPC2

BSET IEC0, #ADIE ; ACTIVA INTRR. POR ADC

BSET ADCON1, #1 ; Comienzael muestreo

;****** Lee el canal 0 ; read ADC0
Bucle:

mov #0X0000, W0 ;0000, canal 0
mov W0, ADCHS

BSET ADCON1, #15 ;AD =On

BSET IEC0, #ADIE ;activa la Interr

BSET ADCON1, #1 ; Comienza el muestreo

And so on
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group