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

18F4550 USB development kit crashes PC

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



Joined: 10 Aug 2006
Posts: 9

View user's profile Send private message

18F4550 USB development kit crashes PC
PostPosted: Fri Sep 01, 2006 5:58 am     Reply with quote

Hi,

Can any one help, I am tryng USB for the first time and have the USB development kit for the PIC18F4550. I have programmed a simple example from the manual (ex7.c) that just checks for enumeration.
Code:

#include <18F4550.h>
#FUSES HSPLL                  //High Speed Crystal/Resonator with PLL enabled
#FUSES NOWDT                    //Watch Dog Timer
#FUSES NOPROTECT              //Code not protected from reading
#FUSES NOLVP                  //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NODEBUG                //No Debug mode for ICD
#fuses USBDIV                 //clock frequency configuration for USB
#fuses PLL5
#fuses CPUDIV1
#fuses VREGEN                 //USB voltage regulator enabled

# use delay(clock=48000000)

#ignore_warnings NONE           // report all warnings

#define LED1 PIN_A5
#define LED2 PIN_B4
#define LED3 PIN_B5

#define BUTTON PIN_A4
#define LED_ON output_low
#define LED_OFF output_high

#define USB_EPI_TX_ENABLE USB_ENABLE_INTERRUPT
#define USB_EP1_TX_SIZE 8

#define USB_EPI_RX_ENABLE USB_ENABLE_INTERRUPT
#define USB_EP1_RX_SIZE 8



# include <pic18_usb.h>        // Microchip 18Fxx5x hardware layer for usb.c
# include <usb_desc_hid.h>     // USB Configuration and Device descriptors for this UBS device
# include <usb.c>              // handles usb setup tokens and get descriptor reports

void main()
{
   LED_ON(LED1);
   LED_OFF(LED2);
   LED_OFF(LED3);


   usb_init();

   while(TRUE)
   {
      if (usb_enumerated())
         LED_ON(LED3);
      else
         LED_OFF(LED3);
   }
}
      


When I plug the USB device into the PC I get someting like:

New Hardware detected
Human Interface Device

Then the PC creashes with a restart. On restart the PC reports a catastrophic failure had occured and when I report to MS it comes back with the reason being "unknown driver". Same on two other PC's

OS: WINXP PRO

The LED3 lights so the crash comes after enumeration.

Thanks for any help
Darren Rook



Joined: 06 Sep 2003
Posts: 287
Location: Milwaukee, WI

View user's profile Send private message Send e-mail

PostPosted: Sat Sep 02, 2006 8:43 am     Reply with quote

Does example 8 crash the PC?
_________________
I came, I saw, I compiled.
robert



Joined: 10 Aug 2006
Posts: 9

View user's profile Send private message

PostPosted: Mon Sep 04, 2006 3:02 am     Reply with quote

Thanks Darren,

I have just picked this up from someone thats left (the only expert we had in the company). I have found a test program he had made and it does not crash the pc. It looks that it is based on example 8 so it would seem that ex7 is a duff'n. Thats a pity as it doesnt give confidence to someone who does'nt really know what they are doing.
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