Hi,
thanks for your reply. I got around to modifying the relevant registers in the debugger and can now simulate an incoming MIDI message.
The problem seems to be within the following: I’m using the WGT and WLTEQ macros that you provide in macros.h to check a statement like value 1 > value 2 or value 1 =< value 2.
;; if JITTER_DELTA < DELTA2
movf DELTA2, W
WLTEQ JITTER_DELTA, goto Jit_Test_4 ; result true: JITTER_DELTA < DELTA2
goto Jit_Test_3 ; result not true: JITTER_DELTA >= DELTA2
The problem is that the results sometimes do not seem to be right. Still, this cannot be a fault of your macro, because even with this code I get the same strange behaviour:
movf DELTA2, W
subwf JITTER_DELTA, W ; subtract DELTA2 from JITTER_DELTA, store result in W
;; is the result true ?
btfss W, C
goto Jit_Test_3 ; result not true: JITTER_DELTA >= DELTA2
goto Jit_Test_4 ; result true: JITTER_DELTA < DELTA2
I already exchanged the last two lines of code, which gives me a correct comparison in some cases - in other cases it is just the other way round.
Is there something I overlook? When compiling, I get two warnings like:
Command line: “C:\PROGRA~1\MPLAB\MPASMWIN.EXE /p16F877 /q C:\PROGRA~1\MPLAB\SM-CONV\MAIN.ASM”
Warning[202] C:\PROGRAMME\MPLAB\SM-CONV\MACROS.H 32 : Argument out of range. Least significant bits used.
Warning[202] C:\PROGRAMME\MPLAB\SM-CONV\MACROS.H 38 : Argument out of range. Least significant bits used.
I do not get these warnings without use of the macros, but the effect is still the same - sometimes the comparison works okay, sometimes the result is just utterly wrong, depending on the two input values… ???
Any hint is much appreciated… this topic might also be discussed in german language, if this is easier to anyone…
Sigh, ilmenator