SPI question

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SPI question

688 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Richard Chen on Sat Jul 11 15:57:58 MST 2015
Hi all, I looked at the APIs in spi_18xx_43xx.h, like readData () and writeData (), I am puzzled how I can enter the addressing information for the slave device to access a specific location? Can someone shed some light on this? Is there any place where I can get some example code on how to use the SPI library support?

Thank you in advance!

Labels (1)
0 Kudos
Reply
4 Replies

638 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Richard Chen on Mon Jul 13 11:01:58 MST 2015
Thanks MC, is there any example code on how to use the APIs in spi_18xx_43xx.h? I have looked at the datasheet of the SPI flash that I am using, and understand its opcode and address width etc, however I wonder if I need to provide the callback functions to SPI_DATA_SETUP_T structure? I don't fully understand how these callback function will be used/called, and what they intent are etc, is there any document on them as well?

Thanks again for the help!
0 Kudos
Reply

638 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Mon Jul 13 09:54:31 MST 2015
Hi Richard,
Serial Flash has read/write commands. You will have to send first command and then address of the memory location. As suggested by martin please look memory datasheet.
0 Kudos
Reply

638 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Richard Chen on Mon Jul 13 09:17:18 MST 2015
Thanks Martin, yes I need to use SPI. You are correct that I need to look into the specific flash datasheet for the address information.

Thanks again.
0 Kudos
Reply

638 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by capiman on Sat Jul 11 23:59:09 MST 2015
Hi Richard,

SPI uses hardware signals (like a chip select CS) to access a certain device.
Are you sure you wanted to use SPI? Or are you searching for I2C?
Can you give more details?

If really SPI and perhaps a serial flash, then you must look into datasheet of your serial flash,
how it wants to bytes (perhaps included address information, commands, data).

Best regards,

Martin
0 Kudos
Reply