+ Reply to Thread
Page 2 of 3
First 1 2 3 Last
Results 16 to 30 of 38

Thread: SPI\SD Card Query

  1. #16
    UTMonkey Good UTMonkey Good UTMonkey Good
    Join Date
    Oct 2007
    Location
    Chesterfield, Derbyshire - UK
    Posts
    428

    Default

    Directly to the card.


  2. #17
    Help us help you blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent
    Join Date
    Jan 2007
    Location
    Toronto, Canada
    Posts
    10,709
    Blog Entries
    5

    Default

    Well you will need a level shifter when using the SPI in hardware for the SDI pin. 3.3V is just not high enough for the Schmitt inputs on a 5V PIC. I'd have to check the datasheet but I recall it's something like VCC-0.8 (4.2V) is a 1.
    Bill
    Smart Kits build Smart People

    http://www.blueroomelectronics.com/

  3. #18
    UTMonkey Good UTMonkey Good UTMonkey Good
    Join Date
    Oct 2007
    Location
    Chesterfield, Derbyshire - UK
    Posts
    428

    Default

    Righto, i'll check.

    p.s. I'm still giving my junebug some hammer ;-)

  4. #19
    Help us help you blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent
    Join Date
    Jan 2007
    Location
    Toronto, Canada
    Posts
    10,709
    Blog Entries
    5

    Default

    Use the Logic tool (TTL level won't really show Schmitt level triggers) to watch those SPI signals. See if they match up with what you're getting.
    Last edited by blueroomelectronics; 21st January 2009 at 03:19 PM.
    Bill
    Smart Kits build Smart People

    http://www.blueroomelectronics.com/

  5. #20
    DirtyLude Excellent DirtyLude Excellent DirtyLude Excellent DirtyLude Excellent DirtyLude Excellent DirtyLude Excellent DirtyLude Excellent DirtyLude Excellent
    Join Date
    Aug 2003
    Location
    Toronto, Canada
    Posts
    1,307

    Default

    I'm trying to get this to work as well. I'm using a 3.3v chip, though, so level translators aren't my issue, but I thought I'd keep this all in one thread.

    I have tried a microsd card and a few regular sd cards. On the microsd card setup, I have nothing pulled up. On the SD card setup I have the unused data lines pulled up.

    I'm getting no response from the card at all. I've tried quite a few variations with changing the way I'm working the protocol, and delays and such, but still nothing from any of the cards.

    Here's my logic output for the initialization. I send 10 0xFF's to get the initialization clocks over with, then I send the CMD0. 0x40,0x00,0x00,0x00,0x00,0x95. I check 20 times for a response before resending this initialization, and continue to get the same no response.

    Logic view:
    http://www.higginstribe.com/z8e/sd-connect.png

    I'm hoping someone can see something that I can't otherwise I'm just going to have to keep experimenting.

    Setup:
    http://www.higginstribe.com/z8e/sd-connect.png

    EDIT: Actually, I just checked my setup again, and only the unused pins on the SD card breakout are being pulled up. Pin 9 and 8. Otherwise the datalines are direct connect. Edited text above.
    Last edited by DirtyLude; 21st January 2009 at 06:20 PM.
    Mark Higgins

  6. #21
    UTMonkey Good UTMonkey Good UTMonkey Good
    Join Date
    Oct 2007
    Location
    Chesterfield, Derbyshire - UK
    Posts
    428

    Default

    Nothing leaps out, can we take a look at the circuit?

    Your SD logic seems ok (apart from the MISO).

    Mark

  7. #22
    UTMonkey Good UTMonkey Good UTMonkey Good
    Join Date
    Oct 2007
    Location
    Chesterfield, Derbyshire - UK
    Posts
    428

    Default

    Hang on, am I reading your MISO right - is it all 0xFF's. do you have your MISO set as an input?


    Is this a PIC?

    Mark

    p.s. nice logic analyzer by the way
    Last edited by UTMonkey; 21st January 2009 at 07:03 PM.

  8. #23
    DirtyLude Excellent DirtyLude Excellent DirtyLude Excellent DirtyLude Excellent DirtyLude Excellent DirtyLude Excellent DirtyLude Excellent DirtyLude Excellent
    Join Date
    Aug 2003
    Location
    Toronto, Canada
    Posts
    1,307

    Default

    Here's the circuit for the full size SD breakout board. I made this a couple years ago and never got around to it again, so it's kinda messy, but I've confirmed all the pins connect properly. The pullup resistors on the MISO and MOSI lines in the schematic are not attached on the board, so they are not active. Pullups for line 8 and 9 are attached.

    Otherwise the other side of the lines are connected directly to the uC. There is obviously nothing wrong with the CLK, SS, and MOSI lines as they are working fine. I would think that even if there was an issue with the MISO line, I would still see data transmitted on the Logic, it just wouldn't process on the uC. For some reason that data line is just held high.

    http://www.higginstribe.com/z8e/sd-breakout.png
    Last edited by DirtyLude; 21st January 2009 at 07:05 PM.
    Mark Higgins

  9. #24
    UTMonkey Good UTMonkey Good UTMonkey Good
    Join Date
    Oct 2007
    Location
    Chesterfield, Derbyshire - UK
    Posts
    428

    Default

    Can you confirm your MISO an input?

  10. #25
    DirtyLude Excellent DirtyLude Excellent DirtyLude Excellent DirtyLude Excellent DirtyLude Excellent DirtyLude Excellent DirtyLude Excellent DirtyLude Excellent
    Join Date
    Aug 2003
    Location
    Toronto, Canada
    Posts
    1,307

    Default

    Yes, MISO is an input. It's a hardware SPI block and I just set it to go. I will double check everything in the code to make sure I'm not resetting that pins function or anything.

    If I disconnect MISO from the uC all together, I get the same result. MISO is held high the entire time.

    This is not a PIC, it's a Z8 Encore.
    Mark Higgins

  11. #26
    UTMonkey Good UTMonkey Good UTMonkey Good
    Join Date
    Oct 2007
    Location
    Chesterfield, Derbyshire - UK
    Posts
    428

    Default

    Does your chip have internal pullups?

  12. #27
    Help us help you blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent
    Join Date
    Jan 2007
    Location
    Toronto, Canada
    Posts
    10,709
    Blog Entries
    5

    Default

    Remember the SPO on the SD card is driven not open collector so pullups won't help.

    Sparkfun uses this design on one of their level converter designs.
    Last edited by blueroomelectronics; 21st January 2009 at 08:05 PM.
    Bill
    Smart Kits build Smart People

    http://www.blueroomelectronics.com/

  13. #28
    UTMonkey Good UTMonkey Good UTMonkey Good
    Join Date
    Oct 2007
    Location
    Chesterfield, Derbyshire - UK
    Posts
    428

    Default

    Thanks Bill, I can't easily source a BSS138 - would any n-channel mosfet do the trick. (sorry I barely understand trasnsistor operation)

    Mark

  14. #29
    Help us help you blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent
    Join Date
    Jan 2007
    Location
    Toronto, Canada
    Posts
    10,709
    Blog Entries
    5

    Default

    Probably, it's a simple enough circuit. I've not tried it myself but I have used the 74HCT125 with success.
    Bill
    Smart Kits build Smart People

    http://www.blueroomelectronics.com/

  15. #30
    UTMonkey Good UTMonkey Good UTMonkey Good
    Join Date
    Oct 2007
    Location
    Chesterfield, Derbyshire - UK
    Posts
    428

    Default

    I Like the mosfet solution, for my solution i would only be using one "bit" of the 74x125 (that if i understand it's operation).

    Mark

+ Reply to Thread
Page 2 of 3
First 1 2 3 Last

Similar Threads

  1. IR Query
    By yori in forum Electronic Projects Design/Ideas/Reviews
    Replies: 2
    Latest: 7th January 2008, 01:58 PM
  2. query
    By savnik in forum Micro Controllers
    Replies: 17
    Latest: 24th June 2007, 12:30 PM
  3. LNB query
    By jeevan772006 in forum Electronic Projects Design/Ideas/Reviews
    Replies: 5
    Latest: 11th December 2005, 11:17 AM
  4. amp query
    By monkeytree in forum Electronic Projects Design/Ideas/Reviews
    Replies: 12
    Latest: 19th October 2005, 06:27 PM
  5. smart card.....or Xphone card circuit
    By bogdanfirst in forum General Electronics Chat
    Replies: 4
    Latest: 22nd September 2003, 11:14 PM

Tags for this Thread