Shop OBEX P1 Docs P2 Docs Learn Events
Help - sdspi (spin only) works but not sdspiasm — Parallax Forums

Help - sdspi (spin only) works but not sdspiasm

bongkbongk Posts: 14
edited 2010-04-29 20:43 in Propeller 1
Hi All,
I'm a bit of a newbie, I'm hoping you can help with some direction in my next troubleshooting step.

I'm attempting to play a WAV file from an SD card.

I can read and write my SD card using the sdspi (spin only) object, but I hang up if I use the sdspiqasm object.

If I try and play the WAV file using the sdspi (spin only) object I get a buzzing/clicking sound, I'm assuming I need to use the ASM version to get enough speed to read the SD card to play the WAV file.

I'm using fsrw-and-friends-1.7.· If I do the sdrw_test it works with the sdspi.spin but not the asm versions of sdspi.
My SDCard is actually a Micro-SD card in an SD-Card adapter, the SD card adapter is soldered onto a small breadboard along with the pull up resistors.· This small breadboard is then plugged into the solderless breadboard holding my prop chip.

Is the problem that its a Micro-SD card and not a standard SD-Card?

The circuit design I followed for my SD card circuit used 10K resistors for pullups and did not connect anything to pin 9 on the SD card.· Now I see the comments in sdspi says to use 20k pullups and connect onto pin 9 as well.· Should I rebuild my SD card reader to use 20k resistors?

Could the problem be that I'm using a solderless breadboard and wire jumpers, which can't work cleanly enough at the high frequencies used by the sdspi asm code?

Other suggestions?

Thanks a bunch in advance,
Kevin

Comments

  • rokickirokicki Posts: 1,000
    edited 2010-04-29 18:29
    Can you post a picture of your setup? The assembly code doesn't use frequencies *that* high; I've always
    done my work with breadboarded adapters.

    *Maybe* there's a bad connection in there somewhere increasing some resistance.

    The pullups should not matter.

    What WAV player did you use? Did you make any changes to the code?
  • bongkbongk Posts: 14
    edited 2010-04-29 18:53
    I should be able to post a picture tonight, I'm not at home now.

    I used multiple wav players with the same result.· Right now I'm testing with "Wav Players" by Raymond Allen from the obex because he included test wav files so I can be certain my problem is not the wav files I created.

    Basically I downloaded "Wav Players" and "fsrw-and-friends-1.7" from the obex.

    In Wav Players..Play_16bitMono.spin the only lines I changed were to switch from VGA on pin 16 to tv on pin 12:
    ··· text : "vga_text"··· 'For NTSC TV Video: Comment out this line...
    ··· 'text : "tv_text"··· 'and un-comment this line·

    · text.start(16)··· 'Start the VGA/TV text driver (uses another cog)

    If I run this it hangs up mounting the sdcard.
    If I then go into fsrw.spin and change
    obj
    ·· sdspi: "sdspiqasm"
    to sdspi: "sdspi"

    It works, it reads the right ksps from the WAV header and plays a sound but the sound is not right.

    Based on your comments I'm thinking my next step will be to build a new SD Card reader circuit from scratch and see if I get the exact same result.

    Which library are the "safe_spi" and "mb_rawb_spi" located in? (I see they are discussed in a parallel thread today).· Should I try those?

    As an aside my tv-out is not crisp, there seems to be some interference there.· I don't know how good its supposed to be but I'm wondering if its another indicator of some problem with my Prop setup.
  • rokickirokicki Posts: 1,000
    edited 2010-04-29 20:43
    The parallel thread refers to a more recent fsrw (2.6) which you can find in the obex. Since software is simpler
    than hardware, you might try dropping *that* in instead. The 1.7 version you have is old.

    As for tv-out, there's any number of places you can have difficulties, but it is not unlikely that simple capacitance
    on the breadboard might be a factor. Put some caps (say, 0.1uf) as close as you can across the prop power.
    Clean power is critical to clean output. Make sure you have a small electrolytic where the power comes in to
    your breadboard too. You can scope the 3.3 at the prop pins to see what it looks like. Digital CMOS circuits
    take power abruptly.
Sign In or Register to comment.