Thanks Darrel.

Fels like I'm on the right track again.
I made some tests with USBIn today and it seems to work.
I call DoUSBIn directly after the DoUSBOut so it has time enough to transmit before the next high pulse trig the ccp input.
And if the drum is not rotating DoUSBIn is called by interval using Timer3.

Regards

Stefan.