Gast
#1348262
Hallo ! Ich versuche ein Spannung mittels ATMega 32 zu messen. Bekomme aber auf dem Display immer nur 1023 angezeigt, auch wenn PA0 auf Masse liegt. Woran kann das liegen ...??? Hier teile aus meinem Code: $regfile = "m32def.dat" ' Controllerauswahl $crystal = 8000000 'Quarzfrequenz $hwstack = 256 $swstack = 256 $framesize = 256 '$baud = 9600 Config Lcdpin = Pin , Rs = Portb.0 , E = Portb.1 , Db4 = Portb.2 , Db5 = Portb.3 , Db6 = Portb.4 , Db7 = Portd.5 Config Lcd = 20 * 4 Config Lcdbus = 4 Initlcd Cls Config Adc = Single , Prescaler = Auto 'Now give power to the chip Start Adc 'With STOP ADC, you can remove the power from the chip 'Stop Adc Dim Wert As Word Dim Volt As Single 'now read A/D value from channel 0 Locate 1 , 1 Do Wert = Getadc(0) Text = "Channel 0 = " + Str(wert ) Lcd Text wait 1 Loop