so hab mal der function ne übergabevariable a reingemacht und da gehts
obwohl ich diese überhaupt nicht benutze

Woran liegt das ???????????????
müssen Funktionen immer Übergabe variablen enthalten

$regfile = "m32def.dat"
$crystal = 8000000
$baud = 19200
$hwstack = 32
$swstack = 10
$framesize = 40


Dim Spannung As Byte
Declare Function Readdat(byval A As Byte) As Byte

Spannung = Readdat(1)
print spannung
end

Function Readdat(byval A As Byte) As Byte
Local Tinydat As Byte
Shiftin Portd.2 , Portd.3 , Tinydat , 5
Readdat = Tinydat
End Function