There is pwm:
TCCR1A = 0; TCCR1B = 0; ICR1 = PWM_PERIOD; TCCR1A = (1 << WGM11); TCCR1B = (1 << WGM13) | (1 << WGM12) | (1 << CS10); tccrOff = TCCR1A; TCCR1A |= (1 << COM1A1); tccrOn = TCCR1A; OCR1A = PWM_PULSE_DEFAULT; There is a port management function output (); and the time module DS1307 ( DS1307RTC.h library is used ).
Chip atmega328p, quartz at 8 MHz.
It is necessary to run the output () function continuously in the program loop to display data on the display.
The problem is that when output () is in the program loop, then when polling the time module, flicker and voltage drawdown occur at the time of the poll. How can the output () function be run in the background from the main program loop and not control other pins (since the function itself controls pins through the ports), for example, through a timer?