SPI pins of each ports

The Teensy 4.1 CARD ideally delivered with the Teensy, or linked on PJRC.COM, shows pins associated with SPI and SPI1 on the front and SPI2 on the bottom.

The color code for SPI is 'green bubbles' around SCK/MOSI/MISO in BOLDand the CS indicated are usable but often any free pin can be used for CS.
Those for SPI1 and SPI2 have that # digit appended to the pin function name noted above.

Any secondary SPI pins that can be used as alternates are in green bubbles, but not BOLD, and their usage requires appropriate SET commands to use them instead.
 
I don't really understand what help you really need.

Maybe you're asking in general how to connect SPI chips? Perhaps this article can help?

https://www.pjrc.com/better-spi-bus-design-in-3-steps/

Maybe you're asking which specific pins on Teensy 4.1 are SPI? This info is show on the pinout reference card which should have come with your Teensy 4.1. It's also on the Teensy 4.1 product page. The SPI signals are shown in green.

https://www.pjrc.com/store/teensy41.html#pins

Here are the PDF files

https://www.pjrc.com/teensy/card11a_rev4_web.pdf

https://www.pjrc.com/teensy/card11b_rev4_web.pdf

Or maybe you're asking how to use various hardware with different SPI ports. That sort of answer depends on the software libraries. For example, with SD cards you would use the SdFat begin function, as shown in this example (which you can open in Arduino by clicking File > Examples > SD > SdFat_Usage)

https://github.com/PaulStoffregen/SD/blob/Juse_Use_SdFat/examples/SdFat_Usage/SdFat_Usage.ino

To give you a visual idea of this usage for the specific hardware pins, these forum threads have photos of a SD card connected to the alternate SPI pins (normally pins 11,12,13 are used).

https://forum.pjrc.com/threads/69254?p=297875&viewfull=1#post297875

https://forum.pjrc.com/threads/60954?p=303782&viewfull=1#post303782

If your question was about how to connect to those other SPI ports, hopefully these photos can show you how and confirm any doubt that those other SPI ports really do work.

But if none of this really answered your question... well, I tried to cover some bases because I really don't know specifically what you wanted. If you can be more specific, odds are good I or other here could help you better.
 
To be more clear I need to plug 6 spi devices. As I know Teensy 4.1 only 3 spi ports.
Chatgpt has suggested use an 3 wire aproach and use something like in the picture.
Teensy.jpg
I'm not sure if this is correct.
I'm also in doubt about the real amount of SPI ports, and the names of the pins.
One Teensy will act as DSP,
Another Teensy will act as USB audio class 2 device.
The rest of the devices will be adc/dac modules.
 
Last edited:
Can you be more specific about the devices involved? These details matter! Your picture seems to show connecting 3 Teensy boards together, but the wires are connected in random places which aren't even SPI pins (the sort of utterly wrong answer one could expect from ChatGPT).

Communication between 2 or more Teensy is a very different project than communicating between Teensy and 5 SPI peripheral chips. The type of devices matters. We can help you much better when you give specific details.
 
No, Is 2 Teensy 4.1 more 4 ADC/DAC modules comunicating with another Teensy 4.1(acting as hub), so 6 spi devices(2 teensy 4.1, 4 adc/dac) comunicating with one Teensy(the hub).
Its more a thing like this
Teensy.jpg
But you could use 6 teensy as example.
 
Last edited:
Use any adc/dac chip for audio as example(I havent decided yet but i would like that it would be one listed here https://freedsp.github.io/ called AnalogIO x8(more detail in github link https://github.com/freeDSP/freeDSPx-AnalogIO-x8)). The adc/dac chips used are AKM AK5558, the DAC are AKM AK4458.
Details matter. Can you at least say the part numbers of the other 4 chips?
The model name is the part number in both(mfr part number of AKM AK5558 is AK5558, mfr part number of AKM AK4458 is AK4458)
The question is how to make more space on the SPI connection for anything else, so it is not very relevant which chip.
 
Last edited:
Those are audio ADC and DAC chips which use I2S or TDM protocol. They are not SPI.

You can use them with Teensy 4.1 because I2S and TDM are supported. But SPI would be the wrong way.

This is why the details are so important. If you just ask for SPI help, we can give you a "correct" answer which turns out to be completely wrong because the chips you use are not actually SPI protocol.
 
but i woul like to use anything able to get the same result in terms of performance and number of channels(each chip gets 8channels over tdm, we want use 4 chips to get 32) and audio resolution. Do you know anything similar?
 
Last edited:
but i woul like to use anything able to get the same result in terms of performance and number of channels(each chip gets 8channels over tdm, we want use 4 chips to get 32) and audio resolution. Do you know anything similar?
I corrected the post.
Addition:
We can replace the AK5558 with the MAX11156, and the AK5558 DAC with the DAC used in the MAX5825PMB1#.
 
Those are audio ADC and DAC chips which use I2S or TDM protocol. They are not SPI.

You can use them with Teensy 4.1 because I2S and TDM are supported. But SPI would be the wrong way.

This is why the details are so important. If you just ask for SPI help, we can give you a "correct" answer which turns out to be completely wrong because the chips you use are not actually SPI protocol.
with this 2 interfaces we only can get 22 channels.
 
What does "channels" mean? Is it some analog signal like a pressure or temperature sensor? Or are you looking for many simultaneous audio streams? Or something else?
 
Last edited:
What are you planning to do that's expected to consume so much CPU power?

If you use I2S or TDM with DMA (as the audio library does) simply moving data in and out is very efficient. Simple processing like mixers use very little CPU.
 
I deleted for most the reply talking about build an network of Teensy 4.1 to pickup audio signal and delivery.
What are you planning to do that's expected to consume so much CPU power?

If you use I2S or TDM with DMA (as the audio library does) simply moving data in and out is very efficient. Simple processing like mixers use very little CPU.
The DSP part can need a lot of CPU. I want the CPU so free of the task to manage connection as possible
 
I can confirm that kit provides the parts needed to connect an ethernet cable to the ethernet port on Teensy 4.1.

Hopefully this fact is clear from the written info and photos on that page?
 
I can confirm that kit provides the parts needed to connect an ethernet cable to the ethernet port on Teensy 4.1.

Hopefully this fact is clear from the written info and photos on that page?
hum, I'm asked because I'm study the option of build the Teensy network connecting the Teensy via Ethernet. I can use a switch or I can use an p2p aproach. For an p2p aproach we can use an splited Ethernet or if I can use two Ethernet physical ports (I plan to buy the Teensy version that already cames with one). The best option for my project if possible is the last (more bandwidth free less latency). So is possible to add one Ethernet interface?
I saw an module that can be used to convert Ethernet to SPI(i havent choosed that yet). The link to evaluate this option is https://components101.com/modules/enc28j60-ethernet-module
 
Last edited:
SPI-based Ethernet like ENC28J60 or Wiznet W5500 usually gives moderate performance and also costs high CPU overhead. Probably not aligned with your project goals (which I don't really understand, other than you've said you want high performance and low CPU usage).
 
(which I don't really understand, other than you've said you want high performance and low CPU usage).
Very easy to understand. The part part of low CPU usage is to save CPU power to the DSP task(VST host can use very little cpu, or a lot of cpu it depends from the user)For this reason, to achieve high performance, it's best first of all to save it as much as possible, and then take advantage of all the Hz that the CPU's have free. After testing the system well, we can even do something I saw on Youtube (https://www.youtube.com/watch?v=ydzs7I-wiog), CPU overclocking (which can also be done on computers). Obviously, if we manage to lower costs, maintaining the same performance or even going up, that's what I liked.
SPI-based Ethernet like ENC28J60 or Wiznet W5500 usually gives moderate performance and also costs high CPU overhead.
I will try to find one with a better performance. Or use another interface with an similar module.
gives moderate performance and also costs high CPU overhead.
Even using DMA?
 
Last edited:
Back
Top