Hi All,
I'm using MC9S12XS128 and save some parameters in D-Flash. My question is do I need to copy those parameters into ram? If I use those parameters directly accessing D-Flash, does it has enough efficiency? What difference of accessing time between D-Flash and Ram?
Pogo
Solved! Go to Solution.
In S12SX flash module chapter in datasheet it is said:
"Read access time is one bus cycle for bytes and aligned words, and two bus cycles for misaligned words."
Unfortunately I don't find any mention about RAM acces times in new parts datasheets, but in older S12 datasheets it is said :
"the internal RAM is specifically designed to allow misaligned 16-bit accesses in a single cycle". I hope that RAM in newer S12X parts is not worse than this, e.g. that it allows misaligned word reads, aligned words reads and byte reads in single bus cycle. If that's the case, then reads from flash should be as fast as reads from RAM, provided data is word aligned. So there's no need to copy your data from flash to RAM, but it makes sense to align your data in flash. In CodeWarrior you can do this for specific flash segments like this:
ROM_4000 = READ_ONLY 0x4000 TO 0x7FFF ALIGN 2[1:1];
In S12SX flash module chapter in datasheet it is said:
"Read access time is one bus cycle for bytes and aligned words, and two bus cycles for misaligned words."
Unfortunately I don't find any mention about RAM acces times in new parts datasheets, but in older S12 datasheets it is said :
"the internal RAM is specifically designed to allow misaligned 16-bit accesses in a single cycle". I hope that RAM in newer S12X parts is not worse than this, e.g. that it allows misaligned word reads, aligned words reads and byte reads in single bus cycle. If that's the case, then reads from flash should be as fast as reads from RAM, provided data is word aligned. So there's no need to copy your data from flash to RAM, but it makes sense to align your data in flash. In CodeWarrior you can do this for specific flash segments like this:
ROM_4000 = READ_ONLY 0x4000 TO 0x7FFF ALIGN 2[1:1];
Hi kef,
Thanks for your reply.
Pogo