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 support@ccsinfo.com

output_high automatically reverting on next output_high

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







output_high automatically reverting on next output_high
PostPosted: Tue Apr 01, 2003 8:49 pm     Reply with quote

Hi All,

I am a beginner, and running into a seemingly simply issue:

The description:

I'm using a pic F877. If I set pin D2 HIGH, give it a delay of say 1 sec, and then set pin D3 HIGH, it will automatically turn pin D2 LOW or OFF without my specifying it.

Lets say I want to have 3 pins to remain HIGH permanently (or at least whenever I want them to remain on). This problem is ensuring that I can only have one pin high at a time.

Things I've tried:

#use standard_io(A-E) makes no difference.
SET_TRIS_A-E(0x00) makes no difference
ouput_d(0b00000100);
ouput_d(0b00001100);
Also does the same thing.

Anyway, any suggestions would be absolutely welcome! I am truly stumped.

Thanks in advance!

Daniel

Heres my current VERY SIMPLE TESTING PROGRAM:

#include <16F877.h>
#fuses XT,WDT,NOPROTECT

#use delay (clock=4000000)

main()
{
setup_wdt(WDT_2304MS); /*unneccessary - but here it is*/
output_high(PIN_D4);
delay_ms(250);
output_low(PIN_D4);

set_tris_d(0x00);
output_low(PIN_D2);
output_low(PIN_D3);
while (TRUE)
{
restart_wdt();
output_high(PIN_D2);
delay_ms(250);
output_high(PIN_D3);
delay_ms(250);
}
}






___________________________
This message was ported from CCS's old forum
Original Post ID: 13300
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: output_high automatically reverting on next output_high
PostPosted: Tue Apr 01, 2003 9:14 pm     Reply with quote

:=Hi All,
:=
:=I am a beginner, and running into a seemingly simply issue:
:=
:=The description:
:=
:=I'm using a pic F877. If I set pin D2 HIGH, give it a delay of say 1 sec, and then set pin D3 HIGH, it will automatically turn pin D2 LOW or OFF without my specifying it.
------------------------------------------------------

1. What happens if you comment out all the Watchdog timer stuff.
(including changing the fuse to NOWDT) Does it still do this ?
I'm trying to find out if it's some problem with the ports, or
if it's caused by the WDT.

2. Also, you should add NOLVP to the end of your #fuses, unless
you know for certain that you're using low voltage programming.

3. What's your version of the compiler ? There once was a
problem with TRIS on ports D and E. See the following line
from the old CCS versions page:
3.052 SET_TRIS_D and E were broke in 3.050,3.051 now restored

4. Do have you anything connected to these Port D pins, such
as LEDs, without a series resistor ? (just wondering).
___________________________
This message was ported from CCS's old forum
Original Post ID: 13301
Rainer
Guest







Re: output_high automatically reverting on next output_high
PostPosted: Wed Apr 02, 2003 6:19 am     Reply with quote

Is the connection to the ground o.k.?
Is your power supply o.k.?
___________________________
This message was ported from CCS's old forum
Original Post ID: 13306
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