Define the ports of AT89C51 as input or output.

Discussion in 'Embedded Systems and Microcontrollers' started by MicroClub, Jul 21, 2009.

  1. MicroClub

    Thread Starter New Member

    Jul 19, 2009
    2
    0
    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
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    The device's data sheet should give that information.
     
  3. adventtech

    Member

    Feb 10, 2009
    22
    0
    To use the port pin as input, set pin to high. There isnt any separate port direction register in 89c51.
     
Loading...