View previous topic :: View next topic |
Author |
Message |
dijuka
Joined: 26 Apr 2004 Posts: 2
|
PIC 18F452 problem |
Posted: Mon Apr 26, 2004 12:49 pm |
|
|
I am using PIC 18F452 with CCS v3.179. I haven't been able to get PIN_A4 and PIN_A6 to high. What am I doing wrong? |
|
|
fpgeh
Joined: 07 Sep 2003 Posts: 19 Location: Vancouver, BC
|
|
Posted: Mon Apr 26, 2004 1:07 pm |
|
|
Pin A4 is an open drain pin. This means it can only drive low. To get the pin high, you will need a pullup reistor to Vcc.
As for pin A6, I'm not sure what the porblem could be. The datasheet does say that on a Power-On Reset pins A4 and A6 are configured as inputs, the rest of port A as outputs. |
|
|
fpgeh
Joined: 07 Sep 2003 Posts: 19 Location: Vancouver, BC
|
|
Posted: Mon Apr 26, 2004 1:08 pm |
|
|
Sorry, to correct. On Power-On reset, Pins A4 and A6 are configured as digital inputs, the rest as analog inputs. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Apr 26, 2004 1:35 pm |
|
|
Quote: | I am using PIC 18F452 with CCS v3.179. I haven't been able to get PIN_A4 and PIN_A6 to high. What am I doing wrong? |
According to the 18F452 data sheet, to get Pin A6 configured as an
i/o pin, you must use the RC_IO or EC_IO oscillator option.
So in your #fuses statement must use one of those two options,
instead of HS or XT, etc. |
|
|
dijuka
Joined: 26 Apr 2004 Posts: 2
|
|
Posted: Mon Apr 26, 2004 3:30 pm |
|
|
Thank you for helping out. |
|
|
Birdasaur
Joined: 07 Oct 2003 Posts: 29
|
|
Posted: Fri Aug 06, 2004 9:24 am |
|
|
After changing the Fuse statement appropriately, how would we access PIN_A6?
add a manual define to your file like
#define PIN_A6 31750
??
I ask because it isn't really available anywhere in the header file that I see and wouldn't compile otherwise. |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Fri Aug 06, 2004 10:50 am |
|
|
That would be one way. You can always manipulate the bits in the registers also. |
|
|
|