Component for 24FC04

Moderator: Benj

DirkB
Posts: 97
Joined: Wed Feb 08, 2012 2:45 pm
Has thanked: 7 times
Been thanked: 7 times
Contact:

Component for 24FC04

Postby DirkB » Thu Feb 28, 2019 10:48 am

Hello,

is a component for 24FC04 EEProm available

thank you

Dirk

User avatar
LeighM
Matrix Staff
Posts: 1749
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 414 times
Been thanked: 578 times
Contact:

Re: Component for 24FC04

Postby LeighM » Thu Feb 28, 2019 11:58 am

Hi Dirk,
I think that the 24C16 component should work with a 24C04,
as long as you set the A1 and A2 pins low
(or add a matching offset to the Address value, A2 A1 would be equivalent to Address bits 10 and 9 of the 24C16)
Leigh

DirkB
Posts: 97
Joined: Wed Feb 08, 2012 2:45 pm
Has thanked: 7 times
Been thanked: 7 times
Contact:

Re: Component for 24FC04

Postby DirkB » Thu Feb 28, 2019 1:05 pm

Hello Leigh,

thank you for your quik reply.are you sure?
The 24FC04 is a 16 bit eeprom. how can i
store 16 bit word to the 24C16?

thank you

Dirk

User avatar
LeighM
Matrix Staff
Posts: 1749
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 414 times
Been thanked: 578 times
Contact:

Re: Component for 24FC04

Postby LeighM » Thu Feb 28, 2019 1:41 pm

Can you post a datasheet for the device you are looking at?

DirkB
Posts: 97
Joined: Wed Feb 08, 2012 2:45 pm
Has thanked: 7 times
Been thanked: 7 times
Contact:

Re: Component for 24FC04

Postby DirkB » Fri Mar 01, 2019 11:15 am

Hello Leigh,

here the datasheet for the device.

http://ww1.microchip.com/downloads/en/D ... 01708L.pdf

regards

Dirk

User avatar
LeighM
Matrix Staff
Posts: 1749
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 414 times
Been thanked: 578 times
Contact:

Re: Component for 24FC04

Postby LeighM » Fri Mar 01, 2019 12:36 pm

Hi Dirk,
Thanks, that confirms what I thought.
In fact in that datasheet the A address pins are not connected, so no need to worry about them.
So, what do you mean by 16 bit? The 24C16 is the same interface as 24C04, but just has more memory/pages.
If you use the 24C16 component you just need to provide an address (between 0 and 0x1FF) and read or write the byte.
Regards,
Leigh

DirkB
Posts: 97
Joined: Wed Feb 08, 2012 2:45 pm
Has thanked: 7 times
Been thanked: 7 times
Contact:

Re: Component for 24FC04

Postby DirkB » Fri Mar 01, 2019 3:06 pm

Hello Ligh,

i see, i was wrong. I mean you can write 2 pages 8 bit at once.
How can i write an 16 bit word into a 8 bit eeprom?

thank you

Dirk

User avatar
Benj
Matrix Staff
Posts: 13948
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4224 times
Been thanked: 3980 times
Contact:

Re: Component for 24FC04

Postby Benj » Mon Mar 04, 2019 12:59 pm

Hi Dirk,

How can i write an 16 bit word into a 8 bit eeprom?


You simply split the 16-bit value up into two 8-bit values.

LSB = 16bitVar
MSB = 16bitVar >> 8

To recombine after reading from the EEPROM you would simply do this.

16bitVar = LSB + ( MSB << 8 )

DirkB
Posts: 97
Joined: Wed Feb 08, 2012 2:45 pm
Has thanked: 7 times
Been thanked: 7 times
Contact:

Re: Component for 24FC04

Postby DirkB » Mon Mar 04, 2019 6:49 pm

Hi Ben,

thank you. quick work.

regards

Dirk
These users thanked the author DirkB for the post:
Benj (Tue Mar 05, 2019 11:06 am)
Rating: 5.88%