probier mal das:
Code:
$regfile = "m128def.dat"                                    'ATMega128 definieren
$crystal = 6000000                                          'Taktfrequenz auf 6 MHz setzen
$baud = 19200
$baud1 = 19200                                              'Baudrate für Diagnose
$hwstack = 256                                              ' default use 32 for the hardware stack
$swstack = 256                                              ' default use 10 for the SW stack
$framesize = 256



Busrxtx Alias Portd.4
Config Print1 = Busrxtx , Mode = Set
Config Busrxtx = Output                                     'set the direction yourself

Config Porta.1 = Output
Led Alias Porta.1

Dim Slave1_in As Integer
Dim Slave2_in As Integer
Dim Sendepuffer As Byte
Dim Zaehler As Integer
Dim Zeichen As Byte
Dim Zeichen_in As Byte
Dim Zeichenzaehler As Integer

Config Com2 = 19200 , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 1
'Config Serialout1 = Buffered , Size = 1
'Enable Interrupts
'Config Serialin1 = Buffered , Size = 20
Open "COM1:" For Binary As #2
Open "com2:" For Binary As #1

On Utxc1 Puffer_leer
Enable Utxc1
Enable Interrupts

Set Led
Waitms 1000
Reset Led
Waitms 1000


For Zaehler = 1 To 1000
   Printbin #1 , 100;
   'Waitms 2                                                 '********** UM DIESE ZEILE GEHTS******************
Next
End


'****************************
' SendepufferInterrupt
Puffer_leer:
  'Sendepuffer = 0
Return
'*********
PS: auch gern gemachter Fehler ist die fehlende Terminierung