maniac84
Full Member level 6
- Joined
- Mar 4, 2012
- Messages
- 337
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,298
- Activity points
- 3,661
hi guys,
Currently using PIC18F25K50 and will use its USB-HID communication to communicate with PC.
But it the USB will always hang after a while. I know this because when my PC send data to it, it does not respond. Below is the part of my main loop coding:
Anything wrong here?
Is there a possibility that the USB communication has disconnected while the PC is sending data, and causing it to hang?
Currently using PIC18F25K50 and will use its USB-HID communication to communicate with PC.
But it the USB will always hang after a while. I know this because when my PC send data to it, it does not respond. Below is the part of my main loop coding:
Code:
while(1){
if((USBGetDeviceState() < CONFIGURED_STATE) ||
(USBIsDeviceSuspended() == TRUE))
{
continue;
}
if(!HIDRxHandleBusy(USBOutHandle)) //Check if data was received from the host.
{
ToSendDataBuffer[0] = ReceivedDataBuffer[0];
USBOutHandle = HIDRxPacket(HID_EP,(BYTE*)&ReceivedDataBuffer,64);
}
}
Anything wrong here?
Is there a possibility that the USB communication has disconnected while the PC is sending data, and causing it to hang?