Skip to main content
Visitor II
February 2, 2004
Question

Using PA as a Imput

  • February 2, 2004
  • 2 replies
  • 621 views
Posted on February 02, 2004 at 17:15

Using PA as a Imput

    This topic has been closed for replies.

    2 replies

    sbencke3Author
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 11:58

    I'm having some problems to configure PA to be a Input, I make a simple code as folow:

    main{

    PSD8xx_reg.VM |= 0x80;

    PSD8xx_reg.DIRECTION_A = 0x00;

    PSD8xx_reg.DIRECTION_B = 0x00;

    While(1){

    printfLCD(''PA = %x \n'', PSD8xx_reg.DATAIN_A);

    printfLCD(''PB = %x \n'', PSD8xx_reg.DATAIN_B);

    }

    }

    I don't have problems with PortB, just with Port A. Does I have to make somethink special in the port A ?

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

    If you want your Port A to behave the same way as your Port B which is in MCU I/O mode, then do not set bit 7 of the VM register, since setting this bit will put your Port A to Peripherial I/O mode.