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

pins state at start-up

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



Joined: 23 Oct 2012
Posts: 1

View user's profile Send private message

pins state at start-up
PostPosted: Tue Oct 23, 2012 1:47 am     Reply with quote

hi,
I want to ask about the pins state at start-up. Are they High or Low?
I want to connect a relay with microcontroller using transistor (port B and C).
Currently I am using pic16f870. Can anyone tell me about the pins (port) state at start-up?
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Tue Oct 23, 2012 2:37 am     Reply with quote

Quote:
I want to ask about the pins state at start-up. Are they High or Low?
Neither.

It's all in the data sheets.

Generally speaking pins states are INPUT on reset or powerup.

Therefore float if unattached.

If it's important they are in particular state, then it's usual to pull either up or down with a suitable resistor.

Mike
rikotech8



Joined: 10 Dec 2011
Posts: 376
Location: Sofiq,Bulgariq

View user's profile Send private message

PostPosted: Tue Oct 23, 2012 10:24 am     Reply with quote

How becomes writing into a certain port. Is it like this: read-modify_data-write?
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Tue Oct 23, 2012 10:35 am     Reply with quote

Quote:
How becomes writing into a certain port. Is it like this: read-modify_data-write?
I don't understand the question.

Please try again.

Mike
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Oct 24, 2012 8:33 am     Reply with quote

rikotech8 wrote:
How becomes writing into a certain port. Is it like this: read-modify_data-write?


Yes BUT if you are using a PIC18F or higher family then you would write to the LAT register and not the PORT. This solves the read-modify-write problem for a pin that is heavily loaded.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
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