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 CCS Technical Support

pic18f4550 usb and windows blue screen

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



Joined: 31 May 2007
Posts: 20

View user's profile Send private message

pic18f4550 usb and windows blue screen
PostPosted: Wed Jul 04, 2007 11:30 am     Reply with quote

I'm doing a test program to send and receive data over the usb port. I already did the receiver part and it works fine I receive 5 bytes from the pic and I can see it in the PC, but the problem is when i tried to sen data to the pic from the pc, when I send a byte, the pc crash and the blue screen appears. As I said before, no promblem to receive data but I can't send. I have my descriptor for 5 input and output and it has been working fine. I'm using an older pc but it has usb port I'm wondering if could be a problem?
my code is the follow:

Code:
while (TRUE) {


   usb_task();
if (usb_enumerated()) {

 if (usb_kbhit(1)) {
            usb_get_packet(1, in_data, 5);

            if (in_data[0]) {output_high(pin_b0);} else {output_low(pin_b0);}

         }

         send_timer--;
         delay_ms(1);
}


}
   }


some ideas?...
Nora
Guest







PostPosted: Sun Jul 08, 2007 5:39 am     Reply with quote

[quote]I'm doing a test program to send and receive data over the usb port. I already did the receiver part and it works fine I receive 5 bytes from the pic and I can see it in the PC, but the problem is when i tried to sen data to the pic from the pc, when I send a byte, the pc crash and the blue screen appears. As I said before, no promblem to receive data but I can't send. I have my descriptor for 5 input and output and it has been working fine. I'm using an older pc but it has usb port I'm wondering if could be a problem?
my code is the follow:
Quote:


I wonder if your PC is trying to receive at the same time as the PIC is sending or vice versa. I experienced a PC crash when this has happened on one of my projects. You can troubleshoot the send and receive functions one by one by commenting out either send or receive.
Just a thought.

Nora
Nora
Guest







PostPosted: Sun Jul 08, 2007 5:40 am     Reply with quote

ooops- messed up my quotes, sorry. I'll log in next time for editing.
Pret



Joined: 18 Jul 2006
Posts: 92
Location: Iasi, Romania

View user's profile Send private message

PostPosted: Tue Jul 10, 2007 3:33 am     Reply with quote

Sending and receiving at the same time is not a problem. USB controllers manage that, is not your concern.

But which driver are you using? It's your own driver? CCS driver or Microchip?

The crash is caused because of the driver. Blue Screen Of Death is a kernel driver failure. Without any excuse, the driver was not fully tested.

Check if your driver supports selected configuration in PIC (config, interfaces, types of endpoints etc).
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