# VB, USB to Serial, and several problems

Status
Not open for further replies.

#### Los Frijoles

##### Full Member level 1
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.

#### ssajidhb

##### Newbie level 5
use msdn for help

Status
Not open for further replies.