![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
Hi All, When accessing an SD Card in SPI mode should I pull up the unused contacts on the card? I havent found a definitive answer to this one - I have seen circuits which demonstrate using pullups and some that don't bother. What do you recommend? Thanks in advance. Mark | |
| |
| | #2 |
| YES. The used ones should be pulled up as well. It's in the documentation somewhere.
__________________ ========================= Futz's Microcontrollers & Robotics ========================= | |
| |
| | #3 |
|
Hi Futz, Long time no hear - hope your keeping well. I am building an SPI\SD Card circuit from scratch, I am favouring the attached circuit which uses resistors as 3.3v level shifters. How would I "Pull up" these? Regards Mark | |
| |
| | #4 | |
| Quote:
But don't quote me on that. Now someone will give you a better answer and I'll learn something. ![]() Chances are it'll work fine without pullups on the lines you're using, but I don't know for sure.
__________________ ========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 11th December 2008 at 09:59 PM. | ||
| |
| | #5 |
|
to pull them high i would put 3 resistors (4.7k) from the TOP of the divider to the to 5v. Or just make sure those pins stay HIGH when not in USE.
__________________ AtomSofts eBay Store AtomSoftTech: C18 TIPS & TRICKS v9 PDF Nokia 6100 Driver/Software My Name: Jason Lopez http://atomsofttech.info/ | My YouTube Videos! My Favorite Store: dipmicro Electronics Last edited by AtomSoft; 12th December 2008 at 01:22 PM. | |
| |
| | #6 | |
|
Hi Jason. Sorry for not replying sooner Quote:
Warning, i am very slow at picking up electronics theory.... Mark Last edited by UTMonkey; 20th January 2009 at 08:35 PM. | ||
| |
| | #7 |
|
Don't pull them up, SPI is not tristate for the active device. You'll mess up the simple voltage divider. I2C requires pullups.
| |
| |
| | #8 |
|
Thanks Bill, not really sure I understand your "tristate" statement - perhaps I really should get my hands on a 74XX245 as most of the examples suggest (which has pullups on the 3v bus side which is confusing). Just correct me if I am wrong but would the difference between a circuit which uses pullups and a circuit that does'nt mean that i should alter the CKE CKP appropiately (active high vs active low)? Did that last paragraph make any sense???? Regards Mark | |
| |
| | #9 |
|
The pins are driven from both the master and slave in 3 wire SPI mode. Since your microcontroller is the master clock its SDO and SCK pins are 0-5V drivers and the SD cards SDO is driven not open collector. The only real problem will be if your micro has Schmidt trigger inputs on SDI as 3.3V will probably be too low for that input. A neat chip is the 74VC1T45 for level translation, or a 74HCT125 or a MOSFET may work. | |
| |
| | #10 |
|
Thanks Bill - the Micro is a PIC 18f2550. Mark | |
| |
| | #11 |
|
Then it's going to need a boost on the SDI pin. The 74HCT125 is common and it works for SPI. The resistor bits are fine for the SDK, SDO and CE outputs from the PIC.
| |
| |
| | #12 |
|
UTMonkey, may I ask what resources you are using in your project? I too want to interface an SD card and a PIC, but have only been reading the application notes.
| |
| |
| | #13 |
|
Mr Jammin, just a 18f2550 on a breadboard using (or attempting to use) hardware SPI to an SDCard (powered by 3.3v) via resistors forming a potential divider to convert 5v outputs to 3v. There are loads of resources and threads on this site which are really useful. The problem I am having is at the reset stage of the SD card (the very beginning), the SPI module does report receiving data but it is either 0xC0 or 0xE0 when it should be 0x01. I am trying to rule out whether the potential dividers are at fault or perhaps is should take the more robust approach and use level shifters (74x125, 74x245). Mark Last edited by UTMonkey; 21st January 2009 at 12:35 PM. | |
| |
| | #14 | |
| Quote:
Regards Mark | ||
| |
| | #15 |
|
Did you put a level shifter on the PIC SDI pin or is it directly connected to the SD card?
| |
| |
|
| 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 |