CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Why isn't port D working on PIC16F877

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
MOLLY
Guest







Why isn't port D working on PIC16F877
PostPosted: Mon May 19, 2003 7:21 pm     Reply with quote

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
PostPosted: Mon May 19, 2003 9:54 pm     Reply with quote

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.......
PostPosted: Mon May 19, 2003 10:07 pm     Reply with quote

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
PostPosted: Wed May 21, 2003 1:21 pm     Reply with quote

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
PostPosted: Thu May 22, 2003 7:42 am     Reply with quote

:=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.......
PostPosted: Sat May 24, 2003 11:13 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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