El 3 de octubre de 2011 18:41, Fernando Herrero Carrón <[email protected]>escribió:
> El 30 de septiembre de 2011 00:16, Alexis Berlemont < > [email protected]> escribió: > >> Hi, >> [...] >> >> With insn_read, did you manage to acquire correct values at least? >> >> > Dear Alexis, > > insn_read does indeed work. If I run "insn_read -S 1000" I get my input > sampled at approx 125kHz. Running cmd_read with and without '-m' only > returns 0x8000. > > I have been playing around with __a4l_info and the driver code to track > down my problem. I am not familiar at all with low-level DAQ programming, so > I just followed my intuition. > > I modified > buffer.c:a4l_read_buf and buffer.h:__consume > > to dump the values that were being consumed from the internal buffer. There > I found the infamous 0x8000, so my conclusion is that those values are > traveling along the kernel side. I decided I would go the other way around > and modified > > drivers/analogy/national_instruments/mio_common.c: handle_a_interrupt > and drivers/analogy/buffer.c: a4l_buf_evt > > I guess that interrupt is being generated every time a DMA transfer has > been completed from the DAQ to analogy's internal buffer. I dump variable > "count" in a4l_buf_evt and it always reports the appropriate byte count to > be transferred, which is "number of channels" * 2. > > My guess is that the DMA transfers are being performed to the wrong place, > because the whole procedure seems to be working ok otherwise. > > All help is appreciated, > Fernando > > > Dear all, More updates on this. I just tested both the "cmd_read" example and my own code on the analogy_fake device. They're both working, I get a sawtooth shape. So my guess is still that there is some error in the DMA transfer in the NI driver(s). Could anyone please help me indicating where DMA is setup in the NI drivers? I'll try to have a look at it myself, but a more experienced advice would be helpful. Thanks, Fernando
_______________________________________________ Xenomai-help mailing list [email protected] https://mail.gna.org/listinfo/xenomai-help
