![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
doguhanpala
Joined: 05 Oct 2016 Posts: 120
|
USB Device not recognized |
Posted: Thu May 04, 2017 3:23 am |
|
|
Hello
I have a pcb board (the pic is 18f4550 tqfp) and i am doing some tests o it. I want to check usb connection on my board. I uploaded this code to my pic. I hear the usb connection sound on windows but it gives the warning, usb device not recognized. I want to learn, whether the problem is on hardware or on my code. Any ideas?
Thank you so much!
Code: |
#if !defined(__PCH__)
#error USB CDC Library requires PIC18
#endif
#include <18F4550.h>
#fuses HSPLL,NOWDT, PUT, NOLVP,NOMCLR,NOPROTECT,NOLVP,NODEBUG,NOBROWNOUT,USBDIV,PLL5,CPUDIV1,VREGEN,ICSP2 //ICPRT enabled
#device ADC=10
#use delay(clock=48000000)
#include<usb.h>
#include<usb_cdc.h>
#include <pic18_usb.h>
#define rp_getc usb_cdc_getc
#define rp_putc usb_cdc_putc
void main()
{
usb_cdc_init();
usb_init();
usb_task();
} |
Best wishes
Doguhan |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19383
|
|
Posted: Thu May 04, 2017 3:59 am |
|
|
The code you have dies...
Drops off the end, so isn't running.
When Windows tries to enumerate the device, there is no code there to answer... |
|
![](templates/subSilver/images/spacer.gif) |
doguhanpala
Joined: 05 Oct 2016 Posts: 120
|
|
Posted: Thu May 04, 2017 5:35 am |
|
|
Ttelmah wrote: | The code you have dies...
Drops off the end, so isn't running.
When Windows tries to enumerate the device, there is no code there to answer... |
sorry for the newbie mistake... i will add a while(true). thank you so much Ttelmah! |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|