Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

GETADC on 8515

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
rollo62

Bascom Member



Joined: 08 Jun 2005
Posts: 2

PostPosted: Thu Jun 09, 2005 12:15 am    Post subject: GETADC on 8515 Reply with quote

Hello friends,

I need to use the GETADC on a 8515 chip.

I tried (for testing) to use the sample ADC.bas program (changing the $regfile to "8515def.dat") but when i try to compile it, i get the following error :

Error : 101 Line : 29 Can't find HW-register [ADMUX ] , in File : C:\DOCUMENTS AND SETTINGS\ROLLO\DESKTOP\PROGRAMMAZIONE\AVR SAMPLES\ADC.BAS

If i compile it for the 8535 i get no error, but on the sample program it is specified that i work with any chip with an ADC, so it should work with the 8515.

Can anyone help me ?

Thank you in advance

Rolando
Back to top
View user's profile
DToolan

Bascom Member



Joined: 14 Aug 2004
Posts: 1384
Location: Dallas / Fort Worth, Texas (USA)

blank.gif
PostPosted: Thu Jun 09, 2005 1:02 am    Post subject: Reply with quote

There are no ADC (Analog to Digital Converter) channels in the 8515. Look over the parametric table for AVR's at... http://www.atmel.com/dyn/products/param_table.asp?family_id=607&OrderBy=part_no&Direction=ASC
Back to top
View user's profile Yahoo Messenger
rollo62

Bascom Member



Joined: 08 Jun 2005
Posts: 2

PostPosted: Thu Jun 09, 2005 9:11 am    Post subject: 8515 Reply with quote

I am sorry, you are right, i had confused the two analog comparator inputs with adc converters.

No the question could be : how do I have access to the comparators on the AVR bascom ?

Thank you again
Back to top
View user's profile
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 923
Location: France

france.gif
PostPosted: Thu Jun 09, 2005 4:20 pm    Post subject: Reply with quote

hi,
try this small program, I wrote it to test on a M32 but it's must be the same with the 8515 :

bon courage !
JP

'on all samples I write, I use a LCD so I need time to display and read
' that why I use wait or waitms so often.

' comparer 2 tensions avec un M8
' analog comparator
' j'utilise 2 potentiometre de 10K dont 1 est de 20 tours
' I use 2 pot of 10K (1 pot is a 20 laps)
'gnd----^^^^^^----vcc
' -^----------portD.6 (Ain0)
'gnd---^^^^^^-----vcc
' -^----------portD.7(Ain1)

'on 5 Volts I can check a change of 2/100 of volt !
'------[variables]---------------
Dim , J As Word
'-------[ config ]-----------------------------------

'config must be writen on 1 lign
Config Lcdmode = Port ' config 4 bit
Config Lcdpin = Pin , Db4 = Portc.3 , Db5 = Portc.2 , Db6 = Portc.1 , Db7 = Portc.0 , E = Portc.4 , Rs = Portc.5
Config Lcd = 16 * 2
'-------------------------------------------------

'config the interrupts
Config Aci = On , Compare = Off , Trigger = Toggle
Enable Interrupts
Enable Aci
On Aci Inter 'name of the interrupt
Wait 1
Cls
'main loop----------
Do
Locate 1 , 1 : Lcd "wait"
Wait 1
Loop
End 'end program

Inter: 'the interruption
J = J + 1
Locate 2 , 1 : Lcd "change:" ; J 'nb of toggle
Waitms 200
Return
Return 'yes 2 return on an interrupts

_________________
pleasure to learn, to teach, to create
Back to top
View user's profile Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
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
You cannot attach files in this forum
You cannot download files in this forum