Hi Nordic,
We are migrating an older mesh project from nrfSDK 17 to zephyr and have a question about what is the BEST way to have a continuous I2C process running in zephyr. The application has 3 mesh models, uses 2 PWM modules, ADC reads every roughly every 3 seconds, and TWIM reads 100 times per second.
In the old codebase the I2C sensor is read with the TWIM triggered over a PPI channel connected to a timer. We need to read data at least 100 times per second. Each read is followed by some processing and based on the data events are generated and passed over to other parts of the application. This all works well.
For our zephyr projects we have yet to use a timer in any of them. We use delayable work and submit to the system workqueue recursively for repeated tasks at a cadence.
My question is should we submit work to the system workqueue at a rate of 100/second or is there a better way to do this? Would it be less intrusive to the other parts of the application to create a dedicated workqueue (and thus its own thread) for this process alone? Or would a simple timer trigger be best to avoid the hardware effort of supporting another queue?
If there is some other way that would be best suited for this application to run smooth we would like to hear it. Looking forward to suggestions!