state of PIC SRAM on boot

Greetings,

What is the state of the PIC SRAM on power up? Random value, determined value, last set value? Long ago I thought I'd read that unlike DRAM, SRAM maintains its values on power down, but I cannot find a reference to that at the moment.

--
Kyle A. York
Sr. Subordinate Grunt
Reply to
kyle york
Loading thread data ...

This is totally wrong.

These is _no_ RAM of any kind that will maintain its values on power down.

ROM yes, RAM no.

So, you did not read this anywhere.

Some RAM chips may power up in the same state as the last time it was powered up, but it is not guaranteed.

donald

Reply to
Donald

This is totally wrong. FRAM, and core - for similar reasons - maintain their values on power down.

Reply to
larwe

It's not guaranteed to be anything in particular. Chances are it's far from random, and if the power down was brief, or incomplete, probably influenced to a certain extent by the previous states.

Best regards, Spehro Pefhany

--
"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

FRAM != RAM

Reply to
Donald

Guess what:

"FRAM offers features consistent with a RAM technology, but is nonvolatile like a ROM technology. FRAM bridges the gap between the two categories and creates something completely new -- a nonvolatile RAM."

Parallel FRAM looks pretty much exactly like SRAM from the system's perspective; it is a drop-in replacement. e.g. is a direct drop-in for a 62256 32Kx8 SRAM.

Not that the OP isn't on crack, of course, but your statement isn't absolutely right, which is why it irked me to see it advertised as such.

Reply to
larwe

and to confuse you all even more, have a look a Maxims high security "Low imprinting" SRAM technology.

Yes, seems SRAM is not truly random on power off, but does have a statistical bias based on what was there last time.... Not good enough to get 100% data back, but I'm sure cracking teams would love to have a 'better seed' than a random starting point.

Not likely to matter much, in the average PIC project :)

-jg

Reply to
Jim Granville

Thanks for straightening me out everyone. I was hoping it would be either maintained or in a somewhat random state so I could use it as a seed to a PRNG.

--
Kyle A. York
Sr. Subordinate Grunt
Reply to
kyle york

If you need to store something many PICs have built in EEPROM or Self programable Flash

Reply to
Neil

There are ways to take semi-random data and create random data from it using some kind of hash. Proably the simplest is applying an XOR function something along the lines of:

int gen_seed(int array[], unsigned length) { int value = array[0];

while(--length) value ^= array[length];

return value; }

Provided that length is large enough, any underlying tendencies of memory bits to favour one value or the other are soon swamped by the randomness present in other bits. I have a mathematical analysis of the above code somewhere that states how long length must be to create a truly random number, based on how strong the tendencies are. I'll have a look around and see if I can dig it up.

Of course, hardware random number generation needn't be particularly complex: see

formatting link
for an example.

--
Andrew Smallshaw
andrews@sdf.lonestar.org
Reply to
Andrew Smallshaw

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.