- From: Tim Beamish <tbeamish_at_cs.ubc.ca>
- Date: Fri, 12 Jul 2002 16:15:00 -0700 (PDT)
Hi John, I've been working with your code all day. I think it's nicely nestled within my program but I don't think I've setup my parallel port properly. I executed this to load the parallel port driver into the kernel: /sbin/insmod comedi_parport Then I configured the port with this command: /usr/sbin/comedi_config /dev/comedi1 comedi_parport 0x03bc,3 This is where I may have gone wrong. I think I can choose one of three base addresses for my parallel port (3bc, 378 or 278). I looked at /proc/ioports and didn't see any parallel ports listed until I executed the above command and then one gets listed at the address that I specified. I tried each of these addresses and ran a demo program: ./inp -f /dev/comedi1 -s 3 -c 0 Subdevice 3, channel 0 is pin 10, right? This returns 0 even when I send 5V into pin 10 so it looks like the parallel port is not configured properly. Any ideas on what I'm doing wrong. Tim On 11 Jul 2002, John Sims wrote: > On Thu, 2002-07-11 at 16:26, Tim Beamish wrote: > > Hi John, > > > > Pin 10 causes an interrupt right? Do you have an example function for > > listening for interrupts and acting on them? I don't understand what you > > mean when you say "set up a comedi command on subdevice 3, set a callback > > on the command". What exactly am I setting up on subdevice 3 (digital > > output)? What command am I making a callback on? Do you mean, make a > > callback on the interrupt when it happens? > > See the attached code. Note, this is a kernel module, so there's no > main routine. The interesting thing to note is that the completed > comedi command is actually executed only once, at initialization time, > and canceled when the routine shuts down. The callback routine will be > invoked each time the interrupt arrives on pin 10. I'm currently using > this very effectively in my application. I don't know whether the code > supplied will even compile, since I've gleaned it out of a much larger > kernel module, but if you use the command settings as stated in the > preparation routine, it should work just fine for you..... > > Hope this helps... > > John >
Received on 2002-07-12Z22:15:00