![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
Seba Guest
|
Help please. If i set 1 bit of port E 3 pins go high.... |
Posted: Wed Dec 14, 2005 11:35 pm |
|
|
Hi,
i am having a problem with a device i built and have a major deadline for soon.
The code is very simple, basically i have 20 output ports, on a 18F8627 connected to external devices (LEDs) and they are turned on by a lookup table.
I was testing the device but the first 4 LEDs are connected to pins 4-7 of PORT E. I am able to turn on the one connected to E7, but every time i set any of E4, E5 or E6 they all go high together.
I am setting the whole port together, rather than individual pins with the following instruction:
output_e(frames[FE][whichFrame]) ;
I have similar instructions for LEDs connected to PORT J and D and they work perfectly.
Appreciate any help
Thanks in advance.
Sebastian |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Dec 15, 2005 12:28 am |
|
|
Disable the External Memory Bus. It's enabled by default upon reset.
Add the code shown in bold, below:
Quote: | #include <18F8627.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock=4000000)
#byte MEMCON = 0xF9C
#bit EBDIS_BIT = MEMCON.7
void main()
{
EBDIS_BIT = 1; // Disable external memory bus
while(1);
} |
|
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|