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.

Pll

Status
Not open for further replies.

AtomSoft

Well-Known Member
Hey guys need quick info but take your time. I mean i have a quick question.

from my datasheet:
Code:
2.5.1 HSPLL OSCILLATOR MODE
The HSPLL mode makes use of the HS Oscillator
mode for frequencies up to 10 MHz. A PLL then multiplies
the oscillator output frequency by 4 to produce an
internal clock frequency up to 40 MHz. The PLLEN bit
is not available in this oscillator mode.
The PLL is only available to the crystal oscillator when
the FOSC3:FOSC0 Configuration bits are programmed
for HSPLL mode (= 0110).

Does that mean i cant use my 20MHz crystall with PLL? Or does it mean i cant use the OSC = HSPLL with more than a 10MHz crystal?

Also if it means that i can still use OSC = HS and use a 20 Mhz clock. Can i use the PLL bits? So like a software PLL.
 
Also please note that you can use the 4xPLL along with the INTOSC on some devices like the 18F2620/18F4620. So the 8 MHz INTOSC can be used to produce a 32 MHz system clock. Very cool...

Mike
 
im asking is it possible to use it with a 20 Mhz clock. Im using it with the 8mhz internal but it seems to be very inaccurate. So i wanted to use a external clock/crystal and PLL but since i dont own a 10 mhz crystal i cant use the pll; so i guess it says i cant use more than 10mhz then. I guess i can use just a 20 mhz alone :D
 
Make sure you have adequate decoupling - 100nF across VSS+VDD as close to the PIC as possible. Possibly even a 100nF + 10nF just to be sure.

I've had some interesting things happen with inadequate decoupling at PLL speeds.
 
Im using the PIC18LF4620 and i have 2 .1uf on each side of the pic. Its on a breadboard. And i have a 10uf on the bus bar as close to the regulator as possible.
 
Im using the PIC18LF4620 and i have 2 .1uf on each side of the pic. Its on a breadboard. And i have a 10uf on the bus bar as close to the regulator as possible.

You can use HSPLL with up to a 10Mhz crystal for most PIC's (for 40Mhz operation/10MIPS)

Some PIC's can go up to 48Mhz (12MIPS)

The PIC18LF4620 is rated for up to 40Mhz, so to answer your question, use a 10Mhz instead (it simply up scales your crystal speed by 4)
 
im asking is it possible to use it with a 20 Mhz clock. Im using it with the 8mhz internal but it seems to be very inaccurate. So i wanted to use a external clock/crystal and PLL but since i dont own a 10 mhz crystal i cant use the pll; so i guess it says i cant use more than 10mhz then. I guess i can use just a 20 mhz alone :D

I missed that post :eek: What errors were you getting while using the internal osc?

Only asking because I have used it with decent UART speeds (which usually needs some sort of stability to do so) without any issues. Kinda makes me think it could be a power supply issue
 
hey gramo thanks for asking. Im using this for SD and i was trying to test different speeds and stuff. It the issue is that it works sometime with the intosc but i have to reset it all 1 or 2 times before it works. It works in debug mode so i know its not a connection/wiring issue. But it may just be a delay issue. But i doubt it. Im not sure if it was meant to use a osc under 40 mhz. Im refering to the SD code from microchip. Since i altered it to use a 8mhz intosc with pll.

Im starting to think its a delay issue and i just need to up the delay. I will try that first though. If you have any thoughts feel free to jump in.
 
The only 18F PICs that can use the PLL with a 20MHz crystal have USB. USB in the PIC runs at 96MHz internally. The bonus is those PICs can run at 12 MIPs
 
Well it might be that you are trying to talk to the card before it gets in to stable operation, or you could have a floating input pin(I had that one causing the sometimes wont start thing)


Also one thing that caused me a SD card problem is that i used a resistor and LED on the clock line to make a busy LED. It seamed to work perfectly when powered from the pickit 2. But when i powered it from a lab PSU it refused to recognize the card
 
wow guys thanks. I have been online reading on another subjet just re-read this topic and going to try to fix my delays. I dont have any status LEDs on the clock line but it does sound like it would have been a nice idea.

So ill be back soon with the results.
 
Someone Electro.... thanks i think this fixed it:

TRISA = TRISB = TRISC = TRISD = TRISE = 0x00;

Since my code sets these later in time i can set all to output as the first line of code after the OSC stabalize thing and it will be reset later on.

Code:
	OSCCON = 0x72;			//8MHz clock
	OSCTUNEbits.PLLEN=1;		//enable PLL so would be 32 MHz
	while(!OSCCONbits.IOFS);	//wait for osc stable
	
	TRISA = TRISB = TRISC = TRISD = TRISE = 0x00;
 
Well in my case it was a card detect pin that the microchips FAT lib uses but i forgot about it. Later on i just got rid of these inputs in the code.

Yeah the clock line LED was pretty useful since i knew exactly when the PIC is accessing the card.

Oh and also note if you are using a 3.3V supply (Like i did to get rid of level shifting) You cant clock the PIC to the max MIPS anymore. 5V PICs can do somewhere half its max MIPS when on 3.3V. Trying full speed can cause some strange problems. (i found my dsPIC freeze completely at its rated 120Mhz on 3.3V)

I find my self going 3.3V quite often because of special non 5V tolerant ICs. I almost always rather make the entire supply lower than do some extra regulators and level shifting and that stuff.
 
Just clock your 18F under 20Mhz and you should be fine. If you need speed you can get a 33F, It will do 40 MIPS at 3.3V or if you realy need speed you can use a PIC32 to get 80MIPS at 3.3V
 
Status
Not open for further replies.

Latest threads

Back
Top