|
|
View previous topic :: View next topic |
Author |
Message |
javabear
Joined: 22 Feb 2004 Posts: 1
|
i2c 24c256 ex_extee.c setup_spi(FALSE) |
Posted: Sun Feb 22, 2004 11:13 pm |
|
|
Hi,
[frank@picard frank]$ ccsc +v
PCM compiler version 3.168 (linux, RH9)
I was running some test code from PCM programmer 24lc256.c
on a pic16f876 and 24c256 eeprom via i2c.
All is well, thanks for the example code.
Now the strange part (or maybe I am tired).
if i run ex_extee.c, reads and writes do not work
reads return 0xff and writes hang.
however if I add 1 extra line after init_ext_eeprom
init_ext_eeprom(); <-- existing line, no change
setup_spi(FALSE); // added by me - program now works ... aaarrgh !!!!!!
then it all works.
I have read some discussions about using setup_spi(FALSE); so
now I am confused.
Has anyone else seen this ??
Thanks |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Feb 23, 2004 12:34 am |
|
|
Quote: | if i run ex_extee.c, reads and writes do not work
reads return 0xff and writes hang. |
I'm not familiar with the Linux version, but here are my thoughts:
I assume that you have edited the EX_EXTEE.C file, to #include
the CCS driver file, 24256.C.
I assume that you are using pins C4 and C3 for SDA and SCL.
So, in the EX_EXTEE.C file, place the following lines above the
line for #include <24256.c>
#define EEPROM_SDA PIN_C4
#define EEPROM_SCL PIN_C3
Example:
Code: | #define EEPROM_SDA PIN_C4
#define EEPROM_SCL PIN_C3
#include <24256.c> |
See if that makes a difference. |
|
|
Guest
|
|
Posted: Mon Feb 23, 2004 9:22 pm |
|
|
PCM programmer wrote: | Quote: | if i run ex_extee.c, reads and writes do not work
reads return 0xff and writes hang. |
I'm not familiar with the Linux version, but here are my thoughts:
I assume that you have edited the EX_EXTEE.C file, to #include
the CCS driver file, 24256.C.
I assume that you are using pins C4 and C3 for SDA and SCL.
So, in the EX_EXTEE.C file, place the following lines above the
line for #include <24256.c>
#define EEPROM_SDA PIN_C4
#define EEPROM_SCL PIN_C3
Example:
Code: | #define EEPROM_SDA PIN_C4
#define EEPROM_SCL PIN_C3
#include <24256.c> |
See if that makes a difference. |
Yep, I had previously tried as you have mentioned. I know the pins are ok as
the code works once I add setup_spi(FALSE); Hmm thanks anyway.
The only thing I can think of is that perhaps the latest Linux CCSC release is
3.168 while the latest windows version is 3.185 and maybe there are some
bug fixes I am missing. I have enquired about the difference to CCS but no
answer thus far.
Cheers / Frank |
|
|
|
|
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
|