Page 2 of 2
Re: EEPROM Operation
Posted: Sat Aug 10, 2013 7:31 am
by greentech
thanks spanish, ill definitely test it on the real hardware now and get back to u.
Re: EEPROM Operation
Posted: Sat Aug 10, 2013 9:06 am
by kersing
greentech wrote:Then what to do? The datasheet for 24c04 advices the same sequence. why that doesn't work? i have also tried this with 24lc512 with the same results.....
Fairy
Which data sheet? Do you have a link to the one for your device? As is mentioned before the are different manufacturers and the devices might not be compatible.
Re: EEPROM Operation
Posted: Sat Aug 10, 2013 9:39 am
by medelec35
kersing wrote:Martin,
What is the exact hardware you tried? (Model and Manufacturer)
Sorry for the delay Jac.
I'm using
Microchip 24LC512
Data sheet:
http://ww1.microchip.com/downloads/en/D ... 21754M.pdf
Last time I tried, it took a few attempts to display the correct information.
It was on a separate bread board to microcontroller, so could have been caused by stray capacitance, or as Jac has been saying flowchart is not correct?
Hope this helps
Martin
Re: EEPROM Operation
Posted: Sat Aug 10, 2013 10:52 am
by medelec35
I'm looking into this more.
I can confirm that reading EEPROM works 100% of the time.
It looks like the issue is writing to EEPROM.
I changed 2013 to a different number to test and the number read was still 2013.
So the reason I thought it was working is because with a previous flowchart I must of successful programmed with 2013.
So I'm changing flowchart to take that into account.
At least that could be one reason your still getting 255's and I'm not?
So I will see if I can sort out flowchart and only when working 100% I will post it.
I do want to solve this...determined

Re: EEPROM Operation
Posted: Sat Aug 10, 2013 4:38 pm
by medelec35
There was a bug in 3. EEPROM read and write.fcf that greentech posted on Wed Aug 07, 2013 6:54 am
I have corrected bug, and now my hardware works 100% of the time.
To confirm both read and write works, I have been changing the data values.
Read now always matches write.
Still not sure if it will simulate or not?
I will see if flowchart works with other I2C EEPROMs.
Re: EEPROM Operation
Posted: Thu Sep 19, 2024 3:05 pm
by samtin
Hello,
I tried a porting in Flowcode 10 but without a successful result.
It seems that the data is not stored in the eeprom locations.
Please help me.
Thank you!
Re: EEPROM Operation
Posted: Fri Sep 20, 2024 11:04 am
by samtin
Hello,
I don't know if the flowchart is good, I ordered eeprom memory 24LC512.
Re: EEPROM Operation
Posted: Thu Sep 26, 2024 3:35 pm
by samtin
Hello,
They came eeprom 24LC512, I put them in the circuit, but without result. Is there someone who can correct the flowchart? What must be done? The flowchart is made in Flowcode 10 after "3. EEPROM read and write V3".
Re: EEPROM Operation
Posted: Fri Sep 27, 2024 7:06 am
by mnf
Hi,
You look to be using i2c generic read/write register The eeprom needs more than this to work correctly. Have you tried the eeprom component?
Have a look at
viewtopic.php?t=22422 for some more detail
Martin
Re: EEPROM Operation
Posted: Fri Sep 27, 2024 9:55 am
by samtin
Hello,
Thanks for the reply and the link. Can 24LC512 be inserted in your program?
Thank you!
Re: EEPROM Operation
Posted: Fri Sep 27, 2024 9:17 pm
by mnf
I tried the official component - good to check you have comms first
After a little fiddling - using an Arduino Uno - and enabling the inbuild pull-ups (I also needed external pull-ups but it wouldn't work with either the enable or the hardware removed - very odd, but the resistors I used were just two at 'random')
Then - address - I had pins 1 and 2 connected to VCC (using an old project with 4 x 256Mb chips) so set address to 3 for the component. Set this property to 0 unless you have a0/a1 (pins 1 or 2) connected to VCC.
Then - a simple write followed by a read. I read the data twice, once a byte at a time, and once using the block read. The data is sent to UART at 115200.
So - this is using an 24LC256 but either should work (this using v10)
Martin
Re: EEPROM Operation
Posted: Sat Sep 28, 2024 8:18 am
by samtin
Hi,
Thank you very much for your help and answer.
All the best!
Re: EEPROM Operation
Posted: Sat Sep 28, 2024 9:39 am
by samtin
Hi Martin
I did the porting on the PIC16F877A, without any modification, but it does not compile, I am attaching the image. What should I do? I am using Flowcode 10.
Re: EEPROM Operation
Posted: Sat Sep 28, 2024 9:45 am
by mnf
You'll need to change the i2c pins (and the eeprom address) in the component properties.
Also delete the macro pullup (and the two calls to it). You'll need to have pull-up resistors as per i2c.
Martin
Re: EEPROM Operation
Posted: Sat Sep 28, 2024 10:50 am
by samtin
The I2C pins in the component properties show that they are connected to the C4 SDA port and the C3 SCL port for the PIC16F877A and the address goes to 0?
Re: EEPROM Operation
Posted: Sat Sep 28, 2024 11:09 am
by mnf
Yes - if that's where they are connected. Adress should probably be 0 (pins 1 and two floating or gnd)
Re: EEPROM Operation
Posted: Sat Sep 28, 2024 11:43 am
by samtin
It does not compile, the same message as the picture above. Please help me to compile.
Re: EEPROM Operation
Posted: Sat Sep 28, 2024 11:57 am
by mnf
Will try when I get home this afternoon.
I have a few PICs I can try too?
Martin
Re: EEPROM Operation
Posted: Sat Sep 28, 2024 12:01 pm
by samtin
Try this flowchart.
Re: EEPROM Operation
Posted: Sat Sep 28, 2024 12:43 pm
by samtin
This is the Flowcode message in the image below.
Re: EEPROM Operation
Posted: Sat Sep 28, 2024 1:22 pm
by mnf
Delete the pullup macro too...
I also output the data to UART - change this to use your display instead ..
Re: EEPROM Operation
Posted: Sat Sep 28, 2024 1:46 pm
by samtin
But in the program UART transmits not receives data. This is what the flowchart looks like.
(908) exit status = 1
(908) exit status = 1
Re: EEPROM Operation
Posted: Sat Sep 28, 2024 7:22 pm
by mnf
Just tried compiling and seems the PIC you have has too little RAM to use the component.
I stripped everything out - apart from Read and Write of 10 bytes (no display etc) - and get an error insufficient memory to allocate _FCL_BUFF (130 bytes) - which would (space permitting) be used by the Page Read and Write functions.
Options:
1) Use a PIC with more memory.
2) Modify the component - remove the 'page' functions and create a new 'cut-down' component. MatrixTSL now kindly supply all the source code for the components.
3) Use my code from the above link - this did have 'block' read and write functions, but relied on the space from the 'caller'
4) Depending on how much data you want to save - use the PICs internal eeprom (the PIC has 256 bytes available)
Looking at the data sheet - the MCU you are using should have 368 bytes of RAM - so I'm a little surprised it doesn't allow this to work, so some memory being used by i2c buffers?
Martin
Re: EEPROM Operation
Posted: Sun Sep 29, 2024 10:27 am
by samtin
I use PIC16F877A for the test, for microcontrollers with RAM and reduced eeprom I will use external eeprom. I saw the source code on the wiki, can it be found elsewhere?
Thank you again for your help