SHENZHEN I/O

SHENZHEN I/O

View Stats:
Conqueror Dec 1, 2016 @ 5:47am
"teq"
Hi,need help with teq understanding
my program is:
" teq p0 p1
+ mov 0 p1
+ slp 1
- mov p0 p1
- slp 1"

when p0 and p1 = 0 its work correctly, but when p0 and p1 = 100 it makes "-" instead "+".
Why?
< >
Showing 1-4 of 4 comments
BlaXpirit Dec 1, 2016 @ 5:51am 
You can't use the same 'p' pin for writing and reading. When you say 'mov p0 p1' it's actually equivalent to 'mov 0 p0; mov p0 p1'.
bluegreenash Dec 2, 2016 @ 8:41am 
yes BlaXpirit is correct here, you cannot use P0 & P1 to hold a value, because that value is lost when the pin is changed from being an output to an input. you can only use it to send a value to something else, or read a signal coming from something else.
your problem might be with trying to change the value on a line that is allready getting an input from somewhere else
< >
Showing 1-4 of 4 comments
Per page: 1530 50

Date Posted: Dec 1, 2016 @ 5:47am
Posts: 4