Hallo,
hätte mal eine Frage zum dem RS 485 Bus. Habe folgenden Code mit einem Master und einem Slave der auch Funktioniert:
Master:
Code:'------------------------------------------------------------------------------ 'name : .bas 'copyright : (c) 1995-2005, MCS Electronics 'purpose : demonstrates 'micro : Mega48 'suited for demo : yes 'commercial addon needed : no '------------------------------------------------------------------------------ $regfile = "m16def.dat" $crystal = 8000000 $baud = 19200 Config Portd.2 = Output Portd.2 = 0 Dim Slave(2) As String * 8 'Slaveadressen Slave(1) = "Modul 1" Slave(2) = "Modul 2" ' - - - - - - - Send: Do Waitms 100 Portd.2 = 1 Waitms 100 Print Slave(1) Waitms 100 Portd.2 = 0 Loop Goto Send
Slave:
An dem Slave habe ich eine LCD Angeschlossen und wenn der Slave z.B. Modul 1 empfängt sind immer kryptische Zeichen dabei.Code:'------------------------------------------------------------------------------ 'name : .bas 'copyright : (c) 1995-2005, MCS Electronics 'purpose : demonstrates 'micro : Mega48 'suited for demo : yes 'commercial addon needed : no '------------------------------------------------------------------------------ $regfile = "m16def.dat" $crystal = 8000000 $baud = 19200 Config Portd = Output Portd.2 = 0 Portd.7 = 0 Dim Rs485input As Byte Dim A As Byte Dim Temp As String * 8 ' - - - Lcd - - - Config Lcd = 16 * 2 Config Lcdpin = Pin , Db4 = Porta.0 , Db5 = Porta.1 , Db6 = Porta.2 , Db7 = Porta.3 , E = Porta.5 , Rs = Porta.4 Config Lcdbus = 4 Config Lcdmode = Port On Urxc Onrxd Enable Urxc Enable Interrupts Do nop Loop Onrxd: Inputbin Temp Cls Lcd Temp Return
Was könnte das sein. Habe mir schon etliche Dinge durchgelesen aber finde den Fehler nicht.
Bin noch ein Neuling mit Bascom![]()
Bedanke mich im Voraus für eine Antwort







Zitieren


Lesezeichen