Hi Leute,
jetzt hab ich endlich mal wieder Zeit bei meinen Projekten weiterzumachen =D>
Hab jetzt grad mal den Teil mit dem LM317 und dem DigiPoti aufgebaut um ihn mal zu testen. Eigendlich klappt es nicht schlecht, aber nur in der unteren Hälfte, sprich bis ca. 5KOhm danach will es nicht mehr so recht hochzählen, es geht nur noch bis ca. 6,5KOhm und nicht höher obwohl das poti 102 Impulse bekommt. bis zum 52ten Impuls klappt alles wunderbar aber dann sind es keine 101Ohm pro Impuls mehr wie es im datenblatt steht.
Hier noch der Programmcode, ich hoff euch fällt was ein was das Problem seinkönnte:
Code:$regfile = "m32def.dat" 'Die Anweisung bestimmt Controllertyp, hier AVR Mega 32 $crystal = 16000000 Baud = 9600 Config Adc = Single , Prescaler = Auto , Reference = Internal Start Adc Config Portc.0 = Output Config Portc.1 = Output Config Portb.2 = Output Config Portb.3 = Output 'Fet Alias Portb.0 Updown Alias Portc.1 Increment Alias Portc.0 'Strom Alias Portb.3 Dim Soll As Word Dim Ist As Word Dim I As Byte Soll = 0 Ist = 0 Updown = 0 For I = 0 To 100 'Schleife zum Nullen Increment = 1 Waitms 2 Increment = 0 Waitms 2 Next I Do Soll = Getadc(0) Soll = Soll / 10.23 'Um 100 werte zu erhalten Waitms 50 If Ist < Soll Then 'Widerstand erhöhen Updown = 1 Do Increment = 1 Waitms 2 Increment = 0 Waitms 2 Incr Ist Print "Ist=" ; Ist Print "soll=" ; Soll Loop Until Ist = Soll Elseif Soll < Ist Then 'Widerstand verringern Updown = 0 Do Increment = 1 Waitms 2 Increment = 0 Waitms 2 Decr Ist Print "ist=" ; Ist Print "soll=" ; Soll Loop Until Ist = Soll End If Loop







Zitieren

Lesezeichen