Skip to main content
Visitor II
August 13, 2003
Question

difficulty in accessing Port B in MCU I/O mode

  • August 13, 2003
  • 3 replies
  • 808 views
Posted on August 13, 2003 at 09:46

difficulty in accessing Port B in MCU I/O mode

    This topic has been closed for replies.

    3 replies

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 11:55

    Hi,

    I tried to access the port B in MCU I/O mode.But i couldn't access the same...

    e.g

    mov a,#0x00

    mov dptr,#CONTROL_B

    movx @dptr,a // MCU I/O mode

    mov dptr,#DIRECTION_B

    movx @dptr,a // as i/p port

    mov a,#0x41

    mov dptr,#DATAIN_B

    movx @dptr,a

    after this i tried to read the port B using

    mov dptr,#DATAOUT_B

    movx a,@dptr // read the data_out for poret B

    & transmit the same on serial port....

    but port B is always low...all bits=0

    i would like to know where i am going wrong..

    moreover the DATA_IN for port B is 0x01 (reg offset address or 0x02???)

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 11:55

    hI,

    I AM ABLE TO ACCES THE PORT b. i got my mistake.....

    purvi
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 11:55

    I don't know which wrong you said:

    you send #0x41 and want get the data through read port B?

    Is it your means?

    If it is, you may get the same data, or not. because the data is sent, but that you have read has changed by the peripheral.