SPI Bitbang routine to write into Cypress FRAM CY15E016Q

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

cross mob
ViPr_4836991
Level 1
Level 1
First reply posted Welcome!

Hello Community,

Greetings for the day!

Myself Vipul Prajapati working as Sr. Engineer at Eaton India Innovation Center, Pune, India for the Power system division group. This is with reference to get the details of standard bitbang SPI routine sample code to do word write into cypress FRAM - CY15E016Q.

We are currently working for a project which uses NXP Legacy automotive MCU (PN - M68HC16Z1). To support the ongoing firmware development, we would require to write SPI bitbang routine in existing FW which can write word by word data to FRAM chip. As this project is with legacy development, running from last 18 years with very limited MCU support, It would be difficult for us to write SPI routine which can do the job without affecting the existing FW.

Could you please help us to provide the sample SPI routine which can be utilize to write word by word data to FRAM chip CY15E016Q?   Thanks in advance!

0 Likes
1 Solution
6 Replies
PradiptaB_11
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 replies posted

Hi Vipul,

We do have SPI driver codes for various Microcontrollers but all of them use the SPI interface of the MCU. You can use the below link to check them out.

https://www.cypress.com/products/f-ram-nonvolatile-ferroelectric-ram

We do not have code example for bit banging with any MCU and our FRAM device currently. If you have composed any sample code maybe we can work on it with you and get it running.

You can follow the below algorithm to write your code. It is a general algorithm you will find for SPI bit banging on the web.

Make CS# low 
Short delay
Do 8 times to transfer i Byte of Data
  Make the SCK (Serial Clock) pin low
  Make the MOSI (Master-Out-Slave-In) pin high or low depending on bit 7 of the data 
  Add brief delay 
  Make the SCK output high
  Read MISO (Master-In-Slave-Out) pin
  Shift received data left, and shift the bit just read in as bit 0 
  Add brief delay 
  Shift the data byte 1 bit left

Make CS# high again 

Regards,

Pradipta.

0 Likes
lock attach
Attachments are accessible only for community members.

Hello Pradipta,

First of all, Thanks for the detailed updates.

https://www.cypress.com/products/f-ram-nonvolatile-ferroelectric-ram - I could not able to find out sample code from this link.

Apart from this, I got a Bitbang SPI sample code from NXP community(Attached here) which is compatible to my NXP controller but not sure about Cypress FRAM whether it would work or not. It would be functional with few changes in code snippet but I'm not familiar with the Bitbanging of SPI right now. It would be appreciable, if I could get some support to develop SPI bitbang (or SPI itself) to read/write operation of the project. Thanks in Advance Pradipta.

0 Likes

Hello Support, Could you please update me on same? Thanks in advance.

0 Likes

Any updates on this? 

0 Likes

Hi,

Kindly use the below resources for SPI guidelines for FRAM. We have also included our development kit guides for you to check and find the code examples related to them. 

https://www.cypress.com/documentation/application-notes/an304-spi-guide-f-ram

https://www.cypress.com/documentation/development-kitsboards/cy15framkit-001-serial-f-ram-developmen...

https://www.cypress.com/documentation/development-kitsboards/cy15framkit-002-f-ram-development-kit?s...

Thanks,

Pradipta.

0 Likes

Thanks a ton Pradipta! 

0 Likes