Simple Startup Routine using EEPROM: FRDM-K22F

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

Simple Startup Routine using EEPROM: FRDM-K22F

562 Views
briancavanagh
Contributor III

Hi, without going into a lot of details, I'm trying to figure out how to write a routine that resembles the flow chart below.

I have one button connected to my circuit board that is used to turn-on and/or turn-off the power.  

After the button is held down for 2 seconds I would like the routine to read EEPROM and determine if the value is "0".  This would indicated the unit was previously off, as a result, write a "1" to eeprom.  Conversely, if the value is "1", the unit was previously on, write a "0" to eeprom.  

Note, the circuitry is configured in such a way that when the button is pressed it will energize the uC immediately so this routine can be carried out. (If the uC is already on, the routine will be triggered).  I do have an "power enable pin" on the LDO that I will set depending on the reading from EEPROM (I believe with the K22F uC, this is called NVM?)

Thanks,

Brian

 

 

pastedImage_2.png

0 Kudos
2 Replies

458 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi Brian,

The main chip on FRDM-K22F is K22FN512VLH12 or K22FN128VLH10. They don't support FlexMemory function. It means they haven't eeprom function.

Regards

Jing

458 Views
briancavanagh
Contributor III

Hi Jing, 

Thanks for helping.

Brian

0 Kudos