Soo, hier der Code.
Ich hab die fuses nicht verändert.
Der 1Mhz Jumper bezieht sich nur auf die Ansprechgeschwindigkeit...
Ich hab keine Waitrotinen drinnen... also im Bildaufbau.
Code:
$regfile = "m8def.dat"
$crystal = 16000000
Ddrb = &B00000000
Portb = &B11111111
Ddrd.7 = 1
Portd.7 = 0
Ddrb.4 = 0 'Abzug gegen GND
Portb.4 = 1
Ddrb.5 = 0 'Autoabzug gegen GND
Portb.5 = 1
Ddrb.6 = 0 'Magtaster gegen GND
Portb.6 = 1
Ddrb.7 = 0
Portb.7 = 1
Ddrc.3 = 1 'Mosfet
Portc.3 = 0
Config Adc = Single , Prescaler = Auto , Reference = Avcc
Start Adc
Dim Z1 As Word
Dim Z2 As Word
Dim Z3 As Word
Dim Zg As Word
Dim Z1k As Long
Dim Z2k As Long
Dim Z3k As Long
Dim Zgk As Long
Dim Z1kk As Word
Dim Z2kk As Word
Dim Z3kk As Word
Dim Zgkk As Word
Dim Vi1 As Integer 'erster Messwert
Dim Vi2 As Integer 'zweiter Messwert
Dim Vir As Integer 'Differenzwert
Dim Vdif As Integer
Dim T1 As Integer
Dim Modus As Integer
Dim Count As Byte
Dim Mag As Integer
Dim Mun As Integer
Dim Automag As Bit
Automag = 1
Mag = 0
Mun = 0
Vdif = 102
Config Lcd = 16 * 4
Config Lcdpin = Pin , E = Portd.1 , Rs = Portd.0 , Db4 = Portd.4 , Db5 = Portd.5 , Db6 = Portd.6 , Db7 = Portd.7
Config Lcdbus = 8
Initlcd
Cursor Off
Cls
Locate 1 , 1
Lcd "****************"
Locate 2 , 1
Lcd "* A.S.M.F.D *"
Locate 3 , 1
Lcd "* Ver. 1.0 *"
Locate 4 , 1
Lcd "****************"
Wait 1
Der Rest ist nich weiter wichtig...
Lesezeichen