Easyrider83
Advanced Member level 5
- Joined
- Oct 11, 2011
- Messages
- 1,608
- Helped
- 374
- Reputation
- 748
- Reaction score
- 364
- Trophy points
- 1,363
- Location
- Tallinn, Estonia
- Activity points
- 8,575
can anyone help me in selecting CPUDIV value from
CPUDIV are ,
Div/6 wPLL Div/4
Div/4 wPLL Div/3
Div/3 wPLL Div/2
Div/2 wPLL No div ? for 20MHZ crystal
is there any other option for using 20MHz crystal ?
is it a problem of burner ?After the 20MHz, you need to get 4MHz. Thus, requiring you to do a PLL/5. But, you dont have that. Please look t the datasheet on the oscillator diagram
is it a problem of burner ?
After the 20MHz, you need to get 4MHz. Thus, requiring you to do a PLL/5. But, you dont have that. Please look t the datasheet on the oscillator diagram
// Shane Tolmie of www.microchipC.com.
#include <pic18.h>
#if !defined(HI_TECH_C)
#error Incorrect compiler. PICC18 v8.35PL2 from www.htsoft.com required.
#endif
#if defined (_18F2550) || defined (_18F4550)
#define PIC_CLK 20000000 // MUST ATTACH an external 20Mhz crystal to PICC18F4550
#if PIC_CLK==20000000
// copied from 20Mhz settings on CDC sample project on www.microchip.com
// 20Mhz crystal
// CPU core runs at 48Mhz (with PLL), generating 12MIPS (million instructions/second)
__CONFIG(1,HSPLL & USBPLL & PLLDIV5 & CPUDIV1 & FCMDIS & IESODIS);
__CONFIG(2,VREGEN & PWRTDIS & BOREN & BORV20 & WDTDIS & WDTPS32K);
__CONFIG(3,CCP2RC1 & PBADDIS & LPT1DIS & MCLREN);
__CONFIG(4,STVREN & LVPDIS & ICPORT & XINSTDIS & DEBUGDIS);
__CONFIG(5,UNPROTECT);
__CONFIG(6,UNPROTECT);
__CONFIG(7,UNPROTECT);
#else
#error Incorrect crystal speed.
#endif
#else
#error Unknown microcontroller
#endif
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?