i have an interrupt-related problem on a self-designed pc104-board:
i have several int-sources connected to a register and an edge-detector. if an edge is detected an int is raised. the shared isr's then check the register to see if they need to service their device. the int is cleared by writing to the register.
my problem: sometimes no more ints are generated. reloading a driver (and thus clearing the int-request) cures this. the problem seems to be, that every isr clears the int-request (i want the drivers to be totally independent) and a new int arrives while being in the int-context. this way the int request is raised but never serviced in the system isr. with resetting the int req as late as possible in the isr's, i can reduce the window for this bug.
a solution i can think of is a state machine that queues interrupts. states would be:
idle goto wait when int raised else stay idle
wait raise int-req, wait for some cycles for a clear-int, if expiring goto idle (deactivate int), if another int-req is received goto queued
queued deassert int-req, wait for some cycles for a clear-int, if expiring raise int and goto wait, if another int is received stay queued and retrigger wait-time
this should queue and delay the int requests. the delay needs to be longer than every isr's start to clear-req time.
any other ideas?
btw, the above logic is (will) be integrated in an isplsi 1016 from lattice.