Read/Writing to a FRAM - diyAudio
Go Back   Home > Forums > Design & Build > Parts

Parts Where to get, and how to make the best bits. PCB's, caps, transformers, etc.

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 10th March 2011, 02:42 PM   #1
Unkle77 is offline Unkle77  England
diyAudio Member
 
Join Date: Feb 2006
Location: The Green Belt
Default Read/Writing to a FRAM

Hi everyone,

I'm working on a digital control system to work with amplifiers and I need to read and write to a FRAM chip using a microcontroller. I'm new to the world of writing to memory devices so I'm not to sure how to structure it in C.

The datasheet is here:
http://www.ramtron.com/files/datashe...L16ds_r1.2.pdf

Now for the reading I can see that there is a data holding time and data accessing time when the address is changed, meaning this can easily be set up with delays.

but the writing process can not be controlled solely by changing address (while holding WE and CE down)?

From this I take it that the easiest way to write to these devices is to toggle the WE pin after the address has been selected.

Thanks for the help
  Reply With Quote
Old 10th March 2011, 04:55 PM   #2
Banned
 
Join Date: Jan 2008
Blog Entries: 2
Quote:
Originally Posted by Unkle77 View Post
but the writing process can not be controlled solely by changing address (while holding WE and CE down)?
It does seem to suggest that you can write by just changing address on the first page, but this may just be the column address A1:0.

You can see the write cycle timing on page 11 of the datasheet, and on page 4, 'Writes occur in the FM22L16 in the same time interval as reads. The FM22L16 supports both /CE- and /WE-controlled write cycles. In both cases, the address A(17:2) is latched on the falling edge of /CE.'

You just need to read the datasheet in detail. It's got a paging address system, addresses A17:2 are latched and A1:0 select one of 4 bytes for fast access. There are also upper (/UB) and lower (/LB) byte enables.

It's probably best to write that bit of the code in inline assembler to guarantee the timing. Otherwise you want to be able to examine the assembly language before it goes to the linker, or whatever, depending on the workflow of the particular compiler and device.

A bit of experimentation usually clarifies what is going on. You might want to build a prototype jig to work out any problems. You can build on some LEDs for debugging. A scope helps, and a logic analyser is better but unless it's a complex system most issues can be worked out with a bit of ingenuity. You can even use switches to latch data in and out to make sure things are working the way you think.

Which controller/processor are you intending to use? Obviously some have dedicated address, data and memory pins, some are self contained in terms of program memory and just have I/O pins. Why do you need this part? Most microcontrollers have some static memory onboard.

w
  Reply With Quote
Old 11th March 2011, 12:35 AM   #3
bill_a is offline bill_a  United States
diyAudio Member
 
Join Date: Aug 2009
Location: Seattle
Unk,
I'm not sure why you would want to go through the hassle of using FRAM. There's a good reason they haven't been adopted more widely by industry.... ;-)

If you need non-volatile memory and have a choice, why not serial flash or battery-backed static RAM? Both are much easier to interface to a micro and are much easier to write software for.

Just a thought...
Bill
  Reply With Quote
Old 16th March 2011, 09:47 PM   #4
Unkle77 is offline Unkle77  England
diyAudio Member
 
Join Date: Feb 2006
Location: The Green Belt
Thanks wakibaki, I had read through the data sheet but it did not seem to make sense to me at the time, now with you comments its make much more sense!

I've already got the parts so I will go ahead and start experimenting, thanks for the suggestions on building a prototype jig, pretty sure this will be indispensable.

I will be using the MPLAB IDE so will have access to assembly code, I'm hoping I don't need this though.

I will let you know how i get on soon
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
need help writing an amp class unclejed613 Solid State 4 13th September 2010 01:54 PM
bonding/sealing magnet to speaker fram jamikl Full Range 1 9th October 2009 04:37 AM
Manual writing 101 a must read. Zero Cool Pass Labs 0 11th January 2007 08:23 PM
writing on chassis benny Everything Else 22 4th November 2006 02:57 PM
Writing Songs!!! Skitch Music 3 27th February 2003 01:11 PM


New To Site? Need Help?

All times are GMT. The time now is 05:58 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright ©1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2