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

USB low-speed mode with a PIC18F2550 with a 4MHz crystal

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



Joined: 14 Feb 2011
Posts: 2

View user's profile Send private message

USB low-speed mode with a PIC18F2550 with a 4MHz crystal
PostPosted: Mon Feb 14, 2011 11:15 am     Reply with quote

Hello!!

I'm trying to use a pic18f2550 as a low-speed usb device. In the example codes I only found high-speed examples so it didn't helped me. Looking in the datasheet 2.2.1 section seems I have to put FSEN to 0 and FOSC3:FOSC0 to 1 but i didn't find any fuses with a similar name in the 18f2550.h file. Anyone knows what fuses I have to use to set low-speed mode?

Thanks in advance.
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Mon Feb 14, 2011 1:41 pm     Reply with quote

Read the Datasheet's chapter titled "Oscillator" -- that should have what you need.

In cases of special oscillator settings, you'll also want to review the .H file for that PIC as well as the setup_oscillator() command.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Ttelmah



Joined: 11 Mar 2010
Posts: 19496

View user's profile Send private message

PostPosted: Mon Feb 14, 2011 3:47 pm     Reply with quote

XTPLL, PLL1, CPUDIV3

Two things confusing here, you have to select CPUDIV3, to get /4 (this is because the same bit pattern gives /3, when not using the PLL), and no fuse for FSEN.

FSEN, is not a fuse, but a software configured bit. Bit 2 of the UCFG register.
In USB.H, look for the line 'USB_USE_FULL_SPEED TRUE', and change this to 'FALSE'.

Obviously NOXINST, VREGEN, if using the internal regulator etc., are also needed.

Best Wishes
gangi



Joined: 14 Feb 2011
Posts: 2

View user's profile Send private message

PostPosted: Wed Feb 16, 2011 9:13 am     Reply with quote

Thanks Ttelmah!!

I didn't find the line 'USB_USE_FULL_SPEED TRUE' in the usb.h file but i found it in the pic18_usb.h file. Probably because my compiler version(4.088) is different than yours.

Thank you!
Ttelmah



Joined: 11 Mar 2010
Posts: 19496

View user's profile Send private message

PostPosted: Wed Feb 16, 2011 9:38 am     Reply with quote

Yes, they changed the USB includes around V4.100. The newer ones have the define I gave.

Best Wishes
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