How to read and write EEPROM ?!?!

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to read and write EEPROM ?!?!

ソリューションへジャンプ
1,236件の閲覧回数
wendersonolivei
Contributor IV

Hi guys, pleas help me!

 

I should make a project with mc9s08pa16, but i don't know how i program in C the read and write on eeprom. I tried make this with ProcessorExpert, where they give me the funcitons setbyte, get byte.. but i don't know how i use that. I have to use ProcessorExpert? or have another way? and what is the codes?

Thank you!

ラベル(1)
1 解決策
878件の閲覧回数
weapon
Senior Contributor I

Hi Oliveira,

I attached one sample code for your reference.  The EEPROM routines are at the bottom of  flash.c(\TWR-S08PT60_Flash_Lab_v6\src\drivers\nvm).

Any doubt in using those routines, feel free to contact with me.

元の投稿で解決策を見る

4 返答(返信)
879件の閲覧回数
weapon
Senior Contributor I

Hi Oliveira,

I attached one sample code for your reference.  The EEPROM routines are at the bottom of  flash.c(\TWR-S08PT60_Flash_Lab_v6\src\drivers\nvm).

Any doubt in using those routines, feel free to contact with me.

878件の閲覧回数
robertobabicz
Contributor I

Weiping Xu,

I'm developing a product with a microprocessor MC9S08PA4.

With 512 bytes of RAM.

I was watching the project: TWR-S08PT60_Flash_lab_v6.

I understand the management of the Flash and EEPROM memory.

But I see that it uses a lot of RAM to run the routines of writing and erasing flash.

I have only 512 bytes of RAM in the MC9S08PA4.

Using only the routines:

Flash_Program1LongWord

Flash_EraseSector

Occupy 299 bytes of RAM!

Am I right?

Is there another way to write the flash with the PA4 and not have to use as much RAM?

I worked with QD4 with only 256 Bytes of RAM and features doonstack.asm had no problems.

I hope you can help me,

cordially

Roberto.

0 件の賞賛
返信
878件の閲覧回数
robertobabicz
Contributor I

Weiping Xu,

Now solve the problem, run the following lines only in RAM.

NVM_FSTAT = 0x80;

while (!(NVM_FSTAT & NVM_FSTAT_CCIF_MASK));


The other lines run from the Flash.


Thank you!


Roberto

0 件の賞賛
返信
878件の閲覧回数
wendersonolivei
Contributor IV

That's helped me very much! Thank you Xu

0 件の賞賛
返信