i have 8 external DACs MCP4728 which i'm communicating with using i2c. The data is coming directly from a USB cable (16-17ms) and i need to update/write those values as soon as i can. Right now i'm writing to the i2c inside the USB callback function.
Normally i see code (not DAC related) where a flag is set and then in the main loop, since the flag to update is true, something is perfomed (in this case the DACs should be set).
Can the implementation be the source of those spikes (which tipically are present only with high frequency values) ? Can bit-skew be the problem with 17ms of updating time ?