View previous topic :: View next topic |
Author |
Message |
knight
Joined: 23 Oct 2012 Posts: 1
|
pins state at start-up |
Posted: Tue Oct 23, 2012 1:47 am |
|
|
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? |
|
![](templates/subSilver/images/spacer.gif) |
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Tue Oct 23, 2012 2:37 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
rikotech8
Joined: 10 Dec 2011 Posts: 376 Location: Sofiq,Bulgariq
|
|
Posted: Tue Oct 23, 2012 10:24 am |
|
|
How becomes writing into a certain port. Is it like this: read-modify_data-write? |
|
![](templates/subSilver/images/spacer.gif) |
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Tue Oct 23, 2012 10:35 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Wed Oct 24, 2012 8:33 am |
|
|
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!! |
|
![](templates/subSilver/images/spacer.gif) |
|