How to receive data from atmega8535 with VB6?
How to receive data from atmega8535 with VB6?
How to receive data from atmega8535 with VB6?
How to receive data from atmega8535 with VB6?
How to receive data from atmega8535 with VB6?
How to receive data from atmega8535 with VB6? How to receive data from atmega8535 with VB6? How to receive data from atmega8535 with VB6? How to receive data from atmega8535 with VB6? How to receive data from atmega8535 with VB6? How to receive data from atmega8535 with VB6? How to receive data from atmega8535 with VB6? How to receive data from atmega8535 with VB6?
How to receive data from atmega8535 with VB6? How to receive data from atmega8535 with VB6?
How to receive data from atmega8535 with VB6?
Go Back  Xtreme Visual Basic Talk > > > How to receive data from atmega8535 with VB6?


Reply
 
Thread Tools Display Modes
  #1  
Old 06-16-2010, 06:51 AM
abyan abyan is offline
Newcomer
 
Join Date: Jun 2010
Posts: 2
Unhappy How to receive data from atmega8535 with VB6?


HI I'm new in VB..
actually i want to ask you how to receive data from atmega8535 with VB 6...
this is the description of my problem:
the input data is come from push button and then the VB receive it and make a color of the shape in VB that is already made become red.

this is the listing program in VB:
Private Sub Form_Load()
MSComm1.RThreshold = 1
MSComm1.InputLen = 1
MSComm1.Settings = "9600,N,8,1"
MSComm1.DTREnable = False
MSComm1.CommPort = 3
'MSComm1.InputMode = comInputModeBinary
MSComm1.PortOpen = True
End Sub

Private Sub Form_Unload(Cancel As Integer)
MSComm1.PortOpen = False
End Sub

Private Sub MSComm1_OnComm()
Dim Data As String
If MSComm1.CommEvent = comEvReceive Then
Data = MSComm1.Input
end if

If Data = "1" Then
Shape4.BackStyle = 1 - Opaque
Shape4.BackColor = &HFF&
Else
If Data = "2" Then
Shape3.BackStyle = 1 - Opaque
Shape3.BackColor = &HFF&
Else
If Data = "4" Then
Shape2.BackStyle = 1 - Opaque
Shape2.BackColor = &HFF&
Else
If Data = "8" Then
Shape1.BackStyle = 1 - Opaque
Shape1.BackColor = &HFF&
End If
End If
End If
End If
End Sub



But it doesn't work!
Please anybody help me...... thanks be4
Reply With Quote
  #2  
Old 06-16-2010, 08:39 AM
mkaras's Avatar
mkarasHow to receive data from atmega8535 with VB6? mkaras is offline
Ultimate Contributor

Retired Leader
* Expert *
 
Join Date: Mar 2004
Location: Beaverton, OR
Posts: 1,874
Default

Have you independantly verified the operation of the ATMega device and its ability to successfully communicate to your PC or laptop?

If you have not done this then it may be well to use some ready made serial port monitor software such as TeraTerm to see if the device is actually sending the text characters "1", "2", "4" or "8" when switches connected to the microcontroller are being activated. Unless you verify one side of the connectivity you will never know if it is the MCU device or your VB6 software that is not working properly.

You should also check in the VB6 debugger to see if you get any thing in at all from the serial port. I.E. set breakpoint after value gets set to the Data variable and see just what came into this variable. It may be that what comes into this variable is not the individual characters 1, 2, 4 and 8 as you have written your code to detect. Maybe just maybe the byte that arrives has a value such that the low four bits of the value represent the states of the four switches at the MCU. If so you may need to deal with the Data variable as a Byte value and detect switch 1 as " If (Data And 1) <> 0", switch 2 as "If (Data And 2), switch 3 as "If (Data & 4) <> 0" and so forth.

Michael Karas
Reply With Quote
  #3  
Old 06-17-2010, 05:30 AM
abyan abyan is offline
Newcomer
 
Join Date: Jun 2010
Posts: 2
Default

yes, I already confirmed it does really work and can communicate with PC..
because when I send the data from PC to this ATmega with similar program and just change it a little with MSComm1.output , it could work..
but when I try to receive data from ATmega to PC, it couldn't work.

And after all things that I have tried, I guest it doesn't work because of the operating system in my PC(I used win.7). Because when I try this program in win.XP, IT WORKS!

any idea about it?? is VB6 not too compatible with win.7???
thanks..
Reply With Quote
  #4  
Old 08-05-2010, 05:37 AM
akatsuki akatsuki is offline
Newcomer
 
Join Date: Apr 2008
Posts: 3
Default hi

maybe due to some win7 restrictions. try to compile to exe, then runas admin.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
How to receive data from atmega8535 with VB6?
How to receive data from atmega8535 with VB6?
How to receive data from atmega8535 with VB6? How to receive data from atmega8535 with VB6?
How to receive data from atmega8535 with VB6?
How to receive data from atmega8535 with VB6?
How to receive data from atmega8535 with VB6? How to receive data from atmega8535 with VB6? How to receive data from atmega8535 with VB6? How to receive data from atmega8535 with VB6? How to receive data from atmega8535 with VB6? How to receive data from atmega8535 with VB6? How to receive data from atmega8535 with VB6?
How to receive data from atmega8535 with VB6?
How to receive data from atmega8535 with VB6?
 
How to receive data from atmega8535 with VB6?
How to receive data from atmega8535 with VB6?
 
-->