18F2550 USB on VB Express 2008

Status
Not open for further replies.

serkanc

New Member
Hi. I tried to control step motor over usb. I write program on VB Express 2008, for microchip on PBP 2.46.. I have a problem with sending data. If I send a byte which has value over 127, pic takes it always as 63 ( Ascii code of question mark ). I'm using CDC interface, endpoint 3. Is there any solution
 
For Each sp As String In My.Computer.Ports.SerialPortNames
ComboBox1.Items.Add(sp)
Next
SerialPort1.Encoding = System.Text.Encoding.GetEncoding(28591)

SerialPort1.PortName = ComboBox1.SelectedItem
SerialPort1.Open()


SerialPort1.Write("M" & ChrW(Duty)




Thanks. It works. i have added this line to VB:
SerialPort1.Encoding = System.Text.Encoding.Default
 
Last edited:
I have also one more problem to solve..
I tried to run a fan with pwm with ULN2003. Need I connect the PIC Ground to the ULN2003 or Fan Supply Ground is enough?

How can I read Fan Rpm on the third cable of Fan ? Is there any example.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…