RobTillaart/FRAM_I2C

sleep mode

mbmorrissey opened this issue · 24 comments

Hi,

Are you considering adding suport for sleep?

(I've tried based on
https://www.fujitsu.com/jp/group/fsm/en/documents/products/fram/lineup/MB85RC1MT-DS501-00027-4v0-E.pdf
page 12, but am misunderstanding something!)

[I'm an infrequent github user, sorry if an issue like this isn't the right way to ask this question!]

Michael

Thanks for the issue, so far I had no plans yet. There were not much requests yet.
It might take a few weeks before I can investigate as I got pretty ill yesterday

Thanks for replying about this. I hope you recover quickly. Michael

Thanks

Looked at the datasheet and one need to send
0xF8 ADDR 0x8B (something like that)

So the FRAM seems to listen on a 2nd address which is always F8 and if the following byte matches its 1st address it knows which FRAM to go to sleep.

It might be that this 2nd address pops up on an i2c scanner but as it is above 127 I expect no scanner will test for it.
(enough for today)

Hi Rob,

Thanks for looking at it. I don't want to bug you while you are unwell, so please don't feel pressed to worry about this.

I had tried to follow these instructions from the datasheet, but I've clearly misunderstood something.

I've had some success using Wire to 'manually' read and write to various devices, but I'm a bit stumped by this one, even though think I've basically followed the flow of things in your source and basically see how it relates to information in the datasheet. But one thing I don't understand is why an address of 0x50 works, when according to the manual, it looks like the MB85RC1MT ic would be expecting 0x50 << 1 (1010000)?

My attempts have been this, but it shows no sign of a drop in current consuption (measured with Nordic PPK II):

void fram_sleep(){
  Wire.beginTransmission(0xF8);
  Wire.write(0x50); // also have tried  Wire.write(0x50 << 1);
  Wire.write(0x86);  // also have tried Wire.write(0x8B);
  Wire.endTransmission(); 
}
void fram_wake(){
  Wire.beginTransmission(0x50); // ??  Wire.beginTransmission(0x50 << 1);
  delay(10);
  Wire.endTransmission(); 
}

I'm sure I'm being quite naive in some way - my understanding of how to use Wire is quite rudimentary.

Also - please

oops - accidentally deleted a bit at the end - was just goign to say please don't worry about this until you are able, and thanks for the pointers so far. Michael

No you do not press me at all, being ill is booooring.

If you want to learn I2C go to the site of Nick Gammon. His site will boost your knowledge.
google his name + i2c

@mbmorrissey
created branch - https://github.com/RobTillaart/FRAM_I2C/tree/develop - which implements a sleep() command.

According to datasheet every normal call will wake up the device.

Can you test it works?
e.g by means of a power test? some numbers would be great to add to the documentation.

Found some time to do a test

  • stand by: 10.21 uA
  • fram.clear(): 93.49 uA

Sleep command is not working :( need to investigate further.

@mbmorrissey
Found the cause why my FRAM module is not sleeping. it just does not support it. So I checked all data sheets I have and came to the following list below. Will be added to the readme.md file asap.

As I have no "sleep supporting" FRAM's I can only publish the sleep() and wakeup() as experimental and hope that in time someone will have the right device and will verify / confirm the working (or even fix it).

TYPE SIZE SLEEP (datasheet) CURRENT CONFIRMED
MB85RC04 512 N - N
MB85RC16 2 KB N - N
MB85RC64T 8 KB Y Page 11 4 uA N
MB85RC128A 16 KB N - N
MB85RC256V 32 KB N - N
MB85RC512T 64 KB Y Page 12 4 uA N
MB85RC1MT 128 KB Y Page 12 4 uA N

@mbmorrissey

I do have the MB85RC1MT. I’ll re-do my test, with another chip if I can find a prototyping board for it, and report back to you (probably tomorrow).
Michael On 14 Apr 2022, at 13:01,

Any progress made?

No problem, just asking.

@mbmorrissey
Thanks for this measurement, You showed the sleep function works as intended.
At the moment I have no further questions,

@mbmorrissey

After reading the readme again one question popped up.
You have a MB85RC1MT FRAM ==> 128 KB FRAM
As the library does use 16 bit addressing does this library work for that FRAM?
I think you cannot write to the upper half of the FRAM? Or can you?

If not can you please create a new issue for that?
Solution would be to increase the internal address administration to uint32_t

@mbmorrissey
Can you measure standby and clear() current? (low prio)

Thanks, I updated the readme.md with your numbers and will merge the sleep function (0.3.6)
Thereafter we can continue in the new issue #19