CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

USB repeated transmission

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
bandi13



Joined: 12 Mar 2006
Posts: 1

View user's profile Send private message

USB repeated transmission
PostPosted: Sun Mar 12, 2006 12:13 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group