How to prevent ADC interrupt from affecting LCD display on AVR MCU?
I am working with an AVR MCU and have encountered an issue with an interrupt routine affecting my LCD display. Specifically, I have an analog potentiometer connected to an analog pin, and the interrupt associated with the ADC conversion seems to be interfering with the LCD_display method. I need to ensure that interrupts are paused while executing the LCD update code to avoid conflicts.
I used
Is there a better way to manage interrupt handling without affecting the LCD display? my code snippet is in the attached file.
I used
cli() to disable interrupts before updating the LCD and sei() to re-enable interrupts after the update is complete. This prevents the ADC interrupt from interfering with the LCD display operations.Is there a better way to manage interrupt handling without affecting the LCD display? my code snippet is in the attached file.

Solution
Hey man, If you want to effectively handle interrupts without impacting your LCD display, You could try a few things like ;
Using atomic blocks for critical sections management & making sure that the updates of your LCD screen happen in the main loop only by flagging them with an ADC interrupt.
I hope this helps @Dtynin
Using atomic blocks for critical sections management & making sure that the updates of your LCD screen happen in the main loop only by flagging them with an ADC interrupt.
I hope this helps @Dtynin