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 support@ccsinfo.com

USB CDC with 24f

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



Joined: 19 Dec 2014
Posts: 7

View user's profile Send private message

USB CDC with 24f
PostPosted: Thu Jan 08, 2015 10:52 pm     Reply with quote

Hi,

Trying to implement USB CDC with 24FJ128GB206, compiler 5.015

Having 20Mhz crystal set the fuses :

Code:
#fuses NOWINDIS,NOWDT,ICSP3,NOWRT,NOPROTECT,NOJTAG
#fuses NOIESO,NOWPFP,NOWPDIS,NOWPCFG,NOPR,NOIOL1WAY,NOOSCIO,NOCKSNOFSM

#use delay(clock=32M,USB_FULL)
#fuses HS, PR_PLL, PLL5,PLL96MHZ



But nothing happens in the device manager, on the PC !?
Suspected with the HS fuse but best choice is that i think ?

Dont think any problem with the hardware, used the same circuit to connect USB HID but with XC16 compiler, without any problem.


Any guidance will be my light Shocked Very Happy
Ttelmah



Joined: 11 Mar 2010
Posts: 19447

View user's profile Send private message

PostPosted: Fri Jan 09, 2015 2:16 am     Reply with quote

Your fuses should complete _before_ your delay statement. As it stands, the compiler may have chosen a different pattern to give the oscillator you want, and you then override this....

Do a search here. There was a thread perhaps two months ago, with the poster having problems getting USB to work on one of the PIC24 'OTG' chips.

It's here:
<http://www.ccsinfo.com/forum/viewtopic.php?t=52758&highlight=usb+otg>

I'm not sure if he ever resolved this?.
cagabit



Joined: 19 Dec 2014
Posts: 7

View user's profile Send private message

PostPosted: Fri Jan 09, 2015 4:34 am     Reply with quote

Your answer is great Ttelmah, thank you.

For future reference:

First, I missed the init sub of USB i think, I was trying to init with the code,

Code:
usb_cdc_init();


which was the only acceptable solution for me when trying CDC with the PIC18F2550. But from the post you linked it should be,

Code:
usb_init_cs();


And IT IS OK NOW ! Windows shows the COMx port without problem.

Also before this corrected the order or the FUSES and the DELAY line like,

Code:
#fuses NOWINDIS,NOWDT,ICSP3,NOWRT,NOPROTECT,NOJTAG
#fuses NOIESO,NOWPFP,NOWPDIS,NOWPCFG,NOPR,NOIOL1WAY,NOOSCIO,NOCKSNOFSM
#FUSES CKSFSM   
#fuses HS, PR_PLL, PLL5,PLL96MHZ
#use delay(clock=32M,USB_FULL)
Ttelmah



Joined: 11 Mar 2010
Posts: 19447

View user's profile Send private message

PostPosted: Fri Jan 09, 2015 10:17 am     Reply with quote

Good.
Shows the power of some of the records here on the forum. Smile

Have fun.
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