Are you controlling the motor directly, if so, what is the required cycle time?
If you are not controlling the motor directly, but receiving the motor status and sending motor commands over the CAN bus, what is the required cycle time?
Writing to an EEPROM is always going to disrupt your cycle times unless you do it from a task that is not blocking the motor control interrupts and/or control task. If you can, do that using a DMA or other such low processor overhead mechanism.
Not direct. Motor thread uses PWM generated signals. PWM signal is about 24 KHz. So only timers generating PWM signals and such signals modulation mathematics directly influence cycle time. Any other delays will disrupt PWM signal timing. Howerver at each cycle I have additional structure checking for the data change.
So for this case It was used evetsbit to say if are data is changed and only in this case to read a new variable, for example to read a new speed value.
Yes EEPROM is a mountain comparing times needed for the motor control and writing to memory. So it’s is used only at beginning to read default values while nothng more is activated and to write data only after user push the GUI button. DMA is used from the begining.
Practically it’s working but time to crash variating from 20 min to 8 hours. Without data sharing, structure and with a fixed values it’s worked without crashes for a few times for a few days until I just power down it.