PDA

View Full Version : 4 EEPROM Chips Recording Routine



Tom Gonser
- 27th April 2005, 04:58
I have a problem with my recording routine. I have 4 x 24LC512 chips in line with an 18F2525. The Chips are:

Chip1 con %10100000 ' address of chip1
Chip2 con %10100010 ' address of chip2
Chip3 con %10100011 ' address of chip3
Chip4 con %10100001 ' address of chip4

The problem is this: I record timestamped data to these chips one after the other. These 4 chips together hold 10 minutes of data at a .1 second update rate. I use a 'Chipselect' variable to start with chip1, then move through them all, counting to from 0 to 63872 on each chip (128byte pages) -- the data is mixed up.

My routine has a debug that shows on a monitor it is writing to chip1, chip2, etc., and shows the memory address. Watching it everything looks fine.

Then when I play it back, I see some really odd stuff. I'd expect to see is a list of data timestamped starting with Time=0 and ending with time=10.

What I see is mixed up data. A chip holds about 1500 records. so you'd expect:

Chip 1 = 0-1500
Chip2 = 1501=3000
chip3 = 3001-4500
chip4 = 4501-6000

but the time would just jump nicely from chip to chip... It doesn't

The data is mixed up 1 and 4 and 2 and 3 contain the same data...

Am I addressing these chips wrong?

Thanks..

mister_e
- 27th April 2005, 05:25
Did you set correctly A0,A1,A2 of each EEPROM correctly to VCC and GND on your board to match to your defines??? any schematic?

Tom Gonser
- 27th April 2005, 05:46
The eeproms are electrically set as follows:

A0 A1 A2
Chip1 - - -
Chip2 + - -
Chip3 + + -
Chip4 - + -

I have a resistor on SCA/SCL lines (one tho for all lines, not one for each chip.)

.....

mister_e
- 27th April 2005, 16:58
o.k. this is why...

try those define and post your results

Chip1 con %10100000 ' address of chip1
Chip2 con %10100010 ' address of chip2
Chip3 con %10100110 ' address of chip3
Chip4 con %10100100 ' address of chip4

Tom Gonser
- 27th April 2005, 17:49
Yup! that was it.. I was off a position in the setup. THANKS! Oddly it seemed like I was writing to chips 3 and 4 and I must have been writing to both at the same time.

TG

mister_e
- 27th April 2005, 18:28
hehe, great to know it's working for you now !

FLAVIO
- 15th August 2006, 20:00
EXAMPLE:

Chip1 con %10100000 ' address of chip1
Chip2 con %10100010 ' address of chip2
Chip3 con %10100100 ' address of chip3
Chip4 con %10100110 ' address of chip4


By Flavio

[email protected]

mister_e
- 15th August 2006, 21:11
EXAMPLE:

Chip1 con %10100000 ' address of chip1
Chip2 con %10100010 ' address of chip2
Chip3 con %10100100 ' address of chip3
Chip4 con %10100110 ' address of chip4


By Flavio

[email protected]

And the question is.... missing!