Teensy use multiple SPIs

Status
Not open for further replies.
Nazım;286623 said:
Let me explain it this way, I send it with TX every 1 second, except for one second, it needs to receive the commands sent from the Ground station, when it receives the command, there should be no deficiency in the sent packet.

I'm simply pointing out radio is not normally full-duplex, but half-duplex, by its nature. You transmit a packet, switch to RX and await the reply, etc etc.
So I don't see why you need full-duplex if the medium doesn't support it.
 
Again not sure if previous post helped... But if you are simply asking how to hook up two radios on the same Buss.

Then you should be able to do something like:

Hook up both radios such that both of them use the same pins for: SCK(13), MISO(12) and MOSI(11)
And then each of the two ones use different pins for the other pins.
Like in example they have:
Code:
// SX1278 has the following connections:
// NSS pin:   10
// DIO0 pin:  2
// RESET pin: 9
// DIO1 pin:  3
SX1278 radio = new Module(10, 2, 9, 3);
Now you can choose 4 different pins for the 2nd module... Again not know your radio and if needs all of these pins defined or not.

For example you can maybe share RESET pins, but then don't pass that into constructor but for now assume pass in unique...

Now the interesting thing with CS pins is that each radio will try to process data on the SPI buss if their CS pin is not at a high state. This can hit you at startup.
A few different ways to handle a good writeup about this is: https://www.pjrc.com/better-spi-bus-design-in-3-steps/

The best way is with Pull up resistors
A quick and dirty is at the start of your program if for example radio 1 CS is on 10 and radio 2 CS is on 9 you could add:
Code:
pinMode(10, OUTPUT);
digitalWrite(10, HIGH);
pinMode(9, OUTPUT);
digitalWrite(9, HIGH);

Before your first call to first radio begin method

When the pins shown here are manipulated, I can use both lores. Thank you everyone.
 
Status
Not open for further replies.
Back
Top