Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/04/02 13:57
Read: times


 
#26702 - NEED HELP IN SERIAL COM
I have previously asked about serial communicaton with Ucontroller using VB6.

Now I have developed a simple serial communication application in which data from microcontroller is continuously transferred at the baud rate of 110.

The program is:
org 0
mov tmod,#20h
mov th1,#152 ;generates standard baud rate 110 (0 % error)
mov tl1,#152 ;with crystal oscillator 4.43MHz
setb tcon.6
mov scon,#50h ;8 bits mode
loop:
mov a,#40
mov sbuf,a
halt:jnb ti,halt
clr ti
ajmp loop
end

Similarly in the VB I have written a program that displays the data which is received from RS232 port. The program is:

Dim data() as Byte
MSComm1.InputMode=comInputMode Text
MSComm1.CommPort=1
MSComm1.Settings="110,N,8,1"
MSComm1.PortOpen=True
MSComm1.InBufferCount=0
DO
DO Events
If MSComm1.InBufferCount Then
data=MSComm1.Input
Text1.Text=data
Exit DO
End If
Loop

MSComm1.PortOpen=False


PROBLEM:
The Textbox shows random data like B , |, %, (, %%. My questions are:

a)What is the wrong with the code or frame synchronization ?

b)What should be done if I want to display 40 (same data as sent by Ucontroller) in the TextBox ?

c)Why the TextBox displays nothing when MSComm1.InputMode=comInputMode Binary ?

d)Can it be possible for a Ucontoller to recieve data while doing other job, (e.g. controlling motor speed and recieving data at the same time) ?

e)Are there altogether 10 bits (including Start and Stop bit) in a frame while using 8 bits mode ?

f)Full duplex is not possible as there is only one SBUF.I guess.

Please help me in any or all of the problems.




List of 10 messages in thread
TopicAuthorDate
NEED HELP IN SERIAL COM            01/01/70 00:00      
RE: NEED HELP IN SERIAL COM            01/01/70 00:00      
RE: NEED HELP IN SERIAL COM            01/01/70 00:00      
RE: NEED HELP IN SERIAL COM            01/01/70 00:00      
RE: NEED HELP IN SERIAL COM            01/01/70 00:00      
RE: NEED HELP IN SERIAL COM            01/01/70 00:00      
RE: NEED HELP IN SERIAL COM            01/01/70 00:00      
RE: NEED HELP IN SERIAL COM            01/01/70 00:00      
RE: NEED HELP IN SERIAL COM            01/01/70 00:00      
RE: Baud rate tolerance            01/01/70 00:00      

Back to Subject List