Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/03/00 07:24
Read: times


 
#3522 - RE: Saving p2
Hi Erik,

on using external code execution, you can never read back P2.
Please use a function, executed from the internal code space,
to read back P2.


If no internal code space available:

1. everytime, if you modify P2, store the same value
to a byte in the internal RAM (= shadow register).

2. use DPTR instead of P2

3. you can read back P2 bitwise with using
the JBC instruction (see 8051 manual for details):

mov a, #0FFh
jbc P2.0, tb0
clr acc.0
tb0: jbc P2.1, tb1
...
tb6: jbc P2.7, tb7
clr acc.7
tb7:


Peter


List of 5 messages in thread
TopicAuthorDate
Saving p2            01/01/70 00:00      
RE: Saving p2            01/01/70 00:00      
RE: Saving p2            01/01/70 00:00      
RE: Saving p2            01/01/70 00:00      
RE: Saving p2            01/01/70 00:00      

Back to Subject List