About MC9S08PA4 EEPROM Sample Code

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

About MC9S08PA4 EEPROM Sample Code

2,085 Views
JasonWood
Contributor I

Hello, 

      I'm Jason.I have got a project using MC9S08PA4.It needs to store some AD value for using to compare.But I have never use this MCU before.

      Pls send me a EEPORM sample code of Writing\Reading and Erasing Data  .Thank you.

      My Email is :      jiangxc@jwpow.com

Best  

         Regards!

0 Kudos
Reply
3 Replies

2,070 Views
vicentegomez
NXP TechSupport
NXP TechSupport

Please check the following application note 

 

I hope this will help you

https://www.nxp.com/docs/en/application-note/AN4570.pdf

 

Also check the labs here there is a sample that read-write on the eeprom

 

https://www.nxp.com/docs/en/supporting-information/TWR-S08PT60-LABS.zip

 

and

https://www.nxp.com/docs/en/supporting-information/TWRS08PT60LAB.pdf

 

Regards

Vicente Gomez

 

 

 

0 Kudos
Reply

2,045 Views
JasonWood
Contributor I

By the way ,

Does this function code need adding to the MCU Init?

JasonWood_0-1639470630182.png

 

0 Kudos
Reply

2,052 Views
JasonWood
Contributor I

HELLO,

I'm so glad to receive ur reply.

I have tried to use code to my project.But it seems work unsuccessfully.

I write the datas to EEPROM ,but read its data is still OXFF.

The codes U gave contain many fuctions.

JasonWood_0-1639462531353.png

Please tell which one I can use to erase and write.

Now I use fuctions as blow.

JasonWood_1-1639462653813.png

And I also read the MC9S08PA4 datasheet ,it tells me that EEPROM memory address is from 0X3100 to 0X31FF.So I called the functions like this ,Is that right? Glad to your retry ,Thank U!

JasonWood_2-1639462913891.png

Best 

Regard!

 

0 Kudos
Reply