Hi there, I have been trying to benchmark the SPI bus on my Teensy LC and reproduce some of the results in:
https://forum.pjrc.com/threads/27689-Teensy-LC-Beta-Testing/page3
https://github.com/manitou48/DUEZoo/blob/master/SPIperf.txt
I switched from SPI to SPI1 to get 24 MHz clock, but I couldn't get SPI1 transfer(void *buf, size_t count) to work with my code - the function hangs on the last line in SPI.h:
inline static void transfer(void *buf, size_t count) {
...
*p = SPDR;
}
Looking at the sources in benchmark:
https://github.com/manitou48/teensy3/blob/master/spi1perf.ino
the implementation of spi1_transfer(void *buf, size_t count) is identical to transfer(void *buf, size_t count) apart from the last line, where:
inline static void transfer(void *buf, size_t count) {
...
*p = SPI1_DL;
}
I replaced *p = SPDR with *p = SPI1_DL in transfer(void *buf, size_t count) of SPI1Class and everything seems to be working correctly as far as I can tell.
Many thanks!
P.S.
If that helps, I seem to recall that transfer(void *buf, size_t count) in SPIClass (not SPI1Class) works correctly.
Hi there, I have been trying to benchmark the SPI bus on my Teensy LC and reproduce some of the results in:
https://forum.pjrc.com/threads/27689-Teensy-LC-Beta-Testing/page3
https://github.com/manitou48/DUEZoo/blob/master/SPIperf.txt
I switched from SPI to SPI1 to get 24 MHz clock, but I couldn't get SPI1
transfer(void *buf, size_t count)to work with my code - the function hangs on the last line inSPI.h:Looking at the sources in benchmark:
https://github.com/manitou48/teensy3/blob/master/spi1perf.ino
the implementation of
spi1_transfer(void *buf, size_t count)is identical totransfer(void *buf, size_t count)apart from the last line, where:I replaced
*p = SPDRwith*p = SPI1_DLintransfer(void *buf, size_t count)ofSPI1Classand everything seems to be working correctly as far as I can tell.Many thanks!
P.S.
If that helps, I seem to recall that
transfer(void *buf, size_t count)inSPIClass(notSPI1Class) works correctly.