CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Not correct delay with delay_ms

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jun 07, 2006 7:16 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jun 07, 2006 7:22 pm     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Wed Jun 07, 2006 8:33 pm     Reply with quote

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 Smile
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Wed Jun 07, 2006 8:34 pm     Reply with quote

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!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group