What!
You're trying to use a HID program with CDC?
Well, you can start by using endpoint 3.
Wouldn't be surprised if there are more problems though.
<br>
What!
You're trying to use a HID program with CDC?
Well, you can start by using endpoint 3.
Wouldn't be surprised if there are more problems though.
<br>
DT
I wasnt aware that the interrupt system was specifically for HID devices... anyways i'm back to trying to make my code work... it's really annoying.. the device works as expected, until i try and aquire a/d and send a serout2 in my main loop.. then it's device not recognized.. i think my brain might explode soon.
ahh i see what ur saying darrel.. i' used your code which points to endpoint 1.. i'm going to try it changing it to 3
k i think your hint has moved the situation forward.. i'm now getting some output...thanks ... I know I know im a big noob
Are the A/D values all over the place? Or is it the received data at the VB program?
The way it was shown, you'll be sending and receiving a bunch of extra data by transferring the entire buffer, instead of just the data that needs to be used.
HID is packet based, CDC is more like standard serial.
You'll need to consider how many bytes were received, and look for "header" bytes or some other mechanism to sync up the data.
Everything won't just be at byte[x] in the buffer anymore.
<br>
DT
Hi,
I have some mostly working code now using your interrupts thanks to your "hint" about the endpoints earlier...
I was reading another thread that was about "If plugged" - The solution works great monitoring SOFIF and IDLEIF registers - the main loop now does run when the cable is unplugged.
The only case that is still at issue for me is that the device doesnt go passed the "DoUSBinit" subroutine if it's powered on while not connected - which for me is a big deal because the device i'm building is going to be powered up at times with just the LCD i have connected. This LCD is managed by a 16F767 in another device which has some fans too and a light. it's all connected via cat5e cable for one way serial transmission from the 18F4550 via serout2 commands, and i give it 12v and GND each via 3 wires respectively which feed a 7805 and a couple transistors for pulsing the fan speed and light intensity, that all appears to work nicely)
So I guess the last thing to do before I glue everything together (lol) is to get the device to go to the main loop if usb cable is not plugged at initialization time (and have the usb still work after if its eventually plugged in while the device is running).
Anyone else have this "self-powered device" / usbinit kind of issues?
Bookmarks