Driver: high rate timer interruption

Hello,
I’d like to code a driver for the HX711 force sensor. This hardware uses a two wire custom serial protocol, refer to the image below. T3, the high time of the clock pulse should be smaller than 50us. Otherwise at 60us this commands a reset of the sensor.

I tried to generate the clock with hrt_call_every(&_high_rate_interrupt, 0, 30, &HX711::high_rate_interrupt_routine, this); which is supposed to interrupt it every 30us. The average works but the maximum goes above the limit of 50us. I put a perf in the interrupt routine which gives me 39764 events 30.00us avg, min 1us, max 81us, 25.442us rms. (The driver is running on the work_queue hp_default at 1kHz).

[edit] I also tried to run the driver on px4::wq_configurations::rate_ctrl which has the highest priority, but it didn’t change the problem.

@dagar Is there another way to generate a hard(er) time interrupt in PX4/Nuttx?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.