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

Disable USB control and configuration in PIC18f4550

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



Joined: 06 Oct 2009
Posts: 1

View user's profile Send private message

Disable USB control and configuration in PIC18f4550
PostPosted: Tue Oct 06, 2009 2:29 pm     Reply with quote

I need to use ports C5 and C6 in the PIC18f4550. However, the datasheet says:

"To use pins RC4 and RC5 as digital inputs, the USB module must be disabled (UCON<3> = 0) and the on-chip USB transceiver must be disabled (UCFG<3> = 1)."

How do I turn off these functions using the C compiler?
PCM programmer



Joined: 06 Sep 2003
Posts: 21477

View user's profile Send private message

PostPosted: Tue Oct 06, 2009 6:22 pm     Reply with quote

Look at this diagram in the USB section of the 18F4550 data sheet:
Quote:

REGISTER 17-1: UCON: USB CONTROL REGISTER

It shows that the USBEN bit controls the USB module:
Quote:

USBEN: USB Module Enable bit
1 = USB module and supporting circuitry enabled (device attached)
0 = USB module and supporting circuitry disabled (device detached)

It shows that the power-on reset state of USBEN is 0, which disables
the USB module. The CCS start-up code in doesn't write to the UCON
register, so it's already disabled and you don't have to do anything.

If you do want to disable the USB module in code, then use a #byte
and #bit statement to create a USBEN_BIT variable. Get the UCON
register address and the USBEN bit number from the 18F4550 data
sheet. Then just set USBEN_BIT to 0 in your code.
erkantr67



Joined: 04 Aug 2012
Posts: 1

View user's profile Send private message

PostPosted: Sat Aug 04, 2012 5:48 pm     Reply with quote

Hi,

There was a circuit C programmer should use CCS 18F4550. But that is usb d + d-d + d-rc4 rc5 is on the edges is normal rc4 rc5, I / O, I can not use. How do I close the ends of the d-and d + Would Help?

More information in English for I'm not Turkish. So I wrote them to you using the google translation by you may seem a little pointless.

Thank you in advance for your answers.

If you send an email to xxxxxxxxxxxxx Is How I'll be satisfied.


Thank you again.
PCM programmer



Joined: 06 Sep 2003
Posts: 21477

View user's profile Send private message

PostPosted: Sat Aug 04, 2012 6:53 pm     Reply with quote

Pins RC4 and RC5 can only be digital inputs. You can't make them into
digital outputs. The 18F4550 is designed for them to be digital inputs
only (if you disable the USB function).

If you need RC4 and RC5 to be digital outputs, then you must use a
different PIC. You could use the 18F4520.
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