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

Enable RC4 and RC5 in 18f2550

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



Joined: 24 Apr 2010
Posts: 10

View user's profile Send private message Visit poster's website

Enable RC4 and RC5 in 18f2550
PostPosted: Sat Apr 24, 2010 11:45 am     Reply with quote

The data sheet says pins RC4 and RC5 are disable when USB module or on-chip transceiver are enabled. How can I enabled them to use as input?

Thanks.
kiewic



Joined: 24 Apr 2010
Posts: 10

View user's profile Send private message Visit poster's website

PostPosted: Sat Apr 24, 2010 1:00 pm     Reply with quote

No idea? It must be the same way with 18f2455, 18f4455, 18f4550.

I'm trying this:

Code:
      if (input(PIN_C4)) { // Get input state
         output_b(255);
      }


But it doesn't get into the if statement.

Do I need to disable the USB characteristic?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Apr 24, 2010 1:42 pm     Reply with quote

See this link:
http://www.ccsinfo.com/forum/viewtopic.php?t=40371
kiewic



Joined: 24 Apr 2010
Posts: 10

View user's profile Send private message Visit poster's website

PostPosted: Sat Apr 24, 2010 4:12 pm     Reply with quote

Excellent! I have enable the input on C4 and C5 ports.

Code:

// disable USB module
#byte UCON = 0xF6D
#bit USBEN = UCON.3

// disable on-chip USB transceiver
#byte UCFG = 0xF6F
#bit USBTRANS = UCFG.3

void main()
{
   // ...

   USBEN = 0;
   USBTRANS = 1;

   while (1) {
      if (!input(PIN_C4)) { // Get input state
         output_c(255);
      }
      else {
         output_c(0);
      }
      delay_ms(100);
   }

}


Thank you PCM programmer.
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