Pages: [1]   Go Down
Author Topic: SPI on other pins  (Read 702 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Switzerland
Offline Offline
Faraday Member
**
Karma: 111
Posts: 5236
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 148
Posts: 6110
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 148
Posts: 6110
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Norfolk UK
Offline Offline
Faraday Member
**
Karma: 70
Posts: 2575
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

But thanks for the help.
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 111
Posts: 5236
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: