bandi13
Joined: 12 Mar 2006 Posts: 1
|
USB repeated transmission |
Posted: Sun Mar 12, 2006 12:13 pm |
|
|
Hi!
I was hoping someone could help me solve this riddle. I am using a PIC18F2455. I have the HID descriptor working, I am even able to communicate with it through the PC. What my problem is if the PIC is enumerated, and there is no communication for 10-20 seconds, the last transmission gets resent. It also occurs when I reset the pic. Before reset, it keeps sending packets, after reset it continues to send them.
I have ensured that I call the usb_put_packet() only once. My code is basically this:
void main() {
usb_init_cs();
while(TRUE) {
usb_task();
while(usb_enumerated()) {
if(usb_kbhit(1)) {
usb_get_packet(1, in_data, USB_EP1_RX_SIZE);
usb_put_packet(1, out_data, REPORT_SIZE, USB_DTS_TOGGLE);
}
}
}
Does any one have any hints as to where to look for the problem? The PC side only sends packets when the user clicks on a button, so I don't think it's the PC's fault.
Thanks in advance,
-Andras |
|