update timer and adc