Go Down

Topic: Arduino Nano - SPI header and D* pins (Read 244 times) previous topic - next topic

afedorov

http://www.pighixxx.com/test/pinouts/boards/nano.pdf

Does SPI header pins are separated from D10,D11,D12.

Basically, can I use D10-12 pins to control something, and use SPI header pins for communication with other device? If yes how should I properly configure it?

CrossRoads

The ICSP header has D11, D12 ,D13 on it.
If you are using D10-D12 already, then only D13 is free to be used.

Don't forget the analog pins can also be for digital.  A0-A5 are D14-D19
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

afedorov

so basically I either can use header or D* pins for SPI. If D* pins are used for other things, I can't use SPI

Wawa

so basically I either can use header or D* pins for SPI. If D* pins are used for other things, I can't use SPI
No, you can connect several devices to the SPI bus, as long as only one device is active.
Maybe you should tell us what you really want to do, so we don't have to guess.
Leo..

afedorov

I want to connect second arduino nano so I can send logs there and store in SD card. I can't write to SD in my main arduino nano as I don't have enough free memory for buffer.

The issue I "may" have is that is I used all my A* pins and need to use D10-12 to connect some sensors, if sensors don't use SPI protocol, what will happen if I use SPI header pins and D10-12 simultaneously

pert

If you're using the SPI pins for SPI then you should not use those pins also for something else. It sounds like you might be better off just using a Mega, which should provide enough memory and pins for everything. Of course that's not the only option. You can add more pins to your Nano via external components. You might be able to work within the available memory by modifying your code.

MorganS

A Teensy 3.5 might be better. More pins than a Nano and it has an SD card slot which doesn't share pins with the header pins.

It is 5v "tolerant" which means that it can accept 5v digital inputs but analog inputs over 3.3v will read 1023 and digital outputs will only go up to 3.3v

Or maybe a Teensy 2 has enough pins for what you need?
"The problem is in the code you didn't post."

afedorov

how can I add input pins to nano? Is there a chip?

uxomm

#8
Apr 17, 2018, 09:55 pm Last Edit: Apr 17, 2018, 10:00 pm by uxomm
how can I add input pins to nano? Is there a chip?
Shift register

More digital inputs: 74HC165
Tutorials: http://playground.arduino.cc/Code/ShiftRegSN74HC165N
http://dduino.blogspot.co.at/2012/04/arduino-74hc165-psio-shift-regsiter.html

More digital outputs: 74HC595
Tutorial: https://www.arduino.cc/en/Tutorial/ShiftOut

More analog inputs:
Multiplexer: 74HC4067, 74HC4052

(And of course there are I2c and SPI port expanders, like PCF8574, PCF9555 MCP23009, MCP23017, MCP 23S09, MCP23S17 ...)
Always decouple electronic circuitry.

Go Up