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:
Here is the code that sends the byte:
And here is what the PIC is returning:
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.
Here is the byte I am sending out:
Code:
...
Me.SendPack(0) = Chr(254)
...
Code:
Me.SerialPort.Write(Me.SendPack(0)) 'send off first byte
Code:
63
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.