I2C backup and Restor

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

User avatar
jollybv
Flowcode v5 User
Posts: 342
Joined: Thu Feb 12, 2009 5:20 am
Has thanked: 77 times
Been thanked: 24 times
Contact:

I2C backup and Restor

Postby jollybv » Fri Feb 16, 2018 8:37 am

Hi Guys

I have written a little program to do a backup and restore of an 24LC256 eeprom but i can't seem to get it to work not sure if my addressing is right but according to the dater sheet it seems right. The one address is 0xa0 (1010 0000)and on the board i have A0 A1 A2 all tied to ground on the other eeprom board the address is 0xa8 1010 1000 on that board I have A0, A1 tied to ground and A2 tied to vcc but when I test the program it does no back up. Bothe chips are paralleled up with 10K resistor pulled to Vcc.

Am i doing this right or have i missed something

I2C_Backup_Restore.fcfx
(36.63 KiB) Downloaded 50 times

User avatar
LeighM
Matrix Staff
Posts: 1912
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 460 times
Been thanked: 646 times
Contact:

Re: I2C backup and Restor

Postby LeighM » Mon Feb 19, 2018 10:49 am

I would suggest that you first try writing a single fixed value to each eeprom and then read them back and display, just to check the write and read functionality is working.
The InternalAddress maths in main might need *64, not *63

User avatar
jollybv
Flowcode v5 User
Posts: 342
Joined: Thu Feb 12, 2009 5:20 am
Has thanked: 77 times
Been thanked: 24 times
Contact:

Re: I2C backup and Restor

Postby jollybv » Mon Feb 19, 2018 2:40 pm

Hi Leigh

Thanks will give it a try

User avatar
jollybv
Flowcode v5 User
Posts: 342
Joined: Thu Feb 12, 2009 5:20 am
Has thanked: 77 times
Been thanked: 24 times
Contact:

Re: I2C backup and Restor

Postby jollybv » Mon Aug 13, 2018 3:26 pm

Hi Guys

I'm a bit confused with the internal addressing. If the eeprom address starts at 0 and the eeprom can do a 64 byte page read / write then 0 to 64 is 63 or am i missing missing something? or should me next address start address be 65

User avatar
LeighM
Matrix Staff
Posts: 1912
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 460 times
Been thanked: 646 times
Contact:

Re: I2C backup and Restor

Postby LeighM » Mon Aug 13, 2018 3:47 pm

Hi,
0 to 63, is 64 locations

User avatar
jollybv
Flowcode v5 User
Posts: 342
Joined: Thu Feb 12, 2009 5:20 am
Has thanked: 77 times
Been thanked: 24 times
Contact:

Re: I2C backup and Restor

Postby jollybv » Fri Aug 31, 2018 3:50 pm

Hi leigh

Am i correct in saying the start address of the next page will be as follows

start end
0 - 63
64 - 128
129- 192
193 - 256

and so on

User avatar
jollybv
Flowcode v5 User
Posts: 342
Joined: Thu Feb 12, 2009 5:20 am
Has thanked: 77 times
Been thanked: 24 times
Contact:

Re: I2C backup and Restor

Postby jollybv » Fri Aug 31, 2018 3:53 pm

Hi leigh

Am i correct in saying the start & end address of the next page will be as follows

start - end
0 - 63
64 - 128
129- 192
193 - 256

and so on

kersing
Valued Contributor
Valued Contributor
Posts: 1873
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 530 times
Been thanked: 1040 times
Contact:

Re: I2C backup and Restor

Postby kersing » Fri Aug 31, 2018 5:16 pm

No,

Ranges of 64 addresses starting at 0 are:
0-63
64-127
128-191
192-255
These users thanked the author kersing for the post:
medelec35 (Sat Sep 01, 2018 11:48 am)
Rating: 5.26%
 
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

User avatar
jollybv
Flowcode v5 User
Posts: 342
Joined: Thu Feb 12, 2009 5:20 am
Has thanked: 77 times
Been thanked: 24 times
Contact:

Re: I2C backup and Restor

Postby jollybv » Sat Sep 01, 2018 6:06 am

Thanks this has helped me tremendously