You don't state what PIC this is for, so I randomly grabbed the data sheet for a PIC16F1824; STATUS Register 3-1, page 24.
STATUS <7:5> = Unimplemented, read as 0
STATUS.4 = TO: Time-Out bit
STATUS.3 = PD: Power-Down bit
STATUS.2 = Z: Zero bit
STATUS.1 = DC: Digit Carry
STATUS.0 = C: Carry
You can see when you reached zero the STATUS.Z reflected that. However, you alter the STATUS Register in your code. About the only thing you can change is the C bit. Delete the "status=1" line and try again.





Bookmarks