- From: Robin Cornelius <robin.cornelius_at_hirst-magnetics.com>
- Date: Thu, 11 Oct 2007 08:58:06 +0100
Frank Mori Hess wrote: > On Wednesday 10 October 2007 04:23, Robin Cornelius wrote: > >> Hi everyone, >> >> I've just started using comedi and I am using a adlink pci7348 card >> (which is not supported) so i hacked up the PCI-7296 driver go get it >> working, which it does :-) (Infact no modification for basic DIO, just >> swap all "adl_pci7296" for "adl_pci7348" and its a go (infact this >> should also work perfectly with the adl_pci7396). >> > > If the boards are essentially the same programming-wise, they should both > be supported by the same driver, as opposed to adding a second nearly > identical one. > Yes this is what I ideally wanted to get back to after i had finished hacking :-), it would be good to share the code. Especially as it is also so simple, just inits 2 or 4 8255s. It would be nice to get 8254 support in there as well, i believe the 7296 also has a 8254 onboard so although i don't have one I can pull a datasheet and see if i can make compatible code for both :-) > >> Anyway the 7348 supports a change of state (COS) interrupt. I have >> implemented the IQR handler but I am unsure what to do next. I have read >> the documentation other examples but I do not fully understand the >> (comedi) driver level concepts still. How should i handle the COS event. >> Ideally when this happens the event needs to trigger a call back ASAP to >> minimise latency. I see mention of callbacks but can't see exactly what >> I want. Can someone give me some pointers on the correct way to handle >> this and pass the event back through comedi. Should i be using the >> s->events->async stuff? >> > > The way it's been done before is to add support for an input command, that > generates a bogus sample every time the event occurs. > Ok thanks, gives me something to look for > >> One final problem is that I seem to be getting continuous interrupts >> from the card, I believe I am setting the interrupt masks correctly and >> I am ACKing the interrupt correctly but it fires of at a enormous rate. >> > > PCI interrupts can be shared, could it be another device generating the > interrupts? You might also check if there is a second bit in a register > somewhere you need to use to clear the interrupt, like in the pci chip. > Well thats how I am ACKing the interrupt, there is an interrupt clear register which I am clearing. I have seen reentry before if you don't clear an interrupt flag and that usually deadlocks a machine. I know interrupts are shared but i thought that with modern interrupt routing you got a unique number , in this case IRQ18 but i also see 150's etc which must be routed, i will check. Well thanks for the answers it gives me something to look for Best regards Robin -- Dr Robin Cornelius Design Engineer Hirst Magnetic Instruments Ltd (UK Magnetics Society management committee member) Tel: +44 (0) 1326 372734 www.hirst-magnetics.com Fax: +44 (0) 1326 378069 www.gaussmeter.co.uk Tesla House, Tregoniggie Industrial Estate Falmouth, Cornwall, TR11 4SN, U.K. Reg No: 1564814 England VAT Registered: GB730 0277 74
Received on 2007-10-11Z06:58:06