1267 views|2 replies

1w

Posts

16

Resources
The OP
 

[RTT & Infineon PSoC6 evaluation board (with touch)] 10, emulated EEPROM test [Copy link]

Use the FLASH inside the microcontroller to emulate EEPROM, which can save an EEPROM chip. After all, the main thing now is to make money to eat.

Select New Project in Modustoolbox, then select the -062S2 board, and choose to create a Modustoolbox APP project:

Select: EEPROM

After building the project, directly remove cycfg_system.c and remove a define: //#define CY_CFG_SYSCLK_WCO_ENABLED 1

Then compile and run:

You can see that every time I restart, the number increases by 1. This means that the EEPROM simulation is successful.

This program can be seen in the Modustoolbox environment:

 /* The EEPROM content is valid. Increment Counter by 1. */
        eeprom_read_array[RESET_COUNT_LOCATION+1]++;

        /* Counter is in ASCII, so handle overflow. */
        if(eeprom_read_array[RESET_COUNT_LOCATION+1] > ASCII_NINE)
        {
            /* Set lower digit to zero. */
            eeprom_read_array[RESET_COUNT_LOCATION+1] = ASCII_ZERO;
            /* Increment upper digit. */
            eeprom_read_array[RESET_COUNT_LOCATION]++;

            /* only increment to 99. */
            if(eeprom_read_array[RESET_COUNT_LOCATION] > ASCII_NINE)
            {
                eeprom_read_array[RESET_COUNT_LOCATION] = ASCII_NINE;
                eeprom_read_array[RESET_COUNT_LOCATION+1] = ASCII_NINE;
            }
        }

        /* Only update the two count values in the EEPROM. */
        eeprom_return_value = Cy_Em_EEPROM_Write(RESET_COUNT_LOCATION,
                                               &eeprom_read_array[RESET_COUNT_LOCATION],
                                               RESET_COUNT_SIZE,
                                               &Em_EEPROM_context);
        handle_error(eeprom_return_value, "Emulated EEPROM Write failed \r\n");

This post is from Embedded System

Latest reply

Cost is king now, and saving an EEPROM chip is very cost-effective.   Details Published on 2023-7-23 20:10
Personal signaturehttp://shop34182318.taobao.com/
https://shop436095304.taobao.com/?spm=a230r.7195193.1997079397.37.69fe60dfT705yr

1663

Posts

0

Resources
2
 

Cost is king now, and saving an EEPROM chip is very cost-effective.

This post is from Embedded System

Comments

As long as the program is not too large, Flash is useless.  Details Published on 2023-7-23 21:58
 
 

1w

Posts

16

Resources
3
 
Hot Ximi Show posted on 2023-7-23 20:10 Cost is king now, and it is very cost-effective to save an EEPROM chip

As long as the program is not too large, Flash is useless.

This post is from Embedded System
 
Personal signaturehttp://shop34182318.taobao.com/
https://shop436095304.taobao.com/?spm=a230r.7195193.1997079397.37.69fe60dfT705yr
 
 

Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list