gnupic: PIC driving an 24LC256...


Previous by date: 19 Sep 2001 21:37:35 -0000 Re: Progress with output logging, John Sutton
Next by date: 19 Sep 2001 21:37:35 -0000 Re: gpsim: TMR0 has 3 nibbles?, Manolis Giannos
Previous in thread:
Next in thread:

Subject: PIC driving an 24LC256...
From: ####@####.#### (Rogier Wolff)
Date: 19 Sep 2001 21:37:35 -0000
Message-Id: <200109192137.XAA00395@cave.bitwizard.nl>

Hi Guys, 

I was wondering if one of you could drop a quick look at my project.

I'm trying to drive an 24LC256 (256kbit eeprom) from a PIC 16F873 .

The problem is that when I try to read back the data from the eeprom,
it seems as if the eeprom is WAY late in starting to drive the data
line.

To write to the eeprom:

S 1 0 1 0 0 0 0 0 A 0 0 0 1 0 0 1 0 A 0 0 1 1 0 1 0 0 A 1 1 1 1 1 1 0 0 A S
T                 C                 C                 C                 C T
A                 K                 K                 K                 K O
R                                                                         P
T    A       0         1       2         3       4         F       C


I get "acks" at the right time, and so forth. All seems well.

However, when I try to read from this same location, I see the 
EEPROM take control of the data line WAY too late. 

We've tied a weak "pull-to-the-middle" on the data line so that we can
see when it's undriven.

The plot of the "read" is at

	http://www.bitwizard.nl/sdata.04.gif

and the postscript version is at: 

	http://www.bitwizard.nl/sdata.04.ps

If you want to make the plots yourself, the datafile is at: 

	http://www.bitwizard.nl/sdata001.gnuplot

and the gnuplot command (to get the area that shows me trying to read
the EEPROM) is:

  plot [12300:13900] [20:130]  'sdata001.gnuplot' using 1  title 'SDA' w l, 'sdata001.gnuplot' using 2 title 'SCL' w l

So, my question is: Can someone who has experience with those i2c
EEPROMs take a quick look at my waveforms to tell me what I'm doing
wrong?

The datasheet for the 24lc256 is at:

	http://www.bitwizard.nl/24lc256.pdf

and finally the source of the program that I'm using is at:

	http://www.bitwizard.nl/test3.c

All help appreciated. 

Oh, Before everybody tells me, there seems to be an extra start-stop
just before I start reading. I copied over some code I found on the
net, and I haven't yet cleaned that extra start-stop out of the code, 
and as far as I can tell, it shouldn't matter... 

Thanks in advance... 

			Roger. 

-- 
** ####@####.#### ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
* There are old pilots, and there are bold pilots. 
* There are also old, bald pilots. 

Previous by date: 19 Sep 2001 21:37:35 -0000 Re: Progress with output logging, John Sutton
Next by date: 19 Sep 2001 21:37:35 -0000 Re: gpsim: TMR0 has 3 nibbles?, Manolis Giannos
Previous in thread:
Next in thread:


Powered by ezmlm-browse 0.20.