AnsweredAssumed Answered

Adis16480 linux driver read_delay and write_delay

Question asked by Timur on May 25, 2016
Latest reply on May 25, 2016 by larsc


I have adis16480 IMU connected to Raspberry Pi 2. SPI frequency is set up to 10 MHz, number of samples per second is 1230. Everything was fine except for CPU usage to be 70%-100%. The samples from IMU were not skipped. This has changed once I had run some computations on CPU in parallel. Some samples were lost occasionally, one at a time, like SPI speed is not sufficient or something. Investigating the issue I've found there are delays in SPI reading and writing in adis16480 driver - read_delay and write_delay in adis16480.c adis16480_data struct. These numbers are microseconds to delay between SPI transfers and they slow down the transfers and increase CPU usage. I've not found any mentions of delays that must be used when reading or writing to adis16480 registers in data sheet, but maybe these mentions are not straightforward.

Setting read_delay and write_delay to zero fixed my problem - no more samples lost on CPU loaded and only about 40% of CPU usage reading data from IMU with no other tasks on CPU.

The question is - is it safe to set this device properties to zero?

If yes, if this can be pushed to mainline Linux kernel?