mosi and miso pins seem to be mixed up using sd card

Status
Not open for further replies.

100

Member
I have been trying to figure out a problem with my custom board for days with its communication with an sd card so i tested with a teensy 3.1 and had the same issue.
I have been testing with the sdinfo from the sd fat library and cardinfo from the arduind sd library.when wired as every tutorial tells me to ( atleast what i think its telling me)it says no card detected.
I now have switched the miso and mosi wires with sd card pin 2 mosi/di connected to teensy 3.1 pin11 wich is the dout pin and everything is working.
I thought that pin 2 mosi/di should be connected to teensy pin 12/din.
Maybe i have completely misunderstood the wiring of spi and they are ment to be this way ?

using arduino 1.6.13 and
 
Last edited:
It's simple if you know what miso/mosi stands for:

MISO: Master In, Slave Out -> Pin is input on the Microcontroller
MOSI: Master Out, Slave In -> Pin is output on the Microcontroller

From Wikipedia:

The SPI bus specifies four logic signals:

  • SCLK : Serial Clock (output from master).
  • MOSI : Master Output, Slave Input (output from master).
  • MISO : Master Input, Slave Output (output from slave).
  • S̅S̅ : Slave Select (active low, output from master).
Alternative naming conventions are also widely used, and SPI port pin names for particular IC products may differ from those depicted in these illustrations:
Serial Clock:

  • SCLK : SCK, CLK.
Master Output → {\displaystyle \rightarrow }
53e574cc3aa5b4bf5f3f5906caf121a378eef08b
Slave Input:

  • MOSI : SIMO, SDI,[2] DI, DIN, SI, MTST.
Master Input ← {\displaystyle \leftarrow }
3c0fb4bce772117bbaf55b7ca1539ceff9ae218c
Slave Output:

  • MISO : SOMI, SDO,[2] DO, DOUT, SO, MRSR.
Slave Select:

  • SS : nCS, CS, CSB, CSN, EN, nSS, STE, SYNC, SSQ.
 
Thank you for your reply, I see how it works now I was only only taking note of the last letter , its always the things with 2 options that get me.
 
Status
Not open for further replies.
Back
Top