Go Down

Topic: Accessing SD card -and- using the YX5200 chip for audio playback (Read 541 times) previous topic - next topic

xl97

Hey gang-

I am just starting my research this chip (YX5200).. but figured Id' post to see if anyone else has some input or has been down this road before..

I have been using the DFPlayer modules for many projects as of late... and it has always frustrated me that you can NOT access the SD card to read a .txt file or anything (like for setting parameters..etc) from it..

The YX5200 chip (as I understand it) is a way to control audio playback via serial commands..  (which I like, and is fairly easy and only takes a software serial line to get going)...

I was thinking about a new PCB that has the core 'Arduino' compatible circuit.. and the DFPlayer guts all on one board to make things a bit easier...

If I -ALSO- connected the SPI pins to the SD card....  can I initially do a READ of said TEXT file.. -and-0 continue to use the DFPlayer as it normally works?

I'm not clear on what pins/pads the DFPlayer needs for communication to the SD card to get audio data/playback..

but I would imagine that I would be 'double dipping' on the same pins of the SD card socket... that the DFPlayer also connects to..

Both the YX5200 chip and the amp it uses are fairly cheap..(used in the open source light saber project thats been floating around here for a while too I believe)


Thanks


raschemmel

Quote
If I -ALSO- connected the SPI pins to the SD card...  can I initially do a READ of said TEXT file..
What SPI pins ?

Where ?
Do you see any SPI Pins on the board ?
Can you post a photo of pins labeled "SPI Pins " ?

Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

xl97

SPI:
  • Master Out, Slave In (MOSI) - which is the data going from the master to the slave
  • Master In, Slave Out (MISO) - which is the data going from the slave to the master
  • Serial Clock (SCK) - when this toggles both the master and the slave sample the next bit
  • Slave Select (SS) - this tells a particular slave to go "active"


On the Arduino.... (pin#'s 13, 12, 12 and usually 10 for SS pin)..... connected to the SD card socket... (directly.. or with level shift/voltage divider..or even just direct if I make the compatible circuit a +3.3v version)..

Issues with ALSO connecting a YX5200 chip to same SD card....?? (however that is done/same way as DFPlayer... I havent checked out the schematic for it yet...more or less taking schematic, dumping it into eagle.. add my 'Arduino' compatible circuit/IO breakouts...etc..etc and also have the SPI lines connected to same SD socket)

thats my question.

Hope that clears it up?



raschemmel

I what they are. The qestion was what do that have to do with the product you linked and where are those
signals on that product. I can find nothing to indicate that product has those signals so can you post a photo that proves it does ?
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

xl97

Im not saying.. nor implying that it does.

I'm asking about setting up the YX5200 chip (ie: the whole DFPlayer circuit for arguments sake)..  which connects to and use an SD card to play .wav and .mp3 files..

if I connected an Arduino (SPI pins) to that SAME SD CARD SOCKET..
(ie: 'double dipping' as mentioned above)

Do you think I can 'also' access that SD card using the normal libraries... (to read/parse a text file)...

and still have the DFPlayer/YX5200 work as intended?

Will have both devices connected to the SAME SD card/socket be an issue?

** In my original post, I mention I planned on making a custom PCB.. so its not technically 'two devices'..


update:

ok.. I took a quick peek at that open source project floating around here for some time.. and how they wired up the bare YX5200 chip...  and it does look like are 'SPI' compatible pins on it as well?

Schematic form project:
https://upverter.com/vrpczybeon/d870485df4c4ddbd/Arduino-Lightsaber-RGBWNeoPixel/


raschemmel

I'm sorry, they didn't teach that term ("double-dipping") in my DeVry Electronics Engireering course.  Didn't Anyone ever tell you you can't tie putputs to outputs ?

FYI, integated circuits are a little more complicated than potato chips.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

CrossRoads

That chip as drawn appears to have two interfaces - SPI to a microcontroller, and the SD DAT/CLK/CMD lines out to an SD card.
See 3.3 here https://www.cactus-tech.com/files/cactus-tech.com/documents/whitepapers/An%20Introduction%20To%20SD%20Card%20Interface.pdf

I can't find a datasheet for the XY5200. It looks like chip talks to the CD card in SD Mode. Arduino libraries (SDfat) use SPI mode.  You'd have to work out some buffering scheme to let the XY5200 or the uC control the card, while controlling reset and such:
Quote
There are two bus protocols defined for SD Cards. The default mode is native SD mode but the card can be configured to use a slower SPI mode. Protocol selection is done during the first reset command after power up. The SD Card powers up in SD mode. To switch the card to SPI mode, the CS signal must be asserted while the host issues a reset command to the card. Once a particular protocol is configured, it cannot be changed while power is applied. The only way to switch between protocol modes is to do a power cycle.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

YX5200 - I can only find in oriental symbols. Anybody got an English version?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

raschemmel

Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

xl97

They didnt teach me what "putputs" are at my DeVry Electronics 'Engireering' course. :-X



Guess that must have been right after the 'double dipping' lesson...


Anywho.....

@CrossRoads (Robert)..

Thanks for that!  So yeah a bunch of messing about with power cycling applying the CS signal..   (blah)..

Might be better to just seek out a different chip/option...   I was just familiar with the library and ease of use..  (liked that it was serial controlled, and that it did all the work itself instead of making the ATmega328 do anything.  (like the Adafruit WaveShield type of approach)



larryd

putputs

@raschemmel's Oh finger is a bit fat.


No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

Go Up