sam_kevin
Junior Member level 1
- Joined
- Jan 21, 2013
- Messages
- 16
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,429
Port -0.0 (pin no 39) will act as a main switch, If Port -0.0 becomes high, then port – 0.1, 0.2, 0.3, 0.4, 0.5, 0.6 and Port – 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6 should pulled to high
Explain this.
P0 is input port. How can you make it high? You can make it high if it is an output port or pin.
Sorry, it's my fault, I goggled and came to know, if a port need to made as an input then it has to initialized as 1.
Now please guide me If a port is made high for input, then how could i sense that port is receiving high signal ?
P0=0xFF; // P0 is a input port
P0=0x00;// to clear the value in port now it ready to get input high signal.
#include<stdio.h>
#include <REG51.H>
sbit Ign = P0^0;
void main()
{
P0= 0x00; //port 0 pulled to low
P2= 0x00;
if (Ign ==1)
{
P0= 0x7f;
P2= 0x7f;
}
}
Dear #MAAM#:
In you code P0 is assigned as input or output port ?? Can you please guide me what kind of statement i should use to check each bit of port 0 and make port 2 low (point no 4, 5 and 6)
P1=0x7f; //random value it's only example about output
variable=P1; //variable it's only variable to saves the value from the Port1
Port -0.0 (pin no 39) will act as a main switch, If Port -0.0 becomes high, then port – 0.1, 0.2, 0.3, 0.4, 0.5, 0.6 and Port – 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6 should pulled to high.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?