Could an SD Card Signal be Shared to Provide Audio When the SD Card is Not Active?
JRetSapDoog
Posts: 954
Greetings. On a design in the making I've got all pins in use. But I'd like to add audio of some kind, even if just a piezoelectric device for beeps/buzzes.
In the design, almost all of the Prop pins are in constant use, with the possible exception of the four SD card signals (DO, CLK, DI, /CS). I don't really have any other good candidates elsewhere (and can't use I/O expanders, etc). Even P28-31 are busy. So, I'm eyeing these SD card signals to see if something could be done there.
Might an audio signal be sent out on one of those pins if the active-low chip select line were held high during the time the card wasn't actively being accessed? Or is there some data coming back from the card when the CS line is high? Hopefully not. If not and nothing else stands in the way, I wonder what would be the best SD card pin choice to pass the audio on.
Also, as you can probably guess, I wouldn't want an audio transducer emitting sound or otherwise spazzing out while the SD card was in use. So, perhaps the CS line could be used to disable an AND gate or similar to prevent passing through the signal associated with an active SD card. I won't need the audio transducer to emit sound while accessing the SD card, just when the SD card is not in use. Incidentally, currently, I don't access the SD card all that often, perhaps once a minute for a couple seconds (and at least most, currently all, of the accesses are/will be reads). Lastly, the audio signal would NOT be generated and OR'ed in (by the Prop's internal pin circuitry) with an SD pin when the SD card was active.
And if something along those lines is possible, I wonder if I'd have to unmount the SD card when doing audio. I'm all ears for any comments or tips, definitely including the "it-won't-work-because" kind. Thanks. --Jim
In the design, almost all of the Prop pins are in constant use, with the possible exception of the four SD card signals (DO, CLK, DI, /CS). I don't really have any other good candidates elsewhere (and can't use I/O expanders, etc). Even P28-31 are busy. So, I'm eyeing these SD card signals to see if something could be done there.
Might an audio signal be sent out on one of those pins if the active-low chip select line were held high during the time the card wasn't actively being accessed? Or is there some data coming back from the card when the CS line is high? Hopefully not. If not and nothing else stands in the way, I wonder what would be the best SD card pin choice to pass the audio on.
Also, as you can probably guess, I wouldn't want an audio transducer emitting sound or otherwise spazzing out while the SD card was in use. So, perhaps the CS line could be used to disable an AND gate or similar to prevent passing through the signal associated with an active SD card. I won't need the audio transducer to emit sound while accessing the SD card, just when the SD card is not in use. Incidentally, currently, I don't access the SD card all that often, perhaps once a minute for a couple seconds (and at least most, currently all, of the accesses are/will be reads). Lastly, the audio signal would NOT be generated and OR'ed in (by the Prop's internal pin circuitry) with an SD pin when the SD card was active.
And if something along those lines is possible, I wonder if I'd have to unmount the SD card when doing audio. I'm all ears for any comments or tips, definitely including the "it-won't-work-because" kind. Thanks. --Jim
Comments
Which pins to use?
Well, /CS like you say can select audio or SD, and like you say, an AND gate (eg 74HC08) would work. Low for SD, High for Audio.
That leaves 3 pins, and it may not matter, but DO is data from the SD to the Prop, so in the event of a software glitch and data clash, maybe audio and DO might end up fighting each other, so would suggest use CLK and DI. Why not use both and have stereo sound?
In terms of unmounting, I think it is the unmounting in software that might be the part that makes /CS high, but maybe double check that.
Sounds like a really clever idea.
If you are going to add a 74HC08 chip and one one (mono) or two (stereo) gates, with another spare gate, you could use it as a buffer (possibly not even needed) on the /CS line to a LED and then you can easily see if the /CS line is being deselected by the software.
Only catch like you say is that playing .WAV files off the SD card won't work so well but many other things would work fine - eg synthesizer objects.
This whole discussion presumes that there are no other pins available and that the SD card is the only viable option. Unless you let us in on the big picture I'm afraid you will only get answers couched within the narrow confinements of your question. State openly what you do have and you may be surprised to find that there is a much better solution.