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

I2C with PLL

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







I2C with PLL
PostPosted: Mon Nov 12, 2007 5:42 pm     Reply with quote

Hi, i'm using a PIC18F2550 with microchip usb bootloader, and some configuration bits are required. Two of them are HSPLL and PLL5. The problem is that i'm using a I2C comunication to a PIC16F88(slave), and without PLL5 and HSPLL (changed for HS), it work's fine, but with these CB's the master (PIC18F2550) always read 0XFF from slave. Please, if anyone can help me and tell me a possible reason for this problem i will be very gratefull.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Nov 12, 2007 5:55 pm     Reply with quote

1. Did you change the #use delay() statement to show the higher
oscillator frequency that exists when you use the PLL ?

2. Are you using hardware i2c, which is enabled with "FORCE_HW" in
the #use i2c statement ? If so, try using software i2c. Delete the
FORCE_HW parameter.
Alex
Guest







PostPosted: Mon Nov 12, 2007 6:27 pm     Reply with quote

PCM programer, thanks for the help, i'm not using the force_HW, and my CB's are:
#fuses HSPLL,NOWDT,USBDIV,PLL5,CPUDIV1,VREGEN,WRTB,NOPBADEN
with
#use delay(clock=20000000)
and i'm using a 20MHZ crystal.
is it rigth or i must change the clock for 48MHZ?
i don't no becouse a never used a PLL
thank you!! Laughing
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Nov 12, 2007 6:32 pm     Reply with quote

If you enable the PLL for 48 MHz operation, then you must change the
#use delay() statement to specify that frequency.

The compiler uses the value in the #use delay() statement to calculate all
the delays (both hardware and software) that it uses throughout the program.

See this post for an example of a 48 MHz PLL with a 20 MHz crystal.
http://www.ccsinfo.com/forum/viewtopic.php?t=29387&start=8
Alex
Guest







PostPosted: Mon Nov 12, 2007 7:00 pm     Reply with quote

PCM programmer, now the comunication is working fine.
Thank you very very very much! Laughing
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