Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 21st January 2009, 04:02 PM   #16
Default

Directly to the card.
UTMonkey is offline  
Old 21st January 2009, 04:07 PM   #17
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/
blueroomelectronics is online now  
Old 21st January 2009, 04:17 PM   #18
Default

Righto, i'll check.

p.s. I'm still giving my junebug some hammer ;-)
UTMonkey is offline  
Old 21st January 2009, 04:19 PM   #19
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.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com/

Last edited by blueroomelectronics; 21st January 2009 at 04:19 PM.
blueroomelectronics is online now  
Old 21st January 2009, 07:12 PM   #20
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.
__________________
Mark Higgins

Last edited by DirtyLude; 21st January 2009 at 07:20 PM.
DirtyLude is online now  
Old 21st January 2009, 07:53 PM   #21
Default

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

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

Mark
UTMonkey is offline  
Old 21st January 2009, 08:01 PM   #22
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 08:03 PM.
UTMonkey is offline  
Old 21st January 2009, 08:04 PM   #23
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
__________________
Mark Higgins

Last edited by DirtyLude; 21st January 2009 at 08:05 PM.
DirtyLude is online now  
Old 21st January 2009, 08:12 PM   #24
Default

Can you confirm your MISO an input?
UTMonkey is offline  
Old 21st January 2009, 08:29 PM   #25
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
DirtyLude is online now  
Old 21st January 2009, 09:02 PM   #26
Default

Does your chip have internal pullups?
UTMonkey is offline  
Old 21st January 2009, 09:04 PM   #27
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.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com/

Last edited by blueroomelectronics; 21st January 2009 at 09:05 PM.
blueroomelectronics is online now  
Old 21st January 2009, 09:28 PM   #28
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
UTMonkey is offline  
Old 21st January 2009, 09:34 PM   #29
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/
blueroomelectronics is online now  
Old 22nd January 2009, 09:10 AM   #30
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
UTMonkey is offline  
Reply

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



All times are GMT. The time now is 07:44 PM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker