Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20563

BASCOM-AVR : RS232 between 2 AVR's : REPLY

$
0
0
Last night I picked it up again and I managed to fix it! :) The transmitter is not changed (it sends a string with the value from 1 to 25). For the receiver I changed the code into this: [code:1:ad223b74cc] $regfile = "m168def.dat" $crystal = 2000000 '16000000 $baud = 1200 Declare Sub Sup Dim Receivedvalue As String * 30 'value to receive Dim Newreceived As Single Config Portc.5 = Output '*********** some stuff that a reset just occured *************** 'Set Portc.5 'Waitms 200 'Toggle Portc.5 'Waitms 200 'Toggle Portc.5 'Waitms 200 'Toggle Portc.5 'Waitms 200 'Cls 'Locate 1 , 1 : Lcd "startscreen" 'Wait 1 'Cls 'Cursor Off Dim X As Integer Dim Test As String * 15 Cursor Off Cls '****************************************************************** Config Input = Cr , Echo = Cr Do If Ischarwaiting() <> 0 Then Sup End If Loop Sub Sup Set Portc.5 Input Receivedvalue 'receive the value Locate 2 , 1 : Lcd Len(receivedvalue) If Len(receivedvalue) = 2 Then Receivedvalue = Right(receivedvalue , 1) End If If Len(receivedvalue) = 3 Then Receivedvalue = Right(receivedvalue , 2) End If Reset Portc.5 Receivedvalue = Left(receivedvalue , 0) Locate 1 , 1 : Lcd Receivedvalue ; " " 'display the value End Sub End [/code:1:ad223b74cc] I can nou determine the string that was sent. This was just a simple test setup. Eventually there will be sent more then a 2 character string. I hope someone can who has the same problem can use this topic. And again: Thanks for the help!

Viewing all articles
Browse latest Browse all 20563

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>