A question about eeprom

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

Moderator: Benj

Post Reply
maxtisc
Posts: 110
Joined: Mon Dec 23, 2013 9:34 pm
Has thanked: 2 times
Been thanked: 9 times
Contact:

A question about eeprom

Post by maxtisc »

A question about eeprom
Hello everyone
If the eeprom data are organized in 8 bits how do i save a number greater than 255?
I have thought to do this for example if I have to save 1234 except for the first address 1 on the second 2 on the third 3 and on the fourth 4 when I go to read the individual leases I do
1 * 1000
2 * 100
3 * 10
4 * 1
Then sum up all the values getting 1234
Is this correct or does a better way to do this?

thank you

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: A question about eeprom

Post by medelec35 »

Hi maxtisc,
You can use two EEPROM memory locations to store any integer value.
Take a look at this thread.
I'm sure there are other threads as well.

Martin
Martin

maxtisc
Posts: 110
Joined: Mon Dec 23, 2013 9:34 pm
Has thanked: 2 times
Been thanked: 9 times
Contact:

Re: A question about eeprom

Post by maxtisc »

Hi Martin
Thanks for your post is very interesting, I did some simple tests and works very well
thank you so much

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: A question about eeprom

Post by medelec35 »

Your welcome.
Glad I can help.

Martin.
Martin

maxtisc
Posts: 110
Joined: Mon Dec 23, 2013 9:34 pm
Has thanked: 2 times
Been thanked: 9 times
Contact:

Re: A question about eeprom

Post by maxtisc »

Hi Martin
I tried to transfer the concept of post to hardware (arduino 2560 V3 + nextion display ) but it does not work, in simulation it works fine.
In my opinion there is a bug on the management of the internal eeprom
I attach a simple test file maybe you see something that is not set correctly
thanks
Attachments
PROVA_BYTE.fcfx
test eeprom
(7.31 KiB) Downloaded 212 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: A question about eeprom

Post by medelec35 »

Hi maxtisc,
Do you want to see if attached works any better?

Martin
Attachments
PROVA_BYTE V2.fcfx
(7.5 KiB) Downloaded 204 times
Martin

maxtisc
Posts: 110
Joined: Mon Dec 23, 2013 9:34 pm
Has thanked: 2 times
Been thanked: 9 times
Contact:

Re: A question about eeprom

Post by maxtisc »

Thank you for your interest
Unfortunately, it does not work

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

Re: A question about eeprom

Post by Benj »

Hello,

Can you tell us exactly what the hardware is doing?
it does not work
Doesn't give us much to go on.

maxtisc
Posts: 110
Joined: Mon Dec 23, 2013 9:34 pm
Has thanked: 2 times
Been thanked: 9 times
Contact:

Re: A question about eeprom

Post by maxtisc »

Hello
In the small test program only the serial 232 n ° 1 is used to command the nextion display.

Then in the original program in the eeprom will be saved the set_points that will be called up when the system restarts, via the modifier keyboard the setpoints I see are regularly saved in the volatile memory but the program restarts only incorrect values, so I did a program Part to test only the eeprom function
thanks

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

Re: A question about eeprom

Post by Benj »

Hello,

The value should be 257 when you program the device (0x0101) and that is the value the simulation is giving. What value is your hardware generating when you program the device?

maxtisc
Posts: 110
Joined: Mon Dec 23, 2013 9:34 pm
Has thanked: 2 times
Been thanked: 9 times
Contact:

Re: A question about eeprom

Post by maxtisc »

hello
The given value is always 0

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: A question about eeprom

Post by medelec35 »

Do you have a programmer that will allow you to read EEPROM contents so you can verify that EEPROM addresses contain correct values?
No point in reading EEPROM is values stored are incorrect.
This is my EEPROM test Flowchart.
I could expand it to cover number higher than 255

Martin
Attachments
16f1937 EEPROM Test1.fcfx
(10.67 KiB) Downloaded 216 times
Martin

maxtisc
Posts: 110
Joined: Mon Dec 23, 2013 9:34 pm
Has thanked: 2 times
Been thanked: 9 times
Contact:

Re: A question about eeprom

Post by maxtisc »

Hello
I do not have an eeprom reader
I solved my problem with a 24c64 memory that works in I2C and works fine, with internal memory not working to save data.
thank you

Post Reply