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

18F4550 Inputs C4 and C5

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



Joined: 09 Feb 2007
Posts: 56

View user's profile Send private message

18F4550 Inputs C4 and C5
PostPosted: Tue Feb 20, 2007 11:56 am     Reply with quote

Hello,

I am using the 18F4550 and I need to use pins C4 and C5 as ordinary logic inputs. I do not need the USB. My problem is that I am getting very erratic behaviour from the PIC. It seems unable to recognise when the pins go high.

I am not sure how I should disable the internal USB so that pins C4 and C5 are freed but I have the following line;

#fuses HSPLL,NOPROTECT,NOLVP,NODEBUG,NOUSBDIV,PLL5,CPUDIV1,VREGEN

Any suggestions where my problem could be? How is the internal USB disbled?

Thanks!
Ttelmah
Guest







PostPosted: Tue Feb 20, 2007 1:44 pm     Reply with quote

#byte UCON=0xF6D
#bit USBEN=UCON.3

USBEN=0;

This will turn off the USB hardware

Best Wishes
nazoa



Joined: 09 Feb 2007
Posts: 56

View user's profile Send private message

Thanks!
PostPosted: Wed Feb 21, 2007 3:35 pm     Reply with quote

Ttelmah, thanks for your help. It now works fine. Also, it has helped in understanding how the various registers can be programmed. Much appreciated!
Ttelmah
Guest







PostPosted: Wed Feb 21, 2007 4:52 pm     Reply with quote

I like questions that can be answered this easily. Smile

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