Skip to main content
Visitor II
November 23, 2005
Question

Port A problem!!!

  • November 23, 2005
  • 2 replies
  • 655 views
Posted on November 23, 2005 at 07:27

Port A problem!!!

    This topic has been closed for replies.

    2 replies

    saintAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 12:09

    Hi

    I`m using port A as GPIO input pins ,but they can`t receive the data that I sent, the part of my source code as follow Is there anyother register I must check??

    PSD_reg.DRIVE_A &=0x0F;

    PSD_reg.OUTENABLE_A |=0xF0;

    PSD_reg.CONTROL_A &=0x0F;

    PSD_reg.DIRECTION_A &=0x0F;

    PSD_reg.DATAOUT_A |=0xF0;

    if(PSD_reg.DATAIN_A & bmBIT4) port_val |=bmBIT1;

    if(PSD_reg.DATAIN_A & bmBIT5) port_val |=bmBIT2;

    if(PSD_reg.DATAIN_A & bmBIT6) port_val |=bmBIT3;

    if(PSD_reg.DATAIN_A & bmBIT7) port_val |=bmBIT4;

    saintAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 12:09

    thank you so much I found what the problem is

    The bit 7 of VM register should be set to '0' (Disable Peripheral I/O mode)

    thank you again !!! :)