Hi all,
one important news: PROBLEM SOLVED ! ! !

It was sufficient to adjust the parameters of another timed loop in the code. It is devoted to the execution of a digital pattern input. The problem was in the fact that it had a too long period of execution resulting in a waste of resorces and processor time. I lower the period of that timed loop so now the other timed loops can execute correctly.
Result: my semaphore is almost better than a real one.
Thak you all for your support.
Bye.
Damiano