|
|
View previous topic :: View next topic |
Author |
Message |
lmercor
Joined: 31 May 2007 Posts: 20
|
pic18f4550 usb and windows blue screen |
Posted: Wed Jul 04, 2007 11:30 am |
|
|
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
|
|
Posted: Sun Jul 08, 2007 5:39 am |
|
|
[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
|
|
Posted: Sun Jul 08, 2007 5:40 am |
|
|
ooops- messed up my quotes, sorry. I'll log in next time for editing. |
|
|
Pret
Joined: 18 Jul 2006 Posts: 92 Location: Iasi, Romania
|
|
Posted: Tue Jul 10, 2007 3:33 am |
|
|
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). |
|
|
|
|
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
|