Joined: 22 Oct 2005 Posts: 2 Location: Villar Dora (Torino)
Posted: Mon Oct 24, 2005 12:34 pm Post subject: Problem using getadc() on atmega48
Hello,
i would like to aquire an analog value from an input using ATmega48 device.
I tried to simulate the adc.bas example programm.
I modified the $regfile from $regfile = "8535DEF.dat" to $regfile = "m48def.dat"
Compiler run without problem but during simulation the programm lock on
W = Getadc(channel) up to watchdog timeout
$regfile = "m48def.dat"
Config Adc = Single , Prescaler = Auto
Start Adc
Dim W As Word , Channel As Byte
Channel = 0
'now read A/D value from channel 0
Do
W = Getadc(channel)
Print "Channel " ; Channel ; " value " ; W
Incr Channel
If Channel > 7 Then Channel = 0
Loop
End
can someone help me to understand how to using and programm adc on atmega48
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