[D-FLASH] What difference of accessing time between D-Flash and Ram?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[D-FLASH] What difference of accessing time between D-Flash and Ram?

Jump to solution
1,141 Views
Pogo
Contributor III

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

Labels (1)
0 Kudos
Reply
1 Solution
851 Views
kef
Specialist I

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];

 

View solution in original post

0 Kudos
Reply
2 Replies
852 Views
kef
Specialist I

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];

 

0 Kudos
Reply
851 Views
Pogo
Contributor III

Hi kef,

 

Thanks for your reply. 

 

 

Pogo

0 Kudos
Reply