You can't have 2MHZ, it's going to be 1.66666MHZ or 2.5MHZ for that crystal speed
For 1.66666MHZ and a huge 5 bit resolution
PR2 = 4
T2CON = %00000100
CCPR1L =1
CCP1CON = %00101100
For 2.5MHZ and 5 bit resolution
PR2 = 1
T2CON = %00000100
CCPR1L =1
CCP1CON = %00001100
don't forget to set the TRISx bit.
If you really need 2MHZ, 40MHZ or 48MHZ crystal will work.




Bookmarks