[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems when polling interrupt register



Hello!

I really hope that someone can help me with this one. Sorry if you have received this mail twice, but I have had some trouble with the subscription of the list.

I'm using the Developer Board LX's parallel ports (both of them) in manual mode
to communicate with a chip. To do this I have followed Axis example of how to
write a device driver. The driver only takes care of the write and read
operation of bytes and has no part in the actual addressing within the chip. The
rest of the work is done inside the application, i e in user space.

Instead of using the interrupts in the chip, I have used polling to check for
events. When data is ready to be read on the chip, a Data In bit is set in an
interrupt register. By reading the register the bits are cleared. This register
is being continuously polled when a read operation is carried out. This may have
caused some problems because sometimes this bit is lost (the whole register
value actually). I have spoken to the manufacturer of the chip, and they say it
might be a problem of rescheduling of the process within the actual read operation of the
register, and because of that the value of the register is lost.

Do you think this might be the case? If so, is there an easy solution?

I have been thinking that one solution might be to use the interrupt signal of
the chip and let the driver read the interrupt register and store it in some
variable. Then the application can poll the driver instead of the register by
using an ioctl, or something. This way very little has to be rewritten in the
application.

Do you think this is possible? If so, can I request the interrupt as
SA_INTERRUPT and avoid that the interrupt is interrupted?

Where can I connect the interrupt pin on the chip to the developer board? I have
thought about using the nmi external interrupt pin, but it seems to be
hard-wired high, and if possible I would like to avoid making any permanent
changes on the board.

Thanks!

/Marcus Jonsson