falleafd
New Member
h'11' = b'00010001' not b'00100001', that is rb0 and rb4 are inputs.
I don't remember exactly, but if i'm right, there is a problem that if a pin of a port is set to output, the pull up resistor will be removed. Therefore, you cannot push portB <1> if you are setting it as output.
Be careful with this.
Why don't you movlw h'ff' or you can use binary numbers for sure in this case?
scan the port is good, no problem. Because as you push, you must hold down it longer than your short program takes to re-scan. However, if you write a long program, it may causes problems. Because as you push the button, the program is still running somewhere, and you lift your finger up, the program is still running somewhere. It cannot detect the changes at the port. In this case, you must use interrupts.
I don't remember exactly, but if i'm right, there is a problem that if a pin of a port is set to output, the pull up resistor will be removed. Therefore, you cannot push portB <1> if you are setting it as output.
Be careful with this.
Why don't you movlw h'ff' or you can use binary numbers for sure in this case?
scan the port is good, no problem. Because as you push, you must hold down it longer than your short program takes to re-scan. However, if you write a long program, it may causes problems. Because as you push the button, the program is still running somewhere, and you lift your finger up, the program is still running somewhere. It cannot detect the changes at the port. In this case, you must use interrupts.