1 Reply Latest reply on Mar 22, 2009 6:49 AM by mganeshr_41

    Not Able To Control Ports

    userc_45166
              We have typed the following code to acces a port:   
         
      mov a, REG[PRT2DR]   
      OR A,0X0FF   
      MOV REG[PRT1DR],A   
         
      but the value at the port is not changing   
         
      please do help ASAP   
        • 1. Re: Not Able To Control Ports
          mganeshr_41
                  When you want to control a Port pin by accessing the PRTxDR register, the pin should be set to StdCPU and the drive mode should be other than HighZ or HighZ Analog. Try setting the drive mode to StdCPU / Strong and the code should work. Also, you can directly modify the pin state by using the following instruction.   
             
          or reg[PRT2DR], 0xFF