Go Down

Topic: SPI on other pins (Read 818 times) previous topic - next topic

siletto

Hy!
Is it possible to change which pins are used by the spi communication?

pylon

Not for the hardware SPI. But you can emulate an SPI interface on any 4 GPIO pins but it's way slower. Describe your problem, maybe we have another solution than to change the SPI pins.

siletto

I bought two 2.4Ght radio module which have spi interface, with a 2x4 array 2.54mm pins. They are like:  GND-CE-SCK-MISO
                                                                                                                                                 VCC-CSN-MOSI-IRQ
And i am willing to make a pcb for it, but i want to try it out first.
It is based on the nRF24L01+, so there exists a library which makes the register setting, or hard work unnecessary, but i have to mess up with wires and sockets, pins.
I know that it is not the place of advertisements, but this module(a pair, of course):
http://www.ebay.com/itm/290773692550?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649

SurferTim

Why not use hardware SPI and use different slave select pins for each device? Is there a reason you have ruled out that option?

siletto

Hello. I Maybe wasn't clear.
I want to attach 1 module to the pc, and one to the arduino. The problem is that the matching pins on the module don't line up with the arduino's spi pins, so i have to attach wires between the module, and the arduino, not just simply plug the module into the board.
So i asked if there is a possibility to change the pins used by spi interface.

SurferTim

You can use different pin with software SPI, but it is slower, and takes more resources. If you must connect the wires anyway, why not use the hardware SPI interface? It works pretty good.

If you are going to design a board, do yourself a favor and use the ICSP connector for your hardware SPI data lines. That way it will be both Uno and Mega compatible.

Riva


Hello. I Maybe wasn't clear.
I want to attach 1 module to the pc, and one to the arduino. The problem is that the matching pins on the module don't line up with the arduino's spi pins, so i have to attach wires between the module, and the arduino, not just simply plug the module into the board.
So i asked if there is a possibility to change the pins used by spi interface.

As stated previously you can use software to emulate the SPI but you won't be able to plug the device directly into the arduino headers as I don't think you will never get VCC & GND to match the radios 2x4 header format

siletto

Oh, yes, i almost forgotten it, you are right.
The module needs 3.3V

But thanks for the help.

pylon

Quote
The module needs 3.3V


This probably means it also needs a level converter for the SPI pins, except if it explicitly is 5V tolerant.

Go Up