Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

serial communication send/receive

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Various
View previous topic :: View next topic  
Author Message
pipi

Bascom Member



Joined: 09 Nov 2009
Posts: 2

blank.gif
PostPosted: Mon Nov 09, 2009 5:14 pm    Post subject: serial communication send/receive Reply with quote

Hello all, can anybody help me to build some code?i want to make a serial communication between pc and avr. I use hyperterminal to communicate with avr. here is my code:

$regfile = "m32def.dat"
$crystal = 11059200
$baud = 9600


Dim Rx_char As String * 5

Do

If Ischarwaiting() = 1 Then
Rx_char = Inkey()

Printbin Rx_char

If Rx_char = "1" Then
Print Chr(13)
Print "OK"
End If


End If

Loop

when i typing "address 01" in hyperterminal the response is "OK". I use 1 (one) to indicate the receive character, the hyperterminal show like this:

address 01
OK

I want to make code that working like this: if i typing address 01 and then press enter on my keyboard then the response is "OK". How to do that?and there is any way to indicate the receive on full character? like "address 01" not only the last character such as 1 (last character on address 01).


thank u
Back to top
View user's profile
pipi

Bascom Member



Joined: 09 Nov 2009
Posts: 2

blank.gif
PostPosted: Tue Nov 10, 2009 6:59 am    Post subject: Reply with quote

Solved.... Very Happy
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Various All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum