View previous topic :: View next topic |
Author |
Message |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Jun 07, 2006 7:16 pm |
|
|
Quote: | I can't understand, why PLL is not working..... |
The 18F24J10 data sheet says in section 2.4 that:
Quote: | The PLL is enabled by setting the PLLEN in the OSCTUNE register. |
However, the data sheet doesn't give the address of the OSCTUNE
register. So if you look in the P18F24J10.inc file, which is in this folder,
c:\Program Files\Microchip\MPASM Suite, then you find the address
is 0xF9B. Then you can set the PLLEN bit with this code:
Code: |
#byte OSCTUNE = 0xF9B
#bit PLLEN = OSCTUNE.6
void main()
{
PLLEN = 1; // Enable PLL
while(1);
} |
|
|
|
prayami
Joined: 22 Dec 2004 Posts: 78
|
|
Posted: Wed Jun 07, 2006 7:22 pm |
|
|
Thats exellent Mark and PCM programmer. Thank you very much.
That works ...
I didn't know that for software controlled PLL require to enable PLL
like this in the program. I thought that, it is all included in the
configuration bits. As first time I come accross this kind of thing.
I was worried that address of OSCTUNE is not there in datasheet but
PCM programmer clear the doubt.
Thanks again.... |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Wed Jun 07, 2006 8:33 pm |
|
|
PCM programmer wrote: | Quote: | I can't understand, why PLL is not working..... |
The 18F24J10 data sheet says in section 2.4 that:
Quote: | The PLL is enabled by setting the PLLEN in the OSCTUNE register. |
However, the data sheet doesn't give the address of the OSCTUNE
register. So if you look in the P18F24J10.inc file, which is in this folder,
c:\Program Files\Microchip\MPASM Suite, then you find the address
is 0xF9B. Then you can set the PLLEN bit with this code:
Code: |
#byte OSCTUNE = 0xF9B
#bit PLLEN = OSCTUNE.6
void main()
{
PLLEN = 1; // Enable PLL
while(1);
} |
|
That's where I had to find it |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Wed Jun 07, 2006 8:34 pm |
|
|
prayami wrote: | Thats exellent Mark and PCM programmer. Thank you very much.
That works ...
I didn't know that for software controlled PLL require to enable PLL
like this in the program. I thought that, it is all included in the
configuration bits. As first time I come accross this kind of thing.
I was worried that address of OSCTUNE is not there in datasheet but
PCM programmer clear the doubt.
Thanks again.... |
I've never used that PIC either. However you mentioned "software PLL" so I read the datasheet to answer your question. Point, read the datasheet! |
|
|
|