achso.
ich poste mal mein blöbes Programm, was ich bis jetzt habe. vielleicht hilft das ein wenig. und noch was... das sind jetzt 13 bit


Code:
$regfile = "m32def.dat"
$crystal = 1000000



Dim Pac As Word     
Dim Lobyte As Word
Dim Hibyte As Word
Dim Endlobyte As Word
Dim Endhighbyte As Word

Do
Endlobyte = Pina               'PortA  Untere 8 bit (ausgang)
Endhighbyte = Pinc            'portC obere 5 bit   (ausgang)
Endhighbyte = Endhighbyte And &B0000000000000111    'Endhighbyte ist also der Ausgang?


Lobyte = Pinb                  'Port B untere 8 bit (eingang)
Hibyte = Pind                   'portD obere 5 bit (eingang)
Hibyte = Hibyte And &B0000000000000111            ' zusammensetzen      

Rotate Hibyte , Left , 8                               '8 bits nach links

Pac = Lobyte + Hibyte                              ' zusammenzählen

Pac = Gray2bin(pac)                                 'in bin umwandeln

Endhighbyte = Pac                                an Endhighbyte die BIN ausgeben


Wait 1
Loop


ich weiss, da steht fast alles mist, aber ich mache, wie ich kann. in der Hoffnung, dass mit jemand hilft.