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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
1,140 次查看
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

标签 (1)
0 项奖励
回复
1 解答
850 次查看
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 项奖励
回复
2 回复数
851 次查看
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 项奖励
回复
850 次查看
Pogo
Contributor III

Hi kef,

 

Thanks for your reply. 

 

 

Pogo

0 项奖励
回复