Please I need your support on how to sort out this problem.I am clocking Attiny4313 with an External Crystal Clock(7.3728MHz ).The USART of the Microcontroller is used to received data from the Computer through a USB port.I have on the Computer a Grahpic User Interface which has Buttons and Sliders.The buttons turn the Leds ON and OFF while the Sliders control Leds brightness.
The ON and OFF of the Leds by the Buttons are working perfectly however I get error when using the Sliders to control the brightness.If I move the Slider slowly(one step at a time),everything works fine.However if I move the Slider very fast,then I get error.The error looks like this.If the Graphic User Interface shows say 70%,the Oscilloscope will show 13.2%,then if I move the Slider again slowly,the brightness(represented in percentage)on the Oscilloscope and the Grahpic Interface will be equal.If the Slider is moved very fast again,the error reappears.This time around the Graphic Interface can show say 50% but the oscilloscope will still show 13.2%.This 13.2% is what the oscilloscope always show whenever there is an error no matter what the Graphic User Interface shows(20%/40%/60%).
My assumption is that the USART of the microcontroller is not fast enough to process the DATA it receives from the Computer.If this assumption is correct,then is it possible to solve this problem by replacing the 7.3728MHz crystal with a 16MHz crystal.
I will highly appreciate your advice and idea in this regards.Once again thank you for the support.
Firstoption