View previous topic :: View next topic |
Author |
Message |
andrge
Joined: 26 Oct 2011 Posts: 30 Location: Kaufbeuren
|
Posted: Mon Nov 01, 2021 5:02 pm Post subject: FM24C64_256-XMEGA lib with other I2C chips |
|
|
Hello,
I would like to use the lib FM24C64_256-XMEGA for a FRAM chip together with other I2C chips on the same I2C bus. The FRAM should replace the internal EEPROM as provided by the lib. Is this possible?
Which address must the FRAM chip have?
Can I preset the FRAM address for the lib?
Regards
Andreas
(BASCOM-AVR version : 2.0.8.3 , Latest : 2.0.8.4 ) |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Mon Nov 01, 2021 8:08 pm Post subject: Re: FM24C64_256-XMEGA lib with other I2C chips |
|
|
andrge wrote: | I would like to use the lib FM24C64_256-XMEGA for a FRAM chip together with other I2C chips on the same I2C bus. |
There's a sample in the online help, which answers, partly implicit, some of your questions.
Quote: | The FRAM should replace the internal EEPROM as provided by the lib. Is this possible? |
At least the help example shows exactly this purpose.
Quote: | Which address must the FRAM chip have? |
I'd guess A0-A2 = 0, to be more sure it helps to look up the lib.
Quote: | Can I preset the FRAM address for the lib? |
No. Which sense would it make? You use the FRam instead of the internal EEProm, you can not and would not preset the internal EEProm either. |
|
Back to top |
|
|
_jarek_
Joined: 06 Aug 2014 Posts: 5
|
Posted: Mon Nov 01, 2021 9:27 pm Post subject: |
|
|
Quote: | Can I preset the FRAM address for the lib? |
You can set the FRAM address in lib:
Code: |
...
Ldi r17,&B1010_0000 ; address
rcall _write_fram
...
|
but you have to do it for read and write functions |
|
Back to top |
|
|
andrge
Joined: 26 Oct 2011 Posts: 30 Location: Kaufbeuren
|
Posted: Mon Jan 24, 2022 8:22 am Post subject: |
|
|
Hallo,
thank you for your hints.
When i have tested it i will give feedback.
May take some time at the moment.
Andreas |
|
Back to top |
|
|
kempol2
Joined: 04 May 2022 Posts: 2
|
Posted: Wed May 04, 2022 12:37 pm Post subject: FM24C64_256-XMEGA.lib |
|
|
Hi
Is it possible to add string variables handling to FM24C64_256-XMEGA.lib ?
I need to extend eeprom in my project where I use XMEGA128A1U, so this library would be perfect. How to add string handling to this lib? |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5921 Location: Holland
|
Posted: Wed May 04, 2022 1:17 pm Post subject: |
|
|
i dont understand the question.
this lib will overload the normal ERAM var handling.
you need to follow the ERAM rules. which means you can not do this : someEramString= Ltrim(someOtherERAMString)
ERAM is just a simpler way of reading/writing eeprom compared to readeeprom/writeeeprom _________________ Mark |
|
Back to top |
|
|
kempol2
Joined: 04 May 2022 Posts: 2
|
Posted: Thu May 05, 2022 9:14 am Post subject: |
|
|
Hello Mark,
Right, I was unclear.
The lib does not allow to do
Code: |
Dim somevariable As Eram String * 5
|
But it is possible as it stands in the lib: "history = reading/writing STRING is not supported by this lib but you can add it yourself"
The question is how to add read/write string option to the lib? |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5921 Location: Holland
|
Posted: Thu May 05, 2022 7:37 pm Post subject: |
|
|
ok, i get it now.
i added reading of string.
i did not test it however.
i attached the lib. you can see how it was done by looking at the difference.
this gives an idea how to perform this for writing a string.
just take care that reading a string, a zero value is expected as end marker. when it does not exist, it will read the entire memory. _________________ Mark |
|
Back to top |
|
|
andrge
Joined: 26 Oct 2011 Posts: 30 Location: Kaufbeuren
|
Posted: Sun Aug 14, 2022 11:01 am Post subject: FM24C64_256-XMEGA lib with 0 for strings |
|
|
Hello Mark,
I was now able to test the new lib. Works well. It took me a while to get the rich sequence for the initialization right, but now it works.
Could you include the writing of the 0 at the end of strings? Then the Lib would be 1:1 to the internal EEPROM to use.
Otherwise, everyone in all existing programs must come up with something, as he must add the 0 at each string store. With it the topic would be 100% finished.
I would like to do it, but have no experience with assembler, so we are here on your support dependent
best regards
andreas |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5921 Location: Holland
|
Posted: Sun Aug 14, 2022 1:42 pm Post subject: |
|
|
the next update contains a version that is compatible and include string handling. _________________ Mark |
|
Back to top |
|
|
|