Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 25 of 25

Thread: SPISlave_T4

Threaded View

  1. #1
    Senior Member
    Join Date
    Dec 2016
    Montreal, Canada


    SPISlave_T4 has been released!

    You may download it at
    An example is supplied as well.

    It is based on TSPISlave for Teensy 3.x, except it has an additional feature. Not using a callback will print out data being received to serial monitor.

    So far Teensy 4.0/4.1 are supported for SPI only on pins 10, 11, 12, 13. No additional pins needed (well, common ground is obviously a plus).

    I don't have the SPI1 or SPI2 pins broken out, but the library can easily support them as I am accessing the memory blocks directly with calculated offsets, rather than independant register names. Until then, SPI. is only supported.

    My setup consisted of a Teensy LC SPI master sending data to a Teensy 4.0 slave.
    Pin layout for SPI:
    LC      T4
    12      11
    11      12
    10      10
    13      13
    No alternate pins are broken out for SPI on Teensy 4.0/4.1.
    Slave mode on Teensy 4 supports 8, 16, and 32bit transfers selectable in the constructor. Note that if you set 16 or 32bits, you need to send all the bits. Like for 16 bit you need to send 2x8bit transfers or one transfer16, or 4x 8bit transfers for 32bit or 2x transfer16's for 32bit.

    Last edited by tonton81; 02-25-2021 at 03:52 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts