Is the 2nd SPI Interface also accessible with the Teensy SPI Library when using the 1st
SPI Interface?
It's never really accessible, unless you have some very special application which doesn't need the SCLK signal, because Freescale didn't provide any pin on the 64 pin package for that signal. Only the main SPI port has all its signals available on real pin.
It's never really accessible, unless you have some very special application which doesn't need the SCLK signal, because Freescale didn't provide any pin on the 64 pin package for that signal. Only the main SPI port has all its signals available on real pin.
I think you can't use the SPI in this way because the two individual clocks are, well, individual. The second SPI will only latch incoming data on the edge configured by the SPI mode, but not synchronized with another hardware SPI. I think the only application where the second SPI is useful is when you want to generate a clockless output.I've been reading this in my forum search, and it's really what I need for my application. I have just one SCLK signal, and two incoming signals. So how can I used the two spi ports this way?
I think you can't use the SPI in this way because the two individual clocks are, well, individual. The second SPI will only latch incoming data on the edge configured by the SPI mode, but not synchronized with another hardware SPI. I think the only application where the second SPI is useful is when you want to generate a clockless output.
Mmmh, I see. So, I understand from your answer that, although the two bit signal I need to read (one bit each wire, so two wires) are synchronized with its clock signal (the one I'm connecting to SCLK), I won't be able to read the two bits at the same time, right?
It's unlikely that unless your chip is built to allow two SPI signals to fill a buffer, etc - the way the UART/Serial channels are - that such independent reads would be possible on a teensy chip.
FWIW, Bill Greimann has developed a bit-bang SoftSPI library that works. So two separate SPI channels on one teensy are possible, though one channel will be slower and simultaneous operation impossible.
I'd wager that a parallax architecture chip might be a better fit for independent, simultaneous operation since that system features multiple independent cores that can be dedicated to particular tasks. Thus a core could take over managing one SPI channel and another core could deal with the other channel. However, I've never worked with parallax, so I can't speak to specifics.
What you could do in the teensy space is use two CPUs that communicate with each other via I2C, for example. They could receive and process the SPI data, then exchange the end results and decide what to do. Or, you compromise and figure out how to let two devices coexist on the SPI bus.
Yes, you can't read them both without any other effort hardware- and siftware-wise. It might be possible with some external logic, but I have no working example for something like that.
From your question I had the impression that you want to read data from two devices at the same time. However, I doubt that the xmega has a feature that synchronizes two SPI masters on a bit timing level. So, what do you really need? If it's OK for you (and the devices and their purpose) toThank you for the information! I know the same application I intend has been done with an xmega, but it has two spi ports, so it's easier to do. I've also read about that softspi, the problem then is speed, because my SCLK is 4 MHz and I think that using two softspi (one of the ways I thought) would be too slow. I will think another aproach.
So you want to "sniff" the SPI data? Which device would be generating the clock, then? The device that sends data to the display, or the Teensy?I'm trying to get the data signals that go to a small LCD. It has a clock signal, and two data lines and two more sync signals. I'm not interfacing another spi ic, so i'm not using the chip select signals.
So you want to "sniff" the SPI data? Which device would be generating the clock, then? The device that sends data to the display, or the Teensy?