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

How to configure SFRs?

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



Joined: 16 Apr 2012
Posts: 8

View user's profile Send private message

How to configure SFRs?
PostPosted: Wed Jun 13, 2012 9:10 am     Reply with quote

Hi people!

I need to use RC4 and RC5 as digital I/O on my board, but I can't disable USB transceiver, cause I can't change the necessary bits on the SFR bank using C language. Even with assembly by directive #asm and #endasm, I try change by this way:
Code:

#asm
 bcf 0xF6D,3 // UCON<3>
 bsf 0xF6F,3  // UCFG<3>
#endasm

But, fail! The pin_C4 and pin_C5 it isn't working like digital I/O.
What can I do?

Bye!
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Wed Jun 13, 2012 9:38 am     Reply with quote

It would be nice if you told us which PIC...
_________________
Google and Forum Search are some of your best tools!!!!
Darkforces



Joined: 16 Apr 2012
Posts: 8

View user's profile Send private message

PostPosted: Wed Jun 13, 2012 9:42 am     Reply with quote

I'm using PIC18F4550
Thanks!
Ttelmah



Joined: 11 Mar 2010
Posts: 19545

View user's profile Send private message

PostPosted: Wed Jun 13, 2012 9:44 am     Reply with quote

Precisely.
On most of the USB PIC's, the pins can only be used as digital _inputs_. A few of the more sophisticated chips do allow them to be used as outputs, but I can't think of any with the USB on C4, and C5, where this applies.
If you don't enable USB, the driver is off by default. You can read from the pins on a 18F4550 for example, fine.

Best Wishes
Darkforces



Joined: 16 Apr 2012
Posts: 8

View user's profile Send private message

PostPosted: Wed Jun 13, 2012 10:04 am     Reply with quote

Ok! It's true only input :( !!!

Thanks!
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