![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #16 |
|
Directly to the card.
| |
| |
| | #17 |
|
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.
| |
| |
| | #18 |
|
Righto, i'll check. p.s. I'm still giving my junebug some hammer ;-) | |
| |
| | #19 |
|
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 04:19 PM. | |
| |
| | #20 |
|
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.
__________________ Mark Higgins Last edited by DirtyLude; 21st January 2009 at 07:20 PM. | |
| |
| | #21 |
|
Nothing leaps out, can we take a look at the circuit? Your SD logic seems ok (apart from the MISO). Mark | |
| |
| | #22 |
|
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 08:03 PM. | |
| |
| | #23 |
|
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
__________________ Mark Higgins Last edited by DirtyLude; 21st January 2009 at 08:05 PM. | |
| |
| | #24 |
|
Can you confirm your MISO an input?
| |
| |
| | #25 |
|
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 | |
| |
| | #26 |
|
Does your chip have internal pullups?
| |
| |
| | #27 |
|
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 09:05 PM. | |
| |
| | #28 |
|
Thanks Bill, I can't easily source a BSS138 - would any n-channel mosfet do the trick. (sorry I barely understand trasnsistor operation) ![]() Mark | |
| |
| | #29 |
|
Probably, it's a simple enough circuit. I've not tried it myself but I have used the 74HCT125 with success.
| |
| |
| | #30 |
|
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 | |
| |
|
| Tags |
| card, query, spisd |
| Thread Tools | |
| Display Modes | |
| |
Similar | ||||
| Title | Starter | Forum | Replies | Latest |
| IR Query | yori | Electronic Projects Design/Ideas/Reviews | 2 | 7th January 2008 02:58 PM |
| query | savnik | Micro Controllers | 17 | 24th June 2007 01:30 PM |
| LNB query | jeevan772006 | Electronic Projects Design/Ideas/Reviews | 5 | 11th December 2005 12:17 PM |
| amp query | monkeytree | Electronic Projects Design/Ideas/Reviews | 12 | 19th October 2005 07:27 PM |
| smart card.....or Xphone card circuit | bogdanfirst | General Electronics Chat | 4 | 23rd September 2003 12:14 AM |