View previous topic :: View next topic |
Author |
Message |
Darkforces
Joined: 16 Apr 2012 Posts: 8
|
How to configure SFRs? |
Posted: Wed Jun 13, 2012 9:10 am |
|
|
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! |
|
![](templates/subSilver/images/spacer.gif) |
dyeatman
Joined: 06 Sep 2003 Posts: 1924 Location: Norman, OK
|
|
Posted: Wed Jun 13, 2012 9:38 am |
|
|
It would be nice if you told us which PIC... _________________ Google and Forum Search are some of your best tools!!!! |
|
![](templates/subSilver/images/spacer.gif) |
Darkforces
Joined: 16 Apr 2012 Posts: 8
|
|
Posted: Wed Jun 13, 2012 9:42 am |
|
|
I'm using PIC18F4550
Thanks! |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19368
|
|
Posted: Wed Jun 13, 2012 9:44 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
Darkforces
Joined: 16 Apr 2012 Posts: 8
|
|
Posted: Wed Jun 13, 2012 10:04 am |
|
|
Ok! It's true only input :( !!!
Thanks! |
|
![](templates/subSilver/images/spacer.gif) |
|