Page 3 of 3

Re: FRAM COMPONENT

Posted: Mon Dec 22, 2025 12:09 pm
by BenR
I have implemented a component for v11 which is now tested and working.

I've not looked at Martin's code yet and so there may be things there that would be good to bring into the component but let me know if there's anything lacking.

As always many thanks to Martin for providing his time to give a v10 solution for the community.

Re: FRAM COMPONENT

Posted: Mon Dec 22, 2025 5:04 pm
by max.tisc
Hi,
great work, will you also make a version for FC10?

Re: FRAM COMPONENT

Posted: Mon Dec 22, 2025 10:46 pm
by BenR
Hello,

I probably won't release for v10 no.

But there's likely not a lot I can do if you were to download the component in v11 and transfer it into v10 yourself ;)

Re: FRAM COMPONENT

Posted: Tue Dec 23, 2025 8:45 pm
by mnfisher
Thanks Ben,

Is the component source on the wiki yet? - I did have a brief look and didn't find it...

Martin

Re: FRAM COMPONENT

Posted: Tue Dec 23, 2025 9:03 pm
by BenR
Hi Martin,

Thanks for letting me know. I have now pushed all the latest component changes to the wiki and written a script so filtering out all the bits that need pushing is now far easier to keep track of :D

I need to refresh the main components index page which I'll do in the new year but all the new component pages and source files should be up to date now.

Here's the page you were looking for.
https://www.flowcode.co.uk/wiki/index.p ... C_(EEPROM)

Re: FRAM COMPONENT

Posted: Sun Dec 28, 2025 6:59 pm
by mnfisher
Thanks Ben - will take a look...

This is where I got to - now with a Write String, Int and Long array macros - and their read equivalents.
Tested on an Arduino (but also compiled for a PIC16F18877) using v10.

Have tested the (and here using just 4 value writes) - Int and Long versions. And looks good at UART and on logic analyser.

The String read is actually the slowest - and here are two versions - one which will read to a maximum number of bytes and one which looks for the termination character (\0)

Note that the arduino stores data in memory is LSB..MSB format - so values written as an int for '1' - is 1, 0 - but the FRAM chip expects the address in MSB LSB format - so address 1000 is 3, 0xE8 - which looks odd (on the 'scope) - but is correct (and the read will work - as long as you don't try and change types - or change MCUs :-) )

The WriteLongArray - the argument is MX_UINT32 **PFCL_DATA - which might vary with different MCUs?

Martin

Re: FRAM COMPONENT

Posted: Mon Jan 05, 2026 10:25 am
by max.tisc
Hi, happy new year
I'm testing the FRAM component with FC V10. If I write and read a single address like in the WIKI example, it works. But if I try to write and reread a series of data, it always returns the same value. Like in the example I did, if I write 10 addresses from 0 to 9, with data from 0 to 9 (address 0 given 0, address 1 given 1, etc.), when I read them back, I always get 9. If I change the number of addresses to 15, I always read 14. Using the analyzer, it seems to write to the right address and read to the right address, but it always reads the same value. Is the disablewriteprotect function called every time a write is needed, or is just one time enough? On my board, I saw that there's a writeprotect pin that I grounded to enable writing. Is this enough?
I can't load the terminal screen, which shows the value 9 for all the addresses read.
thank's

Re: FRAM COMPONENT

Posted: Mon Jan 05, 2026 1:42 pm
by BenR
Ok let me investigate for you.

Re: FRAM COMPONENT

Posted: Thu Jan 15, 2026 2:08 pm
by BenR
Hello,

Sorry this has taken a while, I've now managed to replicate the issue and resolve it. Was to do with the address bits for the devices which were being calculated incorrectly. Hopefully all the byte counts and address bits are now correct.

Re: FRAM COMPONENT

Posted: Sat Jan 17, 2026 5:24 pm
by max.tisc
Thanks BenR it works now