Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:58 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Here we go again with I2C EEPROM's....

Author Message
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 06:12am 16 Dec 2022
Copy link to clipboard 
Print this post

Trying to make a 24FC01 EEPROM co-operate with a PicoMite.

PicoMite seems to know it is there, cos the test code on this thread produces the following result:





So, the PM is getting ACK's from addresses &h50 to &h57, which is correct, as this EEPROM does not use the address pins/bits, and so does not care what you set them to or if they are floating even - it will respond on any of those addresses, and that is proven with the little test program.

So, that's good.

But I cannot get any kind of data into or out of the damn thing, even though the MM.I2C variable is reporting everything is good.

My test code is:


SetPin GP6,GP7,I2C2
I2C2 Open 100,100

Dim D$,E$

D$=Str$(&h00)+"1234567" 'Address of zero + the data bytes; 8-byte page
I2C2 Write &h50,0,8,D$
Pause 10 'Allow time for EEPROM to do its page-write thing...(at least 5ms)
Print MM.I2C
Print "Attempting readback..."
Pause 1000
I2C2 Write &h50,0,1,&h00 'Reset the byte address pointer thing
Pause 10
I2C2 Read &h50,0,7,E$
Print MM.I2C
Print E$


The result I get is:





So, no NACK's, but the data does not come back 1234567 as expected.

Can anyone see what I am doing wrong?
I can hook up the logic analyzer if I have to, but perhaps someone can see what I am doing wrong without having to get that deep into things.

24FC01 has an 8-byte page-write ability, so I should be able to write 7 ASCII bytes, combined with the memory pointer byte to make our 8-byte page.  I stop then, and MMBASIC should send the stop for me, and the EEPROM should then do the page write.
MM.I2C seems to suggest this is all good, but I don't get the data back that I have tried to write.

EEPROM powered from 3v3 Waveshare Zero module 3v3 output, 100n cap across the EEPROM, 4k7 pullups to SCL and SDA on that same 3v3 supply.

I would love some pointers on what I should/could try next at this point.
Smoke makes things work. When the smoke gets out, it stops!
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 06:33am 16 Dec 2022
Copy link to clipboard 
Print this post

Write protect not set right?
VK7JH
MMedit
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 06:35am 16 Dec 2022
Copy link to clipboard 
Print this post

IGNORE....Fixed it...
Smoke makes things work. When the smoke gets out, it stops!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 06:40am 16 Dec 2022
Copy link to clipboard 
Print this post

Write protect set correctly (pulled directly to GND)

I had made a mistake using STR$(&h00) for my EEPROM index reference byte for the pointer thing.  

STR$(&h00) produces a zero, which is ASCII 48, which is &h30, so the EEPROM was writing at &h30, but I was trying to read it back from &h00....

Damn, computers are pedantic, aren't they?! (rhetorical)


Changed the line to: D$=Chr$(&h00)+"1234567"

That correctly makes byte 1 of the string decimal zero rather then decimal 48 disguised as a zero when printed on the screen!

Time for a break, but I can come back and tinker around a bit more now that I have found my mistake!
Edited 2022-12-16 16:41 by Grogster
Smoke makes things work. When the smoke gets out, it stops!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 08:25am 16 Dec 2022
Copy link to clipboard 
Print this post

UPDATE:  Here is a result of outputting all 128 bytes from the EEPROM:





Note that there is a "1234567" towards the right of the first line - this will be where I was accidentally writing to the wrong address.  So it was working, I just didn't know it was.  

Onwards...
Smoke makes things work. When the smoke gets out, it stops!
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1593
Posted: 12:09pm 16 Dec 2022
Copy link to clipboard 
Print this post

Hi Grogster,

years ago I created an I2C EEPROM Library. Maybe an inspiration?

Best regards
Michael
causality ≠ correlation ≠ coincidence
 
Hans

Senior Member

Joined: 18/10/2022
Location: Canada
Posts: 116
Posted: 09:14pm 16 Dec 2022
Copy link to clipboard 
Print this post

  twofingers said  Hi Grogster,

years ago I created an I2C EEPROM Library. Maybe an inspiration?

Best regards
Michael


Thank you for that code twofingers. It was perfect for me to understand how to access the memory chips on my I2C RTC.

Again Thanks,

Hans ....
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025