SD card and VS1011e on same SPI bus

Go To Last Post
14 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey guys,

I'm using an Atmega644p with an SD card (Chans FATFS) and a VS1011e mp3 decoder on the same SPI bus. The problem I'm having is that the SD card stops working when I connect the VS1011e to the SPI bus. More specifically, it stops working when I connect the MISO of the VS1011e to the SPI bus. The chip select for the VS1011e should float this output so it will not interfere so I'm not sure what's going on. Is there anyway to test the pin and see if it's really highZ? Any ideas would be appreciated.

David

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have you measured the the VS1011e /CS is in fact high? (to deselect the chip)

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes. Also put a pull up resistor on the CS and ran the code with the same results.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The VS10xx DOES float the SO pin when CS's are inactive. Note that there's TWO CS's on the VS10xx if you run it in the new modes.

/Jesper
http://www.yampp.com
The quick black AVR jumped over the lazy PIC.
What boots up, must come down.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jesper:
Yes I'm using it in new mode with the CS Share option off so I'm using both chip selects. I tried both with pull up resistors for a temporary permanent high to deselect the chip while the code runs and the SD card still didn't work.

Paddy:
Sounds like a nice way to see if the pin is really tri-stated. So it should read around 2.5V if I'm using 5V correct, when floating? Thanks for the tip.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

So it should read around 2.5V if I'm using 5V correct, when floating?

??? A floating signal can have any value. If a truly floating AVR input, the act of measurement with a meter or even a 'scope can skew the read value.

(I always forget whether "the act of measuring affects the result" is the short form of Schrödinger's Cat or Heisenberg's Uncertainty Principle. One of those dudes.)

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But if I disconnect the pin I'm interested in from the network and set it up like Paddy said. I think it would work to test if the pin goes to highZ when it needs to. It works in Multisim, see attached schematic. I'll probably do the test on the pin later tonight and see if it physically works.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Now, you're talking about 2.5v for a pin you think is floating in the middle.
You're not running neither SD-card or VS10xx on 5V, right? 3.3V only!

Don't waste time with special circuits like the above. It should work right out of the box otherwise your chip is dead or something else is misconfigured.
Have you verified that the VS10xx work?

/Jesper
http://www.yampp.com
The quick black AVR jumped over the lazy PIC.
What boots up, must come down.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, both the SD and VS1011e are running at 3.3V but the 644p is running at 5V. I'm using these logic level converters in between.

http://www.sparkfun.com/commerce...

Now a logic 1 output from the 644p gets translated to about 2.5V on the SD card and VS1011e side, could that be the problem? The devices do work, I can write and read to registers on the VS1011e and the status register gives the correct version. And the SD card is functional only when the slave output (SO) of the VS1011e is disconnected from the SPI bus.

I did the test described above (3.3V instead of 5V) and it does seem that the SO floats at about 1.6V (half of 3.3V). The imaged attached shows a read cycle of the VS1011e

red - spi clock on 5V side
blue - SO from VS1011e

I also monitored SO during SD card operations and it stays at 1.6V so it doesn't look like its interfering.

Should I try another VS1011e chip?

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Your logic level converters are not High-Z outputs. They just convert voltage levels, so a floating 1.6V from the VS10xx will be about 2.5V on the CPU side. But it's not floating.
You can't use it that way - you need a "real" floating output. Perhaps you can find logic level converters with an Enable pin, but this will be messy.
Why not just run everything on 3.3V?
Makes it all so much simpler.

/Jesper
http://www.yampp.com
The quick black AVR jumped over the lazy PIC.
What boots up, must come down.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

(I always forget whether "the act of measuring affects the result" is the short form of Schrödinger's Cat or Heisenberg's Uncertainty Principle. One of those dudes.)

It was Heisenberg who basically said "you can't know everything at once" and it was Schroedinger who killed his cat to prove that by observing something you influence the result. So it's Schroedinger who applies in this case (IMHO)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I noticed that when only having the SD card connected to the SPI bus, it would work. When testing with a scope (probe on MISO) it wouldn't work all the time. So it ended up being a load problem. Hooked up a tri-state buffer on the MISO of the SD card and it works fine now. Thanks to everyone for the help!

David

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Having made systems with SD-cards, several VS10xx devices, displays and memories, all on the same SPI bus, I highly doubt it's a load problem.

/Jesper
http://www.yampp.com
The quick black AVR jumped over the lazy PIC.
What boots up, must come down.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is for anyone planning to build an MP3 and finds this link: I had the EXACT setup( but e.thing at 3.2V ) and problem 'list did and was stuck there ( spent( wasted? ) time trying to t.shoot w/o having to put a buffer in ). I built an xmega256A3 brd. and it doesn't have this ( loading? ) problem. MAin s.ware's the same, I don't see how it can't be loading.

The people at MIKROE made a player using a '1011E ( 2 versions ) and both have buffering on SPI. I think there is a loading issue when using '1011E and certain megaAVRs ( some don't have buffering ).

Also, I used PB1 for xCS using m644 and the uC couldn't drive the pin low, even when i did:

do{ clr_xcs }while(1);

No issue using the xmega

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1