Hello and welcome to the fora, Aliester,
In order to help you with this we would need to know what clock you are using.
Do you have an external oscillator or crystal or are you using the internal clock.
If you are using the internal clock, are you trimming it properly.
Download AN2494 from this site as it will help you greatly with this setup.
It is an interactive spreadsheet that helps with all the clock setup.