cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC™ 5, 3 & 1

Eugenio966
New Contributor

Hello,

I need support for the topic in subject.

For the user module E2PROMx128_1 in PSOC 5.4  currently we use the CY8C20237 with below configuration:

Parameters - E2PROMx128_1

Name:               E2PROMx128_1

Version:            1.1

FirstBlock:       62

Lenght:             128

Can I use same configuration also for the CY8C20247?

Many thanks

Eugenio

 

0 Likes
1 Solution
SampathS_11
Moderator
Moderator

Hello @Eugenio966 ,

You need not change the code in anyway. E2PROM User Module calculates the flash address from the first block parameter. The E2PROM read and write routines take only an offset, which can range from 0 to Length - 1. If the First Block is placed at 62, the flash address will be (62*127 + Offset passed to read or write functions). So the code written already will not change.

You can keep the Length parameter as is.

There is nothing wrong if you leave the E2PROM placed in the center of memory. In case your program gets larger and larger, eventually it will occupy the E2PROM flash area. Right now there is no danger of this happening, since ROM utilization is only 31%. You will have to be cautious when it comes near about 49% (63/128*100).

Best regards,

Sampath Selvaraj

View solution in original post

0 Likes
5 Replies
SampathS_11
Moderator
Moderator

Hello @Eugenio966 ,

CY8C2023is an 8K Flash part, while CY8C20247 is a 16K part. While you can use the same parameters for the CY8C20247, kindly note that it will be near to the center of the flash memory space in  CY8C20247. Hence, I recommend you to kindly use 126 for the first block parameter, so that the E2PROM space resides near the end of flash memory as is done conventionally. 127 is the index of the last block of flash in CY8C20247.

Best regards,

Sampath Selvaraj

Eugenio966
New Contributor

Hello Sampath,

 

can you please help with current request?

I didn't get any response to my second question.

0 Likes
Eugenio966
New Contributor

Hello Sampath,

many thanks for your support!

Which kinnd of problem we could have if we leave the E2PROM close to the center of the memory?

Our program is very small in size. See the message from the compiler:

ROM 31% full. 4966 out of 16384 bytes used (does not include absolute areas).
RAM 4% full. 68 bytes used (does not include stack usage).

If we change the FirstBlock we should change the code as well because we use pragma allocation and we would not like to do (see below code instructions accordingly):

....

value_for_variable = 1.5*CSD_1_waSnsResult[1] - CSD_1_waSnsResult[0] - 3550;
if (lvd_occurred != TRUE)
{

bError = E2PROMx128_1_bE2Write(0, (unsigned char *)&value_for_variable, 2, 25);
}
}
.....

How should we change the code in that case?

And in addition what should we put in the parameter: Lenght             

 

0 Likes
SampathS_11
Moderator
Moderator

Hello @Eugenio966 ,

You need not change the code in anyway. E2PROM User Module calculates the flash address from the first block parameter. The E2PROM read and write routines take only an offset, which can range from 0 to Length - 1. If the First Block is placed at 62, the flash address will be (62*127 + Offset passed to read or write functions). So the code written already will not change.

You can keep the Length parameter as is.

There is nothing wrong if you leave the E2PROM placed in the center of memory. In case your program gets larger and larger, eventually it will occupy the E2PROM flash area. Right now there is no danger of this happening, since ROM utilization is only 31%. You will have to be cautious when it comes near about 49% (63/128*100).

Best regards,

Sampath Selvaraj

View solution in original post

0 Likes
Eugenio966
New Contributor

Hi Sampath!

Many thanks for your help!

Eugenio

0 Likes