ben10teensy
Well-known member
To better understand the logic of SPI devices I have some questions that may also be helpful to others with the same confusion.
Also my device does not have a written library.
This link is to the teensy spi information:
https://www.pjrc.com/teensy/td_libs_SPI.html
From reading this over I want to understand whats going on, on the basic usage
SPI.begin() ## This starts the SPI
SPI.beginTransaction(SPISettings(clockspeed, MSBFIRST, SPI_MODE0)) ## This sets SPI settings
digitalWrite(SSpin, LOW) ## This Sets the Chipselect pin LOW or HIGH depending on the device to start that particular device communication
SPI.transfer(data) ## This sends data to What?
SPI.endTransaction() ## this terminates the SPI
My device has Register Banks, and Addresses.
would I code this
SPI.transfer(BANK)
then I could read through the registers with
SPI.transfer(register)
If i have 3 registers , How would I read a particular register?
a = SPI.transfer(register)
thanks for the help
Also my device does not have a written library.
This link is to the teensy spi information:
https://www.pjrc.com/teensy/td_libs_SPI.html
From reading this over I want to understand whats going on, on the basic usage
SPI.begin() ## This starts the SPI
SPI.beginTransaction(SPISettings(clockspeed, MSBFIRST, SPI_MODE0)) ## This sets SPI settings
digitalWrite(SSpin, LOW) ## This Sets the Chipselect pin LOW or HIGH depending on the device to start that particular device communication
SPI.transfer(data) ## This sends data to What?
SPI.endTransaction() ## this terminates the SPI
My device has Register Banks, and Addresses.
would I code this
SPI.transfer(BANK)
then I could read through the registers with
SPI.transfer(register)
If i have 3 registers , How would I read a particular register?
a = SPI.transfer(register)
thanks for the help