View previous topic :: View next topic |
Author |
Message |
rollo62
Joined: 08 Jun 2005 Posts: 2
|
Posted: Thu Jun 09, 2005 12:15 am Post subject: GETADC on 8515 |
|
|
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 |
|
|
DToolan
Joined: 14 Aug 2004 Posts: 1384 Location: Dallas / Fort Worth, Texas (USA)
|
|
Back to top |
|
|
rollo62
Joined: 08 Jun 2005 Posts: 2
|
Posted: Thu Jun 09, 2005 9:11 am Post subject: 8515 |
|
|
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 |
|
|
Duval JP
Joined: 22 Jun 2004 Posts: 1161 Location: France
|
Posted: Thu Jun 09, 2005 4:20 pm Post subject: |
|
|
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 |
|
|
|
|
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
|
|