You are here

Not Able To Control Ports | Cypress Semiconductor

Not Able To Control Ports

Summary: 1 Reply, Latest post by graa on 22 Mar 2009 06:49 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
umanathkamath's picture
1 post

We have typed the following code to acces a port:

mov a, REG[PRT2DR]



but the value at the port is not changing

please do help ASAP

graa's picture
Cypress Employee
223 posts

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

Log in to post new comments.