View previous topic :: View next topic |
Author |
Message |
nazoa
Joined: 09 Feb 2007 Posts: 58
|
18F4550 Inputs C4 and C5 |
Posted: Tue Feb 20, 2007 11:56 am |
|
|
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
|
|
Posted: Tue Feb 20, 2007 1:44 pm |
|
|
#byte UCON=0xF6D
#bit USBEN=UCON.3
USBEN=0;
This will turn off the USB hardware
Best Wishes |
|
|
nazoa
Joined: 09 Feb 2007 Posts: 58
|
Thanks! |
Posted: Wed Feb 21, 2007 3:35 pm |
|
|
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
|
|
Posted: Wed Feb 21, 2007 4:52 pm |
|
|
I like questions that can be answered this easily.
Best Wishes |
|
|
|