View previous topic :: View next topic |
Author |
Message |
MOLLY Guest
|
Why isn't port D working on PIC16F877 |
Posted: Mon May 19, 2003 7:21 pm |
|
|
Hello, im just doing an easy test with
Output_high(PIN_D0) and so on. But port D is not responding. No change in voltage level!
What have I missed?
Thanks for any reply
Michael
___________________________
This message was ported from CCS's old forum
Original Post ID: 144514566 |
|
|
Dave Yeatman Guest
|
Re: Why isn't port D working on PIC16F877 |
Posted: Mon May 19, 2003 9:54 pm |
|
|
How are you setting up the Port pins. Can you show us the initialization section of the program?? If it is short then post the whole thing otherwise we would be just wildly guessing,.... :-)
:=Hello, im just doing an easy test with
:=Output_high(PIN_D0) and so on. But port D is not responding. No change in voltage level!
:=What have I missed?
:=
:=Thanks for any reply
:=
:=Michael
___________________________
This message was ported from CCS's old forum
Original Post ID: 144514567 |
|
|
MOLLY Guest
|
JUST USING OUTPUT_HIGH....... |
Posted: Mon May 19, 2003 10:07 pm |
|
|
I'm not setting up any ports, just using output_high(PIN_D0) and output_low(PIN_D0), this works just fine with all other ports, it's just port D that is not responding
Thank you again!
___________________________
This message was ported from CCS's old forum
Original Post ID: 144514569 |
|
|
allen_m Guest
|
Re: Why isn't port D working on PIC16F877 |
Posted: Wed May 21, 2003 1:21 pm |
|
|
Hi Molly,
Check how you are setting PortE TRISE register ... if you inadvertantly set bit 4 of the TRISE register, Port D goes into PSP mode and will not respond to output_Hi/lo() calls.
Also try external pullups on Port D (perhaps not strictly required).
Allen M.
___________________________
This message was ported from CCS's old forum
Original Post ID: 144514643 |
|
|
Bjorn Peschl Guest
|
Re: Why isn't port D working on PIC16F877 |
Posted: Thu May 22, 2003 7:42 am |
|
|
:=Hello, im just doing an easy test with
:=Output_high(PIN_D0) and so on. But port D is not responding. No change in voltage level!
:=What have I missed?
:=
:=Thanks for any reply
:=
:=Michael
Are you sure that it isnīt a hardware problem?
If you have include the "standard 16F877.h" file, the following program should work...
# include "16F877.h"
# use delay (clock=4000000)
int i =0;
main ()
{
Loop:
for (i=1;i<=5;++i)
{
output_high( PIN_D0 );
delay_ms( 100 );
output_low( PIN_D0 );
delay_ms( 100 );
}
for (i=1;i<=5;++i)
{
output_high( PIN_D1 );
delay_ms( 100 );
output_low( PIN_D1 );
delay_ms( 100 );
}
Goto Loop;
}
___________________________
This message was ported from CCS's old forum
Original Post ID: 144514672 |
|
|
John Taylor Guest
|
Re: JUST USING OUTPUT_HIGH....... |
Posted: Sat May 24, 2003 11:13 am |
|
|
Be sure this is included in the code:
setup_psp(PSP_DISABLED);
This will ensure that the PSP (Port D) in in I/O mode, not PSP.
Also, if you are using fast I/O, the port will be all inputs.
jt
:=I'm not setting up any ports, just using output_high(PIN_D0) and output_low(PIN_D0), this works just fine with all other ports, it's just port D that is not responding
:=
:=Thank you again!
___________________________
This message was ported from CCS's old forum
Original Post ID: 144514725 |
|
|
|