Hello! Martin
good morning
Thank you for writing back, I will check on your suggestions once I reach in front of computer and keep you posted.
NOTE: Reding and Writing strings within internal EEPROM is easy and straight forward but the same macro is not available when it comes to using external macro, so this big exercise.
Thank you.
Abhi
External EEPROM ReadString/WriteString
-
- Posts: 36
- http://meble-kuchenne.info.pl
- Joined: Thu Dec 03, 2020 6:26 am
- Has thanked: 3 times
-
- Valued Contributor
- Posts: 1608
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 142 times
- Been thanked: 756 times
Re: External EEPROM ReadString/WriteString
To read from external eeprom is still okay:
Need to read to a /0 character.
Using text, pos, c and i (index) ideally all locals:
It should have a check on max length as well - and probably be moved to a separate macro (taking pos and max length as parameters and return a string)
Martin
Need to read to a /0 character.
Using text, pos, c and i (index) ideally all locals:
Code: Select all
.i = 0
.pos = address to read
loop
.c = ReadByte(.pos + .i)
.text[.i] = .c
.i = .i + 1
until .c = 0
Martin
Re: External EEPROM ReadString/WriteString
Hello!
Still trying to figure out some solution for the external EEPROM.
Today facing problem with memory location, I notice I am not able to read and write to the external EEPROM (Microchip 24C01C, 1024 Bytes memory size) memory locations 256 or 0x100 and above, any location above 255 or 0xFF i am not able to read write.
May i request FC team or someone to help me know if i am writing the address in a wrong way (if it is written in some other way above 0xFF), if not then something is not working well with the macro after the 0xFF address.
I also checked the read write page function and that too do not function above address 255 or 0xFF
To cross check i repeat the same action of read and write with internal EEPROM and it works well for PIC18F27K42 for address above 0xFF, i test 2 address locations and tried writing and testing in decimal as well hex values, i checked following 2 address 256 or 0x100 and 921 or 0x399, both works as expected with internal EEPROM.
I tried the update, restart but nothing works.
By the way after update the WS2812B component do not show correctly in the 3D panel, something is wrong with that too, how can i roll back to previous component or it is not possible until team check what is the problem and push the new update.
Team i humbly request to address this problem on priority or please correct me if i am doing something wrong.
Thank you.
Regards
Abhi
Still trying to figure out some solution for the external EEPROM.
Today facing problem with memory location, I notice I am not able to read and write to the external EEPROM (Microchip 24C01C, 1024 Bytes memory size) memory locations 256 or 0x100 and above, any location above 255 or 0xFF i am not able to read write.
May i request FC team or someone to help me know if i am writing the address in a wrong way (if it is written in some other way above 0xFF), if not then something is not working well with the macro after the 0xFF address.
I also checked the read write page function and that too do not function above address 255 or 0xFF
To cross check i repeat the same action of read and write with internal EEPROM and it works well for PIC18F27K42 for address above 0xFF, i test 2 address locations and tried writing and testing in decimal as well hex values, i checked following 2 address 256 or 0x100 and 921 or 0x399, both works as expected with internal EEPROM.
I tried the update, restart but nothing works.
By the way after update the WS2812B component do not show correctly in the 3D panel, something is wrong with that too, how can i roll back to previous component or it is not possible until team check what is the problem and push the new update.
Team i humbly request to address this problem on priority or please correct me if i am doing something wrong.
Thank you.
Regards
Abhi
-
- Valued Contributor
- Posts: 1608
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 142 times
- Been thanked: 756 times
Re: External EEPROM ReadString/WriteString
Take a look at this topic:
https://flowcode.co.uk/forums/viewtopic.php?t=2794
I did an 'alternate' eeprom component which might do what you need (although it won't work in simulation) - it should allow read/write to any address...
Martin
https://flowcode.co.uk/forums/viewtopic.php?t=2794
I did an 'alternate' eeprom component which might do what you need (although it won't work in simulation) - it should allow read/write to any address...
Martin
Re: External EEPROM ReadString/WriteString
Hi! Martin
good morning
Thank you for writing back, it seems the component (24LC512) is available in the FC library. unfortunately i do not have that for the moment but i will order that today, need to wait until tomorrow.
By the way should i use the same which is available in FC or the one you mentioned to download and install separately.
Coming to my previous post, it is surprising why i am not able to read write above 0xFF, i hope i receive some answer from FC team. Also does that mean 24C01....24C16 entire range will have the same problem of not reading and writing above 0xFF address, kindly confirm.
Thank you.
Regards
Abhi
good morning
Thank you for writing back, it seems the component (24LC512) is available in the FC library. unfortunately i do not have that for the moment but i will order that today, need to wait until tomorrow.
By the way should i use the same which is available in FC or the one you mentioned to download and install separately.
Coming to my previous post, it is surprising why i am not able to read write above 0xFF, i hope i receive some answer from FC team. Also does that mean 24C01....24C16 entire range will have the same problem of not reading and writing above 0xFF address, kindly confirm.
Thank you.
Regards
Abhi
-
- Valued Contributor
- Posts: 1608
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 142 times
- Been thanked: 756 times
Re: External EEPROM ReadString/WriteString
Hi Abhi,
Can you post your code - are you using a byte as the address as this will limit you to 0..255
Change it to an int or unsigned int would fix if this is the case.
Martin
Can you post your code - are you using a byte as the address as this will limit you to 0..255
Change it to an int or unsigned int would fix if this is the case.
Martin
Re: External EEPROM ReadString/WriteString
Hi! Martin
I am happy to hear you my friend, i did had that doubt in my mind but i never used any variable for addressing to memory location of EEPROM in the past, i write directly the address as below
0x00, 0xFF, 0x399
until i realized i need to access the entire memory of the EEPROM (4096 bytes) which was not possible to write every address in hex so i thought of incrementing the address one by one (in dec) in a loop and write 0 in each location as that was my need for further activities.
So initially i did assigned one UINT to represent the address of EEPROM, it was only then i realized something is not working and after a long investigation and testing i came to a conclusion that after 0xFF or from 0x100 i am not able to read or write the external EEPROM, i guess i am right, so today i am going to double check the same with 24C02, 24C04, 24C16
I will share the chart in some time if you want to have a look, let me edit the necessary part and share.
Thank you again for writing.
Regards
Abhi
I am happy to hear you my friend, i did had that doubt in my mind but i never used any variable for addressing to memory location of EEPROM in the past, i write directly the address as below
0x00, 0xFF, 0x399
until i realized i need to access the entire memory of the EEPROM (4096 bytes) which was not possible to write every address in hex so i thought of incrementing the address one by one (in dec) in a loop and write 0 in each location as that was my need for further activities.
So initially i did assigned one UINT to represent the address of EEPROM, it was only then i realized something is not working and after a long investigation and testing i came to a conclusion that after 0xFF or from 0x100 i am not able to read or write the external EEPROM, i guess i am right, so today i am going to double check the same with 24C02, 24C04, 24C16
I will share the chart in some time if you want to have a look, let me edit the necessary part and share.
Thank you again for writing.
Regards
Abhi
Re: External EEPROM ReadString/WriteString
Hello! Martin
Following my previous post and as said i tried to test other available EEPROM chips with me, below information
24C01 : can use up to 0xFF (255) address
24C02 : can use up to 0xFF (255) address
24C04 : can use up to 0x1FF (511) address
24C16 : can use up to 0x9FFF (40959) address
Once again Martin many thanks for your intervention, i appreciate that, i am sharing the chart for your reference, do point out if you find any mistake in above assessment or writing the chart.
Thank you.
Regards
Abhi
Following my previous post and as said i tried to test other available EEPROM chips with me, below information
24C01 : can use up to 0xFF (255) address
24C02 : can use up to 0xFF (255) address
24C04 : can use up to 0x1FF (511) address
24C16 : can use up to 0x9FFF (40959) address
Once again Martin many thanks for your intervention, i appreciate that, i am sharing the chart for your reference, do point out if you find any mistake in above assessment or writing the chart.
Thank you.
Regards
Abhi
- Attachments
-
- Martin_18F27K42_15-08-2025.fcfx
- (20.32 KiB) Downloaded 1 time
-
- Valued Contributor
- Posts: 1608
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 142 times
- Been thanked: 756 times
Re: External EEPROM ReadString/WriteString
Hi Abhi,
The 24c01 has just 1kbit of storage so just addresses 0..127 will work.
The 24c02 has 2kb (bits not bytes) so it looks like things are working correctly?
Martin
The 24c01 has just 1kbit of storage so just addresses 0..127 will work.
The 24c02 has 2kb (bits not bytes) so it looks like things are working correctly?
Martin