Hey!
Spannung hab ich gemessen, stimmt soweit.
Hier mal der Code aus BascomAVR:
Hoffe er hilft mein Problem zu finden.
'--------------------------------------------------------------------
' ADC.BAS
' demonstration of GETADC() function for 8535 or M163 micro
' Getadc() will also work for other AVR chips that have an ADC
converter
'--------------------------------------------------------------------
$regfile = "M32def.dat"
' we use the 8535
'configure single mode and auto prescaler setting
'The single mode must be used with the GETADC() function
'The prescaler divides the internal clock by 2,4,8,15,32,64 or 128
'Because the ADC needs a clock from 50-200 KHz
'The AUTO feature, will select the highest clockrate possible
Config Portb = Output
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 W As Word , Channel As Byte
'now read A/D value from channel 0
Do
W = Getadc(channel)
Portb = Low(w)
Loop
End
'The new M163 has options for the reference voltage
'For this chip you can use the additional param :
'Config Adc = Single , Prescaler = Auto, Reference = Internal
'The reference param may be :
'OFF : AREF, internal reference turned off
'AVCC : AVCC, with external capacitor at AREF pin
'INTERNAL : Internal 2.56 voltage reference with external capacitor ar
AREF pin
'Using the additional param on chip that do not have the internal
reference will have no effect.