Simple Startup Routine using EEPROM: FRDM-K22F

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

Simple Startup Routine using EEPROM: FRDM-K22F

1,223 次查看
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 项奖励
回复
2 回复数

1,119 次查看
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

1,119 次查看
briancavanagh
Contributor III

Hi Jing, 

Thanks for helping.

Brian

0 项奖励
回复