Define the ports of AT89C51 as input or output.

Thread Starter

MicroClub

Joined Jul 19, 2009
2
I m using AT89C51 for digital clock, with external pulse.
and in m using keil 2.23
i m using assembly (ASM) files

i want to set the port0-1-2 for parallel data, and port3 for serial data

the problem is to define the port as input or Output

Master Clock
------------------
port0 for input ; Full 8 bit port
port1 for output ; Full 8 bit port
port2 for output ; Full 8 bit port
port3 for output (to send serial data) ; Full 8 bit port

Slave Clock
------------------
port0 for output ; Full 8 bit port
port1 for output ; Full 8 bit port
port2 for output ; Full 8 bit port
port3 for input (to receive data) ; Full 8 bit port

please tell me how can i set the ports for input and/or as output
 

adventtech

Joined Feb 10, 2009
22
I m using AT89C51 for digital clock, with external pulse.
and in m using keil 2.23
i m using assembly (ASM) files

i want to set the port0-1-2 for parallel data, and port3 for serial data

the problem is to define the port as input or Output

Master Clock
------------------
port0 for input ; Full 8 bit port
port1 for output ; Full 8 bit port
port2 for output ; Full 8 bit port
port3 for output (to send serial data) ; Full 8 bit port

Slave Clock
------------------
port0 for output ; Full 8 bit port
port1 for output ; Full 8 bit port
port2 for output ; Full 8 bit port
port3 for input (to receive data) ; Full 8 bit port

please tell me how can i set the ports for input and/or as output
To use the port pin as input, set pin to high. There isnt any separate port direction register in 89c51.
 
Top