View previous topic :: View next topic |
Author |
Message |
Alex Guest
|
I2C with PLL |
Posted: Mon Nov 12, 2007 5:42 pm |
|
|
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
|
|
Posted: Mon Nov 12, 2007 5:55 pm |
|
|
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
|
|
Posted: Mon Nov 12, 2007 6:27 pm |
|
|
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!! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Nov 12, 2007 6:32 pm |
|
|
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
|
|
Posted: Mon Nov 12, 2007 7:00 pm |
|
|
PCM programmer, now the comunication is working fine.
Thank you very very very much! |
|
|
|