Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

18LF2520 Crystal

Status
Not open for further replies.

camerart

Well-Known Member
Hi,
Looking at the Data sheet for 18LF2520 PIC, it shows the highest speed crystal as 25MHz. I only have 32MHz, will they work ok?
Camerart.
 
I don't think so.... The max speed of this is 40Mhz but 10Mhz (4x) PLL.. So 32Mhz should only be an 8 Mhz crystal with the PLL..

I don't think a 32Mhz crystal would stabilize.... This is just in my opinion...
 
I don't think so.... The max speed of this is 40Mhz but 10Mhz (4x) PLL.. So 32Mhz should only be an 8 Mhz crystal with the PLL..

I don't think a 32Mhz crystal would stabilize.... This is just in my opinion...
Hi R,
Ok, that's a shame. Anyone want 20x32MHz crystals? :)
C.
 
Hi,
On re-reading the Data sheet, I think the PIC will work without a crystal.

I've tried setting OSCCON and PLL, but 18LF2520 does appear to be running correctly. Can anyone supple the OSCCON and PLL settings for 8MHz and X4 please.
C
 
You need to set OSCCON to 0x70 ( 8Mhz) and set the PLL bit in the config register.. I think there is a software bit aswell.

So config FOSC= INTIO2 and PLLEN = 1

Then OSCON = 0x70
Then OSCTUNE bit 6 needs to be 1.
 
Hi I,
I think I've got it set correctly, but it's too fast.

Can you try it in the simulator please. The SIM is a bit faster than the PCB, but still shows too fast.

There is no INTIO1 and 2 option. I used this:

Thanks, C.
 

Attachments

  • INTOSC.jpg
    INTOSC.jpg
    181 KB · Views: 167
  • 18LF2520 8MHz 2XPIC SERVO X6 010918 0830.bas
    3.3 KB · Views: 167
Hi I,
I think I've got it set correctly, but it's too fast.

Can you try it in the simulator please. The SIM is a bit faster than the PCB, but still shows too fast.

There is no INTIO1 and 2 option. I used this:

Thanks, C.
What is too fast?
Waitus 1000?
Define clock_frequency 8 -> change to 32
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top