PDA

View Full Version : Proto Board EEPROM at24c512



agfa
07-10-2009, 07:24 PM
when the bootloader downloads from the pc the the eeprom is it just writing to the first 32k of the eeprom?· Does the upper 32k stay intact or is it overwritten?

agfa

Nick Mueller
07-10-2009, 07:45 PM
It stays intact.

Just bought 24LC1025 ...


Nick

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!

The DIY Digital-Readout for mills, lathes etc.:
YADRO (http://www.yadro.de)

agfa
07-12-2009, 09:30 PM
Are you sure, or am I doing something wrong?· I did a quick test and·I can't get it to retain·anything in the upper 32k area, after writing to eeprom from proptool.

agfa

BradC
07-12-2009, 09:39 PM
agfa said...
Are you sure, or am I doing something wrong? I did a quick test and I can't get it to retain anything in the upper 32k area, after writing to eeprom from proptool.


You may well be doing something wrong. The Propeller tool downloads the program to the Propeller Ram. The Propeller then zero's the remainder of the 32k and writes it to the bottom half of the eeprom. There is never any reference to any program space above $7FFF.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Release the hounds!

Nick Mueller
07-12-2009, 09:54 PM
> Are you sure, or am I doing something wrong?

I am *absolutely* sure!
But I have no idea what you did wrong. Maybe your way of reading from the EEPROM (in the upper half) is wrong? And it is -in fact- reading the lower half?

You could verify your writes with my "3PClient".

Nick

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!

The DIY Digital-Readout for mills, lathes etc.:
YADRO (http://www.yadro.de)

agfa
07-12-2009, 10:06 PM
Brad,

Thankyou.

Nick,

Thankyou. Could you provide a link to get more info on your "3PClient"?

agfa

Nick Mueller
07-12-2009, 10:22 PM
A search for "3PClient" reveals this thread:
<http://forums.parallax.com/forums/default.aspx?f=25&m=365233&g=365323#m365323>

Nick

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!

The DIY Digital-Readout for mills, lathes etc.:
YADRO (http://www.yadro.de)

agfa
07-13-2009, 01:58 AM
Oops. ·I should have searched.

Thanks, I appreciate your help.

agfa
07-18-2009, 07:43 AM
Thanks again Nick.· I was indeed writing and reading to the lower half.· The routine I was using masked out bit 15 of the address.

Thank you to also BradC.

Its comforting to know that the wealth of experience here is only a question away.

agfa

Nick Mueller
07-18-2009, 05:31 PM
Just an addition:
I finally soldered in my 24LC1025 yesterday (my own PCB) and Propeller Tool failed to program it (tried 3 times).
I do *NOT* know wether this is an issue with the Propeller, the EEPROM or the PropTool.
I *DO* know that the 24xx512 do work as expected.

Anyhow, I was able to program the 24xx1025 with my 3PClient.

This is just a note to those that might discover the same problem. Again, I haven't nailed it down (and don't intend to do so).

Nick

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!

The DIY Digital-Readout for mills, lathes etc.:
YADRO (http://www.yadro.de)

Mike Green
07-18-2009, 09:36 PM
I use 24LC1025s in place of 24xx256s and they work fine with the Propeller Tool and with other EEPROM software.

You have to read the datasheet and follow the directions. In particular, you have to connect the A2 pin to Vdd or it won't work (page 5).
You also have to tie /WP to Vss to be able to write to the chip.

Nick Mueller
07-19-2009, 04:47 PM
Hi Mike!

Yes, /WP is on Vss http://forums.parallax.com/images/smilies/smile.gif
And A2 on Vdd.
I can repeat as often as I want, PropTool fails on the verify. My 3PClient writes and does not fail (doing the verify directly after writing each page).

It's a Microchip 24LS1025 if that makes a difference. With the 24LS512 I never had these problems.
Could you confirm (or not) that you tried it with an Microchip 24LS1025? Or did you just use the AT24C1024B?

<sidenote>
I just compared the Atmel and the Microchip data-sheets, and I see that the Microchip is handling things a bit different. Especially the BlockSelectBit. :-( Seems to be a better option to replace it with an Atmel-EEPROM before I waste more time.
</sidenote>

While we are at it:
I think (I may be wrong!) that the i2c-routine in sdspiFemto doesn't handle addresses above 64K right. It's missing setting the BlockSelect bit (B0), instead, it sets A0. (Chapter 5.1 and Fig. 5.2)
The code looks like this (right above :skipAction0)



mov i2cData, i2cAddr
shr i2cData, #15
and i2cData, #%00001110
or i2cData, #%10100000 'control-code
mov i2cMask, #%10000000




Am I right?

Edit:
What I thought that should work is:
See if bit#17 in the address is set (address is 0x10000 and above).
If yes, mask address with 0xFFFF and set A2 (= Bit #19, equivalent to PageSelBit) to 1

But, it doesn't work. And I don't have the nerves to decode the i2c traffic with an analog scope. It's about getting time for an logic analizer.


Nick

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!

The DIY Digital-Readout for mills, lathes etc.:
YADRO (http://www.yadro.de)

Post Edited (Nick Mueller) : 7/19/2009 12:39:41 PM GMT

Mike Green
07-19-2009, 09:46 PM
The Microchip 24LC1025 has a funny addressing scheme. It provides two 64K byte blocks of EEPROM, one at $00000-$0FFFF, the other at $40000-$4FFFF assuming A0=A1=0. The Atmel 24C1024B has a contiguous address space from $00000 to $1FFFF.

The sdspiFemto routines do handle EEPROM addresses properly throughout the range $00000 to $7FFFF which is the maximum allowed on a single I2C bus (8 x 64K). If you use four Microchip 24LC1025 EEPROMs, you'll get a contiguous 512K byte address space (1a, 2a, 3a, 4a, 1b, 2b, 3b, 4b) with 1/2/3/4 being the chips and a/b the 64K blocks.

Yes, I did use sdspiFemto with both the 24LC1025 and the 24C1024B. It works fine as long as you understand the addressing scheme. sdspiFemto does not correct for Microchips screwy addressing. You have to do that yourself.

sdspiFemto was originally written for use with my Propeller OS which would scan an I2C bus for 32K memory blocks and mark which ones were present. That way, you could have any combination of EEPROMs 32K or larger scattered across the 512K total I2C address space and the file routines would adjust.

Post Edited (Mike Green) : 7/19/2009 2:54:11 PM GMT

Nick Mueller
07-19-2009, 09:57 PM
> Yes, I did use sdspiFemto with both the 24LC1025 and the 24C1024B. It works fine as long as you understand the addressing scheme.

Thanks for the verification. I also did understand that addressing right (albeit not initially http://forums.parallax.com/images/smilies/smile.gif ).
So it must be something with the chip (hard to imagine). I'll swap it ...

Oh and sorry for my previous confusing posting. I wrote it in 3 steps and came up with new explanations and theories. So it got messed up a bit from a logical POV.


Thanks,
Nick

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!

The DIY Digital-Readout for mills, lathes etc.:
YADRO (http://www.yadro.de)

Post Edited (Nick Mueller) : 7/19/2009 3:03:01 PM GMT

Nick Mueller
07-21-2009, 02:30 AM
OK, I finally found the reason!

See the scope-shots. Channel 1 (top) is SCL, ch2 is SDA.

Shot 1 (tek1.bmp) shows the rise-time from Vss to 0.7 * Vcc (param D2 in table 1-1 of the Microchip-specs). It is 300ns (also maximum per specs param #4 in table 1-2).
Data-input Setup-time is 100ns minimum, here we have 240ns. And in this shot, it worked. But only, because I was in the *slow* mode (100kHz). In fast mode (400kHz; and that chip is a 400kHz) the 0.7Vcc are reached **after** SCL is high.
The pull-up is 10k (and I verified that).

Consequence is, that the constant for i2cDataSet4 (250ns) has to be adjusted to 550ns (250 + 300) and i2cDataSet1 to 900ns.

Could someone verify that?


Edit: The funny thing is, that it wrote propperly from the beginning on, but when reading (or verifying), I got the most weird results, that looked like the auto-increment didn't work. Kinda like it was stuck for a few reads and then jumped to the next position. Sometimes. Or not or maybe.

Nick
PS: And please no jokes about the BMP! http://forums.parallax.com/images/smilies/smilewinkgrin.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!

The DIY Digital-Readout for mills, lathes etc.:
YADRO (http://www.yadro.de)

Post Edited (Nick Mueller) : 7/20/2009 7:39:17 PM GMT

Mike Green
07-21-2009, 02:58 AM
Nick,
Thanks for scoping the fast mode timing. I know slow mode works which is why it's the default mode in the Spin interface routines. Fast mode worked for some parts and not for others. I don't have a scope or logic analyzer, so I couldn't figure out why. Whatever you could provide in terms of more test data / displays would be helpful.
Mike

Nick Mueller
07-21-2009, 03:47 AM
> I don't have a scope or logic analyzer, so I couldn't figure out why.

I know that. And the more respect to your work, getting it to run in blind-mode!


> Whatever you could provide in terms of more test data / displays would be helpful.

Whatever you need. Again, that shot was taken in 100kHz-mode. But for 100kHz, the timing would already be too tight.
The problem with my scope is the little buffer*). It's only 1k, so I can't select exactly where I trigger (or at least, I can't reconstruct where the trigger was), because I can't zoom in that much, a factor of 5..10 is the maximum. :-(
I'm really close to buying a new scope (mixed signal, a HAMEG HMO3522 <http://www.hameg.com/530.0.html?L=1>) but this one is so new, that the i2c-decoding isn't yet implemented. And the MSO of a friend is really hard to borrow for me now since I moved. The other option would be to buy a LogicPort ... Well, you see, I don't have the perfect equipment.

*)
That's why I tried to avoid scoping that. I know it's a pain to work with a long trail of signals and you want to look at some detail somewhere in the middle. It's like a shot in the dark.

Nick

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!

The DIY Digital-Readout for mills, lathes etc.:
YADRO (http://www.yadro.de)

Nick Mueller
07-21-2009, 04:13 AM
Ah, a few more things:
High and low time for SCL is within specs.
There is still a problem after writing a page and then reading. My only solution for now is to wait for 3ms (thats the typical page write time).

I made a bunch of almost 32k-writes each one offset by 1 byte, so it doesn't read the right value from the previous run. All seems to work now.

Nick

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!

The DIY Digital-Readout for mills, lathes etc.:
YADRO (http://www.yadro.de)

BigFoot
07-22-2009, 01:01 AM
I believe the 24LC1025 chip uses a different base address than the 256 or 512K chips. If you notice on the data sheet A3
must be connected to a logic 1. The smaller chips have to have A1, A2 & A3 connected to logic 0.