Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

PSoC™ 4 Forum Discussions

MaPe_1936286
Level 3
Level 3
First like received First like given Welcome!

Hi,

I need to interface a PSoC4 to a Serial I2C EERAM 47C16 from Microchip.

In PSoC Creator the Serial NVRAM component can handle almost anything about the communication.

However, I have a limitation with the function which writes the Memory Control Register ( SerialNVRAM_1_MemCtrlRegWrite).

This function allows to write a dataByte to the SerialNVRAM_MEM_CTR_REG_ADDR which is fixed to 0.

But for the EERAM 47C16 there is also a second Memory Control Register whose address is 0x55 (this is a command register) and it allows to send Store and Recall commands and with the API provided it is not possible to access it.

So I ask some suggestions, how can I extend the Serial NVRAM component functionality ?

1) Is there a way to modify or add a new function to the Generated Source?

2) Or is it better to copy and paste the SerialNVRAM_1_MemCtrlRegWrite function to my project code, change the name and modify ?

3) Or is it possible (maybe) to request an extension of the component to the PSoC Creator developers?

Best Regards

Maurizio

0 Likes
1 Solution
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

Hello Maurizio,

Yes, you can extend the functionality by making modifications to the Generated Source files. In the header file SerialNVRAM_1.h you can add another #define for the second memory control register (let's call it SerialNVRAM_I2C_MEM_CTR_REG2_ADDR).

And, then modify/add functions to write to the second memory control register (SerialNVRAM_I2C_MEM_CTR_REG2_ADDR) instead of SerialNVRAM_MEM_CTR_REG_ADDR in SerialNVRAM_1.c file.

After this right click on the project > Build Settings > Code Generation > Skip Code Generation > True. This will ensure all your changes aren't lost when you build the project.

Regards,
Dheeraj

View solution in original post

2 Replies
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

Hello Maurizio,

Yes, you can extend the functionality by making modifications to the Generated Source files. In the header file SerialNVRAM_1.h you can add another #define for the second memory control register (let's call it SerialNVRAM_I2C_MEM_CTR_REG2_ADDR).

And, then modify/add functions to write to the second memory control register (SerialNVRAM_I2C_MEM_CTR_REG2_ADDR) instead of SerialNVRAM_MEM_CTR_REG_ADDR in SerialNVRAM_1.c file.

After this right click on the project > Build Settings > Code Generation > Skip Code Generation > True. This will ensure all your changes aren't lost when you build the project.

Regards,
Dheeraj

Thank you Dheeraj

Regards

Maurizio

0 Likes