Hi all
I have a small problem and I need a hint
Basically I read an ADC value and read it out on 16 LEDs. It also has a minimum value, but if min == current value then the minimum value is not displayed. Currently the min value is hardcoded to 2-3 less than the current. It simply uses the ADC value and there are now 3 DECF to get a min value.
Still, this acts funny:
; min only when it is not the actual value MOVF ADC_RESULT, W SUBWF MIN_DISP, W BTFSC STATUS, Z GOTO _not_mode_2 ; here I show the min value
If my ADC result is 9 or more, then it works. Currently my min value will be 7 by default (7 and 9), and when ADC=9 it works, but when ADC=8 then it does not set the Z flag. When using 9 and 6 the same occurs. ADC must be 9 or more for the Z flag to be set. My readings work in all ways except this weird card. 9 is when the upper part is in use, so I wonder what happen if the current and min are in the same part/port
If I comment the bit check and goto out, then it works, and shows the min value just as expected.
But I cannot see the difference between 8 and 9.
What am I not seeing here?
WBR Sonnich