Originally Posted by
kodalo
Yes, I just tried with "Non Auto Timeout" and it didn't work. I.e. works, but has only one mode - 1/16 and jumpers has no effects.
ASM codes are the same for both SW, except line 23 #define TIMEOUT_ENABLED and it is normal.
I'll have a look at that, the defines are probably hiding something they're not suppose too. Since I never use the non-timeout version I don't really test it to fully
Originally Posted by
kodalo
In any case, I like "Auto Timeoutcode", but I will be really happy if Alan will be so kindly to tell me how to change timeout from 5.1/2 minutes. I didn't know assembler well so I can't find "magic value" in code.
It's done using the 16 bit TMR and a few overflow registers. There isn't really a magic number to keep the code fast.
Code:
incf timeout_reg, f ; Increase the timeout reg value
btfss timeout_reg, 2 ; Check we've been around the 4 times of the 16 bit counter (~5 minutes 45 seconds @ 20MHz)
goto Loop
Comment out these lines to reduce the timeout to like 70secs or change "timeout_reg, 2" to some other bit field number (ie. 0-7) to increase the time. Experimentation is the key (else crack out the calculator and use the number of instructions versus the clock frequency to get an exact time)
-A.