Can I2C\SPI be used with a constant clock signal?

Status
Not open for further replies.

kdharbert

Well-known member
I believe hardware I2C and SPI only activate the CLK train when a call is made. Two questions:
1. Does it adversely effect the SPI\I2C protocol if the CLK pulse never stops?
2. Can the Teensy SPI libraries be configured to keep the CLK train constantly active?
 
SPI transfers zeroes then. Normally, this is not wanted. And it would be not easy to get the timing right for chipselects (If not using a "hardware" cs)
I2C sends zero messages with adress zero... don't know what that would be good for..
 
constant (if your using only one device on that port, unless you switch between devices i guess) is possible. SPI_MST as example constantly pulses the clock by sending data for 2-way communication between teensies

thats just a custom protocol of course, you can manage the data how you want
 
I forgot to say that yes, there is likely to be only one device.
I don't know what SPI_MST is. I thought 'Teensy as SPI Slave' was not supported.
 
The Wire & SPI libraries don't have a way to enable a constant clock.

But you can get a constant clock very easily with analogWriteFrequency() and analogWrite(), if you just want a clock signal for something external.

If you want to get continuous data transfer, SPI makes a lot more sense than I2C. But you'll need to dive into the low-level register access and write you own library / driver code.
 
Status
Not open for further replies.
Back
Top