View previous topic :: View next topic |
Author |
Message |
arrow
Joined: 17 May 2005 Posts: 213
|
SPI and Pull up Resistors? |
Posted: Mon Oct 08, 2007 12:28 am |
|
|
Hi
Do the SPI lines (in particular the input and output lines) need a pull up resistor?
and if yes, then what values should the Resistors be?
Thank you in advance for your help.
a. |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1909
|
|
Posted: Mon Oct 08, 2007 12:38 am |
|
|
No SPI device I've ever used has required pullups. I don't think they're meant to be included as the protocol doesn't allow for more than one slave to reply to the master at once, since each slave needs a dedicated /CS line. The I2C protocol requires them since the data line is shared amongst many slaves (potentially, anyway), and the best comm method there is with open drain drivers. |
|
|
arrow
Joined: 17 May 2005 Posts: 213
|
|
Posted: Mon Oct 08, 2007 12:42 am |
|
|
Hi NewGuy
Thank you.
Do SPI lines require any resisotrs (say in series?)
or on the CS line?
Regards
a. |
|
|
Ttelmah Guest
|
|
Posted: Mon Oct 08, 2007 2:23 am |
|
|
_If_ you are running any logic line a long distance, and using high clock rates, then termination may become necessary. If you look at the lines round a typical PC motherboard, you will find that most of the high clock rate ones, have got little termination networks. Usually 330R to V+, and 220R to 0v, often with a small series resistor. Whether you need anything like this, is going to depend on the clock rate being used, length of the line, and particularly how the board is laid out. Typically if your clock rate is below perhaps 1MHz, you will normally get away with nothing. However if you start pushing higher rates, you may need to consider line termination.
Best Wishes |
|
|
arrow
Joined: 17 May 2005 Posts: 213
|
|
Posted: Mon Oct 08, 2007 3:12 am |
|
|
Hi Ttelmah
Thank you for your response.
I have the following problem: I have made the circuit that writes (using SPI) to a microSD card on a bread board. It works fine.
I have made a PCB of what is on the bread board and there is no writting to the microSD card.
On the OScope there is a clock pulse from both the bread board and the PCB circuits. The pulses look similar (similar rise and fall times).
I have tried to use pull up resistors of 51kOhms on all my Data lines.
On the PCB the microSD card is almost directly below a level shifter MAX3378 chip and close to the PIC18LF2550. Will these chips cause noise/ stray capacitance/ other things on the microSD causing it not to work?
How can I measure these effects?
I am really stuck, and do not understand what can be happening on the PCB that is not happening on the bread board!
Any suggestions, hints would be greately appreciated
Thank you for all your help.
a. |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Mon Oct 08, 2007 5:40 am |
|
|
An SD card has two different bus modes: At power on the default mode is SD-bus which works more stable with pull-up resistors on the data and clock lines. Only after sending the CMD0 command the bus goes to SPI-mode and the pull-up resitors are not needed anymore.
From the Sandisk product Manual: Quote: | Rdat and Rcmd are pull-up resistors protecting the CMD and the DAT line against bus floating when no card is
inserted or when all card drivers are in a hi-impedance mode. | Use 10k to 100k for the pull up resistors. |
|
|
|