|
|
View previous topic :: View next topic |
Author |
Message |
gfbankston
Joined: 21 Jul 2014 Posts: 35
|
PC reports usb malfunction |
Posted: Fri Aug 29, 2014 11:12 am |
|
|
Hello,
Installed usb using the project wizard, full speed on an 45K50.
called usb_init_cs() before main, and calling usb_task() in the main loop.
Question: there is a NOTE about defining USB_CON_SENSE_PIN in my application. I am not sure what this is all about...is it another input pin I tie to the VUSB from the usb port?
Do I have to have it?
PC reports device malfunction when I plug in the cable , but does not elaborate...
TIA
Glen K4KV |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Aug 29, 2014 4:07 pm |
|
|
This is the connection sense diagram that used to be in
ex_usb_bootloader.c in vs. 4.xxx, but CCS took it out in vs. 5.xxx
Code: |
/////////////////////////////////////////////////////////////////////////////
//
// If you are using a USB connection sense pin, define it here. If you are
// not using connection sense, comment out this line. Without connection
// sense you will not know if the device gets disconnected.
// (connection sense should look like this:
// 100k
// VBUS-----+----/\/\/\/\/\----- (I/O PIN ON PIC)
// |
// +----/\/\/\/\/\-----GND
// 100k
// (where VBUS is pin1 of the USB connector)
//
/////////////////////////////////////////////////////////////////////////////
///only ccs's 18F4550 development kit has this pin
#if __USB_PIC_PERIF__ && defined(__PCH__)
#define USB_CON_SENSE_PIN PIN_B2
#endif |
When you are trouble-shooting the USB connection between the 18F4550
and your PC, you can call usb_debug_task() in your while() loop.
It will display debug messages through the MAX232 connection (not USB)
to a terminal window (TeraTerm) on your PC. It will tell you if the PIC
is connected and enumerated, or not.
These CCS example files show how to use usb_debug_task():
Quote: | c:\program files\picc\examples\ex_usb_hid_and_cdc.c
c:\program files\picc\examples\ex_usb_serial2.c
|
And several other CCS example files show the same thing. |
|
|
|
|
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
|