View previous topic :: View next topic |
Author |
Message |
mdares
Joined: 26 Oct 2005 Posts: 19
|
PIN_D7 on PIC18F4580 |
Posted: Sun Jan 08, 2006 3:05 pm |
|
|
Hi all,
Can someone tell my why this pin is not defined in the 18F4580.h file, and why in the debugger it shows me the MSB of portd/trisd as an X? The chip datasheet doesn't give me any indication that there is anything special about this i/o pin (that I could see).
I know I must be missing something simple here, but I can't seem to make sense of it. I am having a problem with a project I am migrating from a 18F458 chip where I use this pin to write to an LCD.
Matt |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Jan 08, 2006 3:14 pm |
|
|
What's your compiler version ? PCH vs. 3.241 has it defined:
Quote: | #define PIN_D0 31768
#define PIN_D1 31769
#define PIN_D2 31770
#define PIN_D3 31771
#define PIN_D4 31772
#define PIN_D5 31773
#define PIN_D6 31774
#define PIN_D7 31775 |
If you have PCWH, then use the Device Editor to check if Pin D7 is
properly defined in the i/o ports section. Screenshot of Device Editor:
http://www.ccsinfo.com/pix/Device%20Editor.gif |
|
![](templates/subSilver/images/spacer.gif) |
mdares
Joined: 26 Oct 2005 Posts: 19
|
|
Posted: Sun Jan 08, 2006 7:13 pm |
|
|
I am uning 3.242, just upgraded from 3.224 when I noticed the problem. It is defined properly in the device editor, but only displaying 7 bits in the debugger (portd/trisd show up as set to x1111111 under peripherals in the debugger). |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Jan 08, 2006 7:57 pm |
|
|
What if this is a debugger issue, and not a compiler or hardware issue ? |
|
![](templates/subSilver/images/spacer.gif) |
mdares
Joined: 26 Oct 2005 Posts: 19
|
|
Posted: Sun Jan 08, 2006 9:02 pm |
|
|
I think I found it:
When I regenerated the header file for the new project with the updated compiler it set this fuse:
#FUSES NOXINST
which was under 3.224 was (or maybe by a misclick from me)
#FUSES XINST
Anyway this seems to have been my problem.
Thanks for your time
Matthew Dares |
|
![](templates/subSilver/images/spacer.gif) |
|