Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

VB, USB to Serial, and several problems

Status
Not open for further replies.

Los Frijoles

Full Member level 1
Joined
Oct 5, 2006
Messages
98
Helped
9
Reputation
18
Reaction score
5
Trophy points
1,288
Location
Provo, Utah, United States
Activity points
2,252
I am using Visual Basic to construct a GUI for my Cypress WUSB chip interface (this interface allows for direct control of the chip from a computer). It uses a PIC to construct the Serial->WUSB hardware. I have designed a five byte protocol for it and have programmed it (what looks like) successfully. The only problem is that for some reason, the PIC is not correctly receiving characters from the program. Right now I have it programmed to echo back characters onto the serial line as a debug interface.

Here is the byte I am sending out:
Code:
...
Me.SendPack(0) = Chr(254)
...
Here is the code that sends the byte:
Code:
Me.SerialPort.Write(Me.SendPack(0)) 'send off first byte
And here is what the PIC is returning:
Code:
63
When I did this with the number 22 inside the Chr(), it worked fine and returned the proper value. What is going on here? Is there some quirk in the Chr function that I should know about?

Also, I am using a USB->Serial converter, but it has not yet given me problems, so I doubt that this is the root of the problem. Also, the computer has no problems receiving the number 254 when I had the PIC echo only 254 back.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top