2025-02-23 11:39 PM
I am using an ESP32S3 as an I2C master and an STM32G0 as an I2C slave. The STM32G0 is performing two tasks:
Whenever the STM32G0 processes an I2C interrupt, it misses a ZCD interrupt, causing a visible jerk in the dimming process. This likely happens because the I2C interrupt temporarily blocks the ZCD interrupt, leading to skipped TRIAC triggering.
ESP32S3 (I2C Master):
STM32G0 (I2C Slave + Dimmer Control):
Github link for dimmer control example : https://github.com/RobotDynOfficial/RBDDimmer/blob/master/examples/SimpleToggleDimmer/SimpleToggleDimmer.ino
NOTE: The code has been ported from Arduino library to STM32 Cube IDE to control dimmer.
Any kind of help or suggestions is appreciated .
2025-03-05 2:56 AM
Hello everyone !!!
Is there anyone who can help me out with this , as I am stuck here . I have not got any reply from anyone out there . If there is anyone out there , who can help me out , will be appreciated .
Thank you in advance .
Regards
Rahil
2025-04-02 3:25 AM
Hello,
@RAHIL wrote:
Attempted Solutions
- Increased ZCD interrupt priority above I2C interrupt.
- Implemented DMA for I2C transactions.
You didn't tell what are your findings with the attempted solution? if you decrease the timer interrupt rate do you have the same behavior?
How did you increase the priority? the value needs to be lower for the timer interrupt.
It could be also due to the high interrupt rate that the CPU could not handle. Set a toggling GPIO on I2C and timer interrupt and check what happens with an oscilloscope or a logic analyzer.
Try also to set the system clock at its maximum (64MHz?) if it was not the case.