Quote Originally Posted by mister_e View Post
Is there any available schematic of it?

That's quite an ISR you have.... Usually it has to be kept as short as possible. I'll try having a look at this later.

Looking at the actual main loop... i'm not even sure if ANY interrupts are needed. Maybe just a read PORTA in a loop would do the job.
If fact I'm building 4 projects, all used in a lasergame system, one is the sensors module on the player, one is the gun itself, one is the mag (that manages all the bullets and spare mags) and the last one is the supplier for providing spare mgs and medics to players.

I've debuged the first three modules these 3 last days and I still have to take care of the supplier module.

All handshaking between pics is not tested yet, for debugginf phase, I preset the values to what's expected as a reply. The gun encodes a PWM signal to represent a header, a byte and a trailer, the sensors module gets the signal, checks structure validity then extracts the byte and use it.
I hope I won't encounter timing problems with that part.

Polling quickly portA won't be enough...