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

External 24C128 EEPROM

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







External 24C128 EEPROM
PostPosted: Fri Feb 28, 2003 5:50 am     Reply with quote

I am tring to use an ST M24128 (supplier (farnell) calls it 24C128) external eeprom chip with the 24128.c driver. But the chip will not initialise. I am not an expert user and was hoping to able to use this driver instead of writing my own code. Has anybody else encountered (and fixed) this problem?
Or does anyone have any suggestions as to mistakes i may have made.
Thanks
Chris
___________________________
This message was ported from CCS's old forum
Original Post ID: 12209
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: External 24C128 EEPROM
PostPosted: Fri Feb 28, 2003 1:22 pm     Reply with quote

:=I am tring to use an ST M24128 (supplier (farnell) calls it 24C128) external eeprom chip with the 24128.c driver. But the chip will not initialise. I am not an expert user and was hoping to able to use this driver instead of writing my own code. Has anybody else encountered (and fixed) this problem?
:=Or does anyone have any suggestions as to mistakes i may have made.
---------------------------------------------------------

I suggest you use the 24256.C driver instead.
I have looked at the data sheet for the M24128, and it
looks like the 24256.C sample driver should work OK.

The 24128.C driver is for some non-standard EEPROM.
I don't know why CCS gives out that file, without
identifying the special chip that it works for.
___________________________
This message was ported from CCS's old forum
Original Post ID: 12230
chris_1982
Guest







Re: External 24C128 EEPROM
PostPosted: Fri Feb 28, 2003 1:45 pm     Reply with quote

<font face="Courier New" size=-1>:=:=I am tring to use an ST M24128 (supplier (farnell) calls it 24C128) external eeprom chip with the 24128.c driver. But the chip will not initialise. I am not an expert user and was hoping to able to use this driver instead of writing my own code. Has anybody else encountered (and fixed) this problem?
:=:=Or does anyone have any suggestions as to mistakes i may have made.
:=---------------------------------------------------------
:=
:=I suggest you use the 24256.C driver instead.
:=I have looked at the data sheet for the M24128, and it
:=looks like the 24256.C sample driver should work OK.
:=
:=The 24128.C driver is for some non-standard EEPROM.
:=I don't know why CCS gives out that file, without
:=identifying the special chip that it works for.

I have just tried the 24256 driver and the initialisation appears to work ( in that the PIC goes past that part of the code before stopping) but the read and write functions do not work</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 12232
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: External 24C128 EEPROM
PostPosted: Fri Feb 28, 2003 2:11 pm     Reply with quote

:=I have just tried the 24256 driver and the initialisation appears to work ( in that the PIC goes past that part of the code before stopping) but the read and write functions do not work

-------------------------------------------------------------

1. What's the exact part number of your EEPROM ?
The M24128-B comes in 5 different versions, etc.

2. What PIC are you using ?

3. What voltage are you using for the PIC (+5v, +3.3v, or ?)

4. Do you have pull-up resistors on the SDA and SCL signals ?
You could use 2.2K or 4.7K resistors, connected to Vcc.

5. What version of the CCS compiler do you have ?
Is it PCM or PCH ?

6. On the EEPROM, if you have the version that has "chip enable"
pins, then what voltage levels do you have these pins
connected to ? (GND, Vcc, or un-connected ?)

7. What do you have connected to the \WC pin on the EEPROM?

8. Are you using ICD ?

9. Do you have proper connections to Vcc and GND, for both
the PIC and the EEPROM. (Especially, a common GND between
the two chips.)

10. Is this your very first project, or have you made other
projects work first, such as blinking a LED, etc. ?
If you're using ICD, have you made these other projects
work successfully with the ICD ?



___________________________
This message was ported from CCS's old forum
Original Post ID: 12233
chris_1982
Guest







Re: External 24C128 EEPROM
PostPosted: Fri Feb 28, 2003 4:31 pm     Reply with quote

:=:=I have just tried the 24256 driver and the initialisation appears to work ( in that the PIC goes past that part of the code before stopping) but the read and write functions do not work
:=
:=-------------------------------------------------------------
:=
:=1. What's the exact part number of your EEPROM ?
:= The M24128-B comes in 5 different versions, etc.
:=
:=2. What PIC are you using ?
:=
:=3. What voltage are you using for the PIC (+5v, +3.3v, or ?)
:=
:=4. Do you have pull-up resistors on the SDA and SCL signals ?
:= You could use 2.2K or 4.7K resistors, connected to Vcc.
:=
:=5. What version of the CCS compiler do you have ?
:= Is it PCM or PCH ?
:=
:=6. On the EEPROM, if you have the version that has "chip enable"
:= pins, then what voltage levels do you have these pins
:= connected to ? (GND, Vcc, or un-connected ?)
:=
:=7. What do you have connected to the \WC pin on the EEPROM?
:=
:=8. Are you using ICD ?
:=
:=9. Do you have proper connections to Vcc and GND, for both
:= the PIC and the EEPROM. (Especially, a common GND between
:= the two chips.)
:=
:=10. Is this your very first project, or have you made other
:= projects work first, such as blinking a LED, etc. ?
:= If you're using ICD, have you made these other projects
:= work successfully with the ICD ?
:=
:=
:=

Thank you for your help here are the answers to your questions

1 The eeprom i ordered is the M24128-BN6

2 I am using A PIC16F877

3 Im using a +5V supply

4 I am not entirely sure on the meaning of pull up resistor but i have a 10k ohm resistor in series with SDA

5 Im using the PCM version

6 These pins are unconnected on my circuit and are marked as unconnected on the datasheet

7 The WC pin is unconnected the datasheet says that this will internally be set to allow writes

8 My programmer allows ICD but im am not currently using this option.

9 The ground is common and the supply voltages are correct (both +5V)

10 This is not my 1st project i have made other project both with and without the use of the ICD but most of these projects have been written in assembly i have only made a few in C but all have worked ok.
___________________________
This message was ported from CCS's old forum
Original Post ID: 12241
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: External 24C128 EEPROM
PostPosted: Fri Feb 28, 2003 5:20 pm     Reply with quote

:=:=
:=
:=Thank you for your help here are the answers to your questions
:=
:=1 The eeprom i ordered is the M24128-BN6
:=
:=2 I am using A PIC16F877
:=
:=3 Im using a +5V supply
:=
:=4 I am not entirely sure on the meaning of pull up resistor but i have a 10k ohm resistor in series with SDA

That's not correct. You need a pull-up resistor on SDA
and SCL. The resistors should be connected as shown
in this schematic:
<a href="http://www.High-TechGarage.com/images/i2c_sch.gif" TARGET="_blank">http://www.High-TechGarage.com/images/i2c_sch.gif</a>

:=
:=5 Im using the PCM version

But what is the exact version number ? ie., 3.146 ?

:=
:=6 These pins are unconnected on my circuit and are marked as unconnected on the datasheet

If you really have the M24128-BN6 chip, then I don't think
you have the correct data sheet. Here's the data sheet:
<a href="http://www.st.com/stonline/books/pdf/docs/6485.pdf" TARGET="_blank">http://www.st.com/stonline/books/pdf/docs/6485.pdf</a>
It shows that there are 3 chip enable lines. It states on
page 3, that they must be connected to Vcc or GND.
In your case, you should connect them to GND.

:=
:=7 The WC pin is unconnected the datasheet says that this will internally be set to allow writes
:=
:=8 My programmer allows ICD but im am not currently using this option.
:=
:=9 The ground is common and the supply voltages are correct (both +5V)
:=
:=10 This is not my 1st project i have made other project both with and without the use of the ICD but most of these projects have been written in assembly i have only made a few in C but all have worked ok.
___________________________
This message was ported from CCS's old forum
Original Post ID: 12242
chris_1982
Guest







Re: External 24C128 EEPROM
PostPosted: Sat Mar 01, 2003 4:59 am     Reply with quote

:=:=:=
:=:=
:=:=Thank you for your help here are the answers to your questions
:=:=
:=:=1 The eeprom i ordered is the M24128-BN6
:=:=
:=:=2 I am using A PIC16F877
:=:=
:=:=3 Im using a +5V supply
:=:=
:=:=4 I am not entirely sure on the meaning of pull up resistor but i have a 10k ohm resistor in series with SDA
:=
:=That's not correct. You need a pull-up resistor on SDA
:=and SCL. The resistors should be connected as shown
:=in this schematic:
:= <a href="http://www.High-TechGarage.com/images/i2c_sch.gif" TARGET="_blank"> <a href="http://www.High-TechGarage.com/images/i2c_sch.gif" TARGET="_blank">http://www.High-TechGarage.com/images/i2c_sch.gif</a></a>
:=
:=:=
:=:=5 Im using the PCM version
:=
:=But what is the exact version number ? ie., 3.146 ?
:=
:=:=
:=:=6 These pins are unconnected on my circuit and are marked as unconnected on the datasheet
:=
:=If you really have the M24128-BN6 chip, then I don't think
:=you have the correct data sheet. Here's the data sheet:
:= <a href="http://www.st.com/stonline/books/pdf/docs/6485.pdf" TARGET="_blank"> <a href="http://www.st.com/stonline/books/pdf/docs/6485.pdf" TARGET="_blank">http://www.st.com/stonline/books/pdf/docs/6485.pdf</a></a>
:=It shows that there are 3 chip enable lines. It states on
:=page 3, that they must be connected to Vcc or GND.
:=In your case, you should connect them to GND.
:=
:=:=
:=:=7 The WC pin is unconnected the datasheet says that this will internally be set to allow writes
:=:=
:=:=8 My programmer allows ICD but im am not currently using this option.
:=:=
:=:=9 The ground is common and the supply voltages are correct (both +5V)
:=:=
:=:=10 This is not my 1st project i have made other project both with and without the use of the ICD but most of these projects have been written in assembly i have only made a few in C but all have worked ok.


The EEPROM i have is a M24128-BN6 ie M24128 pdip8 normal temp range the datasheet is <a href="http://us.st.com/stonline/books/pdf/docs/4688.pdf" TARGET="_blank">http://us.st.com/stonline/books/pdf/docs/4688.pdf</a>

The compiler i have is PCM 3.023

I have looked at the schematic and the data sheet the datasheet has capacitors between the bus and ground. If i use a 4k7 resistor i will need a 68pF capicitor as well?
___________________________
This message was ported from CCS's old forum
Original Post ID: 12252
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: External 24C128 EEPROM
PostPosted: Sat Mar 01, 2003 1:30 pm     Reply with quote

:=The EEPROM i have is a M24128-BN6 ie M24128 pdip8 normal temp range the datasheet is <a href="http://us.st.com/stonline/books/pdf/docs/4688.pdf" TARGET="_blank"> <a href="http://us.st.com/stonline/books/pdf/docs/4688.pdf" TARGET="_blank">http://us.st.com/stonline/books/pdf/docs/4688.pdf</a></a>
:=
:=The compiler i have is PCM 3.023
:=
:=I have looked at the schematic and the data sheet the datasheet has capacitors between the bus and ground. If i use a 4k7 resistor i will need a 68pF capicitor as well?
-----------------------------------------------------------

I think you're correct on the data sheet. That is the
correct data sheet for a M24128-BN6. (If you had the chip
that has 3 chip-enable lines, then it would be a "-BBN6").

------
The version of the compiler could be a source of problems.
Version 3.xxx was basically released as a Beta product for
several weeks. The users were the Beta testers (unknowingly,
until they figured it out). It probably didn't get out of
"Beta" (meaning excessingly buggy) until version 3.045,
or 3.068, or maybe a lot later ? You should write very
simple code with that version, and hope it works. Don't try
using hardware i2c. Hope that CCS had the software i2c
working with vs. 3.023. I don't even have records for the
Beta versions. So I can't tell you if there was a problem
for sure. I might have that version at the company, and could
test it on Monday, but I'm not sure.

-------
Regarding the schematic in the EEPROM data sheet:

In that schematic, the "Cbus capacitors" symbolize capacitance
that's inherent in the circuit. It doesn't represent capacitors
that you're supposed to add. So don't add any.

The bus capacitance in an i2c circuit is mainly due to the
"input capacitance" of the i2c chips. For example, in Table 8
of the M24128 data sheet, it gives the Cin (input capacitance)
of the SDA pin as 8 pf max. For the SCL pin, it's 6 pf max.

So, suppose you had 8 of these EEPROM chips on one i2c bus.
(Note: You can't do this with your version of the chip, because
it doesn't have the 3 chip-enable pins).
Then multiply 8 chips x 8 pf each, which gives 64 pf. Add a
few more pf for the output capacitance of the PIC pin that's
driving SDA, and maybe a few more pf for stray capacitance.
So you might have 70 pf (max) if you used 8 EEPROMS on one
i2c bus. That's the "Cbus" that they're talking about.

Then you can refer to their graph in Figure 3, and see the
maximum value of pull-up resistor that you can use. For
example, at 400 KHz, with 70 pf, you should use a resistor
no larger in value than 4K. For 100 pf, the largest resistor
value can be 14K.

But this is really a non-issue in most designs. The only
reason you would want to use the largest possible resistor
is if you have a low-power design, and your primary concern
is conserving the battery.

Probably, most embedded applications only use the EEPROM for
a short interval, compared to the overall time that they're
running. So using the maximum sized pull-up resistor is
basically a non-issue. It's much better to go for signal
integrity. With just one EEPROM, using 4.7K pullups would
work just fine. So do that, and don't add any capacitors.
___________________________
This message was ported from CCS's old forum
Original Post ID: 12258
chris_1982
Guest







Re: External 24C128 EEPROM
PostPosted: Mon Mar 03, 2003 7:10 am     Reply with quote

:=:=The EEPROM i have is a M24128-BN6 ie M24128 pdip8 normal temp range the datasheet is <a href="http://us.st.com/stonline/books/pdf/docs/4688.pdf" TARGET="_blank"> <a href="http://us.st.com/stonline/books/pdf/docs/4688.pdf" TARGET="_blank"> <a href="http://us.st.com/stonline/books/pdf/docs/4688.pdf" TARGET="_blank">http://us.st.com/stonline/books/pdf/docs/4688.pdf</a></a></a>
:=:=
:=:=The compiler i have is PCM 3.023
:=:=
:=:=I have looked at the schematic and the data sheet the datasheet has capacitors between the bus and ground. If i use a 4k7 resistor i will need a 68pF capicitor as well?
:=-----------------------------------------------------------
:=
:=I think you're correct on the data sheet. That is the
:=correct data sheet for a M24128-BN6. (If you had the chip
:=that has 3 chip-enable lines, then it would be a "-BBN6").
:=
:=------
:=The version of the compiler could be a source of problems.
:=Version 3.xxx was basically released as a Beta product for
:=several weeks. The users were the Beta testers (unknowingly,
:=until they figured it out). It probably didn't get out of
:="Beta" (meaning excessingly buggy) until version 3.045,
:=or 3.068, or maybe a lot later ? You should write very
:=simple code with that version, and hope it works. Don't try
:=using hardware i2c. Hope that CCS had the software i2c
:=working with vs. 3.023. I don't even have records for the
:=Beta versions. So I can't tell you if there was a problem
:=for sure. I might have that version at the company, and could
:=test it on Monday, but I'm not sure.
:=
:=-------
:=Regarding the schematic in the EEPROM data sheet:
:=
:=In that schematic, the "Cbus capacitors" symbolize capacitance
:=that's inherent in the circuit. It doesn't represent capacitors
:=that you're supposed to add. So don't add any.
:=
:=The bus capacitance in an i2c circuit is mainly due to the
:="input capacitance" of the i2c chips. For example, in Table 8
:=of the M24128 data sheet, it gives the Cin (input capacitance)
:=of the SDA pin as 8 pf max. For the SCL pin, it's 6 pf max.
:=
:=So, suppose you had 8 of these EEPROM chips on one i2c bus.
:=(Note: You can't do this with your version of the chip, because
:=it doesn't have the 3 chip-enable pins).
:=Then multiply 8 chips x 8 pf each, which gives 64 pf. Add a
:=few more pf for the output capacitance of the PIC pin that's
:=driving SDA, and maybe a few more pf for stray capacitance.
:=So you might have 70 pf (max) if you used 8 EEPROMS on one
:=i2c bus. That's the "Cbus" that they're talking about.
:=
:=Then you can refer to their graph in Figure 3, and see the
:=maximum value of pull-up resistor that you can use. For
:=example, at 400 KHz, with 70 pf, you should use a resistor
:=no larger in value than 4K. For 100 pf, the largest resistor
:=value can be 14K.
:=
:=But this is really a non-issue in most designs. The only
:=reason you would want to use the largest possible resistor
:=is if you have a low-power design, and your primary concern
:=is conserving the battery.
:=
:=Probably, most embedded applications only use the EEPROM for
:=a short interval, compared to the overall time that they're
:=running. So using the maximum sized pull-up resistor is
:=basically a non-issue. It's much better to go for signal
:=integrity. With just one EEPROM, using 4.7K pullups would
:=work just fine. So do that, and don't add any capacitors.



Thank you I now have my EEPROM now works. Once i put the pull up resistors in it started to work.

thanks again chris
___________________________
This message was ported from CCS's old forum
Original Post ID: 12304
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