Offline
Newbie
Karma: 0
Posts: 41
|
 |
« Reply #150 on: February 26, 2013, 06:49:23 am » |
When I run the BareMinimumWithDebug, the error code is 3.
Can anyone answer post number 145? Thank you.
Kindly check the schematic. I always connect my CS pin on pin 4 which is T0 (PD4) of the ATMEGA328P.
|
|
|
|
« Last Edit: February 26, 2013, 07:40:27 am by meowth08 »
|
Logged
|
|
|
|
|
Offline
Jr. Member
Karma: 6
Posts: 66
|
 |
« Reply #151 on: February 26, 2013, 12:25:14 pm » |
Hi, it seems that is still something wrong, either with wiring or something else.
Regarding post 145: If you build your voltage dividers correctly and assuming that you are not driving MISO as output you should not measure more than 3.3 - 3.6v anywhere on the SD card.
Please also check: 1. You use a SD or SDHC card, but not SDXC. Old MMC cards may work - not tested. 2. You use Arduino IDE 1.0 or up to 1.0.3, but not 1.5 (the beta version only for Due) 3. If you use a ATmega328 based Arduino, even a clone, you should use an unpatched Arduino IDE and program the Arduino using one of the boards-setting that came already with the standard IDE. 4. If all is ok, check if your Arduino is still working on all ports used by the SD card. Set ports to output and high and you should measure 3.3v at appropriate SD pins.
|
|
|
|
|
Logged
|
|
|
|
|
UK
Offline
Sr. Member
Karma: 9
Posts: 351
|
 |
« Reply #152 on: February 27, 2013, 03:01:13 am » |
Have you tried with a different SD card?
I have some SD cards that just won't initialise in my card reader. I have two cards exactly the same, 2gb and same make and model, and only one will work with the reader. Both work in the pc. I also have some microSD that won't work either, where others do.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 41
|
 |
« Reply #153 on: February 27, 2013, 03:59:38 am » |
Hi again. I'm almost losing hope. But before I turn into incredible hulk and destroy everything, I'll try my best to do it.  I am attaching an image of my connection to the crapduino and to the sd card. Question: What brand of SD cards are working for this application? SD card CS goes to pin 4? Please check the attached image...
|
|
|
|
« Last Edit: February 27, 2013, 05:51:47 am by meowth08 »
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 41
|
 |
« Reply #154 on: February 27, 2013, 04:49:29 am » |
Kindly let me know what it means by the error codes so I know what to check.
Thank you.
When I upload, I sometimes get this error:
avrdude: stk500_getsync(): not in sync: resp=0x00
I'm using an Aduino 1.0.3 IDE.
|
|
|
|
« Last Edit: February 27, 2013, 05:14:54 am by meowth08 »
|
Logged
|
|
|
|
|
0
Offline
God Member
Karma: 6
Posts: 918
Arduino rocks
|
 |
« Reply #155 on: February 27, 2013, 08:00:02 am » |
not sure of the error.. seems like it cant communicate..
as for the CS pin.. why do you have it connected to several pins?
seems like it goes to pin D4.. but 'also'.. D10 (SS) pin as well??
just follow the wiring diagrams that have been posted for you.
|
|
|
|
« Last Edit: February 27, 2013, 10:55:59 am by xl97 »
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 41
|
 |
« Reply #156 on: February 27, 2013, 10:40:03 am » |
Hi
I think I followed exactly the schematic you posted. There are 3 voltage dividers connected to MOSI, SCK, and CS.
PLUS: The testing for the BAREMINIMUMWITHDEBUG says that CS pin of SD card goes to digital pin 4 of crapduino.
What part did I not follow sir? I really need the audio ASAP. It's for a school project.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
God Member
Karma: 6
Posts: 918
Arduino rocks
|
 |
« Reply #157 on: February 27, 2013, 11:02:35 am » |
Im saying (to me at least).. it looks like you have the CS pin on the SD card connected to two other places on the Atmega
Is that how the other diagrams posted have it? (two places)
I have tried BOTH (with this library)..
using D4 and D10 and the CS pin...
and of course using D9 as the default audio output pin..
this gives you 'basic' audio output.. unless you build in a filter/amp..etc..
(more advanced/better audio output is use D4 as the CS pin.. and use BOTH D9 & D10 for audio output. [along with a few other components])
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 41
|
 |
« Reply #158 on: February 27, 2013, 11:32:52 am » |
I misunderstood the hardware set-up.
Is this correct already? (check image)
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
God Member
Karma: 6
Posts: 918
Arduino rocks
|
 |
« Reply #159 on: February 27, 2013, 12:11:47 pm » |
If you change the code/sketch it 'could' work...
but if you leave the purple (D4).. and remove the SS (D10)..
it should work out of the box..
you also need to use D9 >>> electrolytic cap >>> speaker >>> GND
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 41
|
 |
« Reply #160 on: February 27, 2013, 05:15:27 pm » |
remove the SS (D10).. Does it mean that the voltage divider: D10-----4k7----.----10k-----gnd will be removed?
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #162 on: March 04, 2013, 12:08:18 pm » |
Hi, Great lib.But, Is there any scope of varying the pitch/speed of the file in the SD card ? Thanks.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Jr. Member
Karma: 6
Posts: 66
|
 |
« Reply #163 on: March 04, 2013, 05:49:01 pm » |
Hi, it is not foreseen yet to change the pitch yet, at least not in fine amounts. You can select between half or full-rate, but that's all. If you want to change the playback speed in finer amounts, it is not possible with that library yet and you wont get usable result just by changing the timer rate because the timer already runs at relatively high speed allowing only massive pitch changes.
The easiest way to do such things might be to prepare multiple files on the card each with a different pitch and play those. You can do this using an audio editor like Audacity to prepare such files.
If you really want to go the hard way it should be possible to modify the library to support different playback rates - at least two options came in mind for me, changing the playback-interrupt function or the worker-function. The worker-function is written in plain C and should be easier to modify but with rate-changing it would not be longer operating at sector boundaries. In the playback function rate changing only have influence over buffer empty speed but it is harder to understand as it is written in Asm. The algorithm I would prefer is a phase-accumulator that decides if and how many samples are skipped or repeated for every target sample...
Tuttut
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #164 on: March 05, 2013, 01:58:54 am » |
Thank you tuttut for the reply. OK, I take the easy way you have mentioned. One more question. I need to play a 5sec audio as a seamless loop:indefinitely .Though I am able to accomplish that with the "Bare minimum" you have provided,there occurs an audio glitch at the end-to-beginning of the file played. The file has perfect zero-crossing at the beginning and in the end.Could you please suggest anything to avoid this problem. (My gadget: Ardiuno Atmega 328+LC studio SDcard breakout board). Thank you again.
|
|
|
|
« Last Edit: March 05, 2013, 02:01:39 am by manmachine »
|
Logged
|
|
|
|
|
|