Yes the maximum is 40Mhz. The PIC can run from DC (Static!) to 40Mhz. But you can only use 20Mhz crystal (maximum), for higher frequencies you need to use 10Mhz crystal and 4x on-chip PLL to get 40Mhz or use External clock source.
The Fosc is definitely 20MHz. You can't use HS+PLL mode because frequency is too high. If you connect a 10MHz crystal or use a 10MHz oscillator and enable the HS+PLL mode, then Fosc=40MHz.
Jay.slovak said:
Yes the maximum is 40Mhz. The PIC can run from DC (Static!) to 40Mhz. But you can only use 20Mhz crystal (maximum), for higher frequencies you need to use 10Mhz crystal and 4x on-chip PLL to get 40Mhz or use External clock source.
And it is interesting to know(from the datasheet) that in case of 4xPLL mode using the PIC's on chip oscillator, one can't use a crystal of lower than 4MHz. So one can use only crystals with frequency between 4 MHz and 10MHz. At +85C or higher, the max freq. limit even drops to 6.25MHz.