|
|||||||||||
|
Technical Support Support Resources
Product Information |
C51: How Do I Read a Latch?Information in this article applies to:
QUESTIONHow I can read the latch for an I/O port instead of reading the pins (from C)? ANSWERThere is no way to read the latch value of an 8051 I/O port. However, there are instructions that allow you to read, modify, and write back the new value to the port latch. Basically, the ANL, ORL, and XRL instructions support this READ-MODIFY-WRITE feature. If you must have access to the port latch you can create a shadow variable that contains the latch value. For example:
Then, when you need to know how the latch is set you can read the P1_shadow variable. MORE INFORMATION
SEE ALSOLast Reviewed: Thursday, February 25, 2021 | ||||||||||
|
|||||||||||
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.