Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

FM24C64_256-XMEGA lib with other I2C chips

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
andrge

Bascom Member



Joined: 26 Oct 2011
Posts: 30
Location: Kaufbeuren

germany.gif
PostPosted: Mon Nov 01, 2021 5:02 pm    Post subject: FM24C64_256-XMEGA lib with other I2C chips Reply with quote

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
View user's profile
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 2262

blank.gif
PostPosted: Mon Nov 01, 2021 8:08 pm    Post subject: Re: FM24C64_256-XMEGA lib with other I2C chips Reply with quote

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
View user's profile
_jarek_

Bascom Member



Joined: 06 Aug 2014
Posts: 5

poland.gif
PostPosted: Mon Nov 01, 2021 9:27 pm    Post subject: Reply with quote

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
View user's profile
andrge

Bascom Member



Joined: 26 Oct 2011
Posts: 30
Location: Kaufbeuren

germany.gif
PostPosted: Mon Jan 24, 2022 8:22 am    Post subject: Reply with quote

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
View user's profile
kempol2

Bascom Member



Joined: 04 May 2022
Posts: 2

PostPosted: Wed May 04, 2022 12:37 pm    Post subject: FM24C64_256-XMEGA.lib Reply with quote

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
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5917
Location: Holland

blank.gif
PostPosted: Wed May 04, 2022 1:17 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
kempol2

Bascom Member



Joined: 04 May 2022
Posts: 2

PostPosted: Thu May 05, 2022 9:14 am    Post subject: Reply with quote

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
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5917
Location: Holland

blank.gif
PostPosted: Thu May 05, 2022 7:37 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
andrge

Bascom Member



Joined: 26 Oct 2011
Posts: 30
Location: Kaufbeuren

germany.gif
PostPosted: Sun Aug 14, 2022 11:01 am    Post subject: FM24C64_256-XMEGA lib with 0 for strings Reply with quote

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 Smile

best regards
andreas
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5917
Location: Holland

blank.gif
PostPosted: Sun Aug 14, 2022 1:42 pm    Post subject: Reply with quote

the next update contains a version that is compatible and include string handling.
_________________
Mark
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum