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

pin output came high

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



Joined: 11 Jun 2005
Posts: 38

View user's profile Send private message

pin output came high
PostPosted: Fri Aug 01, 2014 4:02 am     Reply with quote

hallo i am trying solutions for problem that i have with output pin of 10f206, the problem is that when i give power to pic 3,3v the pin out came high (3,3v) instantly for after became low like i need. This is big problem for me because i need that output pin be always low state when I give power.
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Fri Aug 01, 2014 4:16 am     Reply with quote

You need to put a pull down resistor on the line.

This is a 'read the data sheet' problem.

On the PIC, most pins wake up as inputs. Open circuit effectively. This is done so the PIC will never 'drive' anything when it wakes (the exception are pins on things like 'power PWM' sections, where fuses allow you to program these to be driven high/low). So you need to ensure that your circuitry will always go to the state you want, when undriven.

As soon as you take control of the pins (a few uSec), you can then program the pins to drive the way you want. However it is up to you to ensure that undriven pins will be pulled the way you want before this time. If the pin is going high, then it suggests the circuitry 'pulls high', except when 'driven low'. You need to look at your design and correct this.
The PIC pins will not actively drive, till the power up sequence is completed, and code is running.
alan



Joined: 12 Nov 2012
Posts: 357
Location: South Africa

View user's profile Send private message

PostPosted: Fri Aug 01, 2014 4:28 am     Reply with quote

This sometimes also happens as the compiler with standard_io set the tris register before writing to the port.

I had a similar problem on a dsPIC.
Had to use fast_io write a low and then set the tris manually.

Regards
ferrarilib



Joined: 11 Jun 2005
Posts: 38

View user's profile Send private message

PostPosted: Fri Aug 01, 2014 7:06 am     Reply with quote

thanks Ttelmah and alan . the output pin have pull down resistor but is same problem.

So i can try do pin as input for a dalay time ad after do output ?
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Fri Aug 01, 2014 9:00 am     Reply with quote

Do a variant on what alan is saying:
Code:

#byte PORTB=getenv("SFR:PORTB")
#bit B0 = PORTB.0
#bit B1 = PORTB.1
#bit B2 = PORTB.2
#bit B3 = PORTB.3

    //Then for the pin you are using (example on B0)
    B0=FALSE;
    output_low(PIN_B0);


This ensures the output latch is set 'low', before the pin is driven as an output.

Best Wishes
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