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!
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.
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
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
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.