- From: David MacMahon <davidm_at_astro.berkeley.edu>
- Date: Thu, 05 Oct 2006 10:42:02 -0700
M. Koehrer wrote: > Whenever the input voltage is negative, the value of data in comedi_data_read() is fine, > it is something between 0x00000000 and 0x00007fff. > However, whenever the input voltage is positive, the higher two bytes of data become 0xffff, > the values are 0xffff8000 (for 0V) up to 0xffffffff (5V which is the maximum here). > It looks as if the higher two bytes get set to 0xffff whenever the voltage becomes positive. Sounds like a the lsampl_t value obtained from comedi_data_read() is somehow getting treated as a signed value that is then cast to a signed 32-bit value somewhere. Can you post a code snippet that shows how you're using comedi_data_read and the variable that gets the data. Thanks, Dave
Received on 2006-10-05Z16:42:02