Shop OBEX P1 Docs P2 Docs Learn Events
Releasing the DO output from the SD in TAQOZ — Parallax Forums

Releasing the DO output from the SD in TAQOZ

Peter JakackiPeter Jakacki Posts: 10,193
edited 2019-02-21 04:03 in Propeller 2
Here's some information about the SD DO line that stays enabled regardless of the SD chip select.
It needs at least one clock after the chip select goes high with DI high. Here I issue a CMD0 just to activate the DO etc and then release the DO.
TAQOZ# 0 0 CMD . --- 1 ok
TAQOZ# 60 HIGH 61 HIGH 61 LOW  --- ok
Normally I supply 8 clocks for the SD card but a single clock is all it needs to release the output.
60 HIGH takes the SD chip select high
61 HIGH is the SD clock
Usually DI is left high anyway but you can do a 59 HIGH if you want to make sure.

My scope shows the DO floating to the midpoint where I have placed 100k to 3.3V and 100k to ground bias network for this test. (MOSI and MISO labels are swapped)


b4005b45f4af828ac5c0a42aae4428.png

This is the new TAQOZ running in the FPGA image at 20MHz
-------------------------------------------------------------------------------
  Parallax P2  .:.:--TAQOZ--:.:.  V1.1--v33h         190219-1900
-------------------------------------------------------------------------------
800 x 480 - 41K

Comments

  • TubularTubular Posts: 4,702
    edited 2019-02-21 04:44
    Thanks Peter

    This sequence releases the SO on the Samsung 64GB SDXC successfully. From there it'll reboot and reload Taqoz happily

    However, it doesn't work with the Team 64 GB SDXC, which keeps its SO pin at 3v3

    edit: The SanDisk 32 GB was also tested fine, but was already working anyway
  • jmgjmg Posts: 15,173
    Tubular wrote: »
    However, it doesn't work with the Team 64 GB SDXC, which keeps its SO pin at 3v3

    Did I see discussion on this go past a while back, where more than one CLK was needed to release SD ?


  • Tubular wrote: »
    Thanks Peter

    This sequence releases the SO on the Samsung 64GB SDXC successfully. From there it'll reboot and reload Taqoz happily

    However, it doesn't work with the Team 64 GB SDXC, which keeps its SO pin at 3v3

    edit: The SanDisk 32 GB was also tested fine, but was already working anyway

    This was just a quick check but I will test other cards and see what they do, especially after sectors reads. My BeMicro-CVA9 is plugged into a daughter board that has a standard SD card socket so this makes it easier to test as well.
  • With that Team card, just repeating a second time, ie

    0 0 CMD .
    60 HIGH 61 HIGH 61 LOW
    60 HIGH 61 HIGH 61 LOW

    was enough to get SO to float.
  • Cluso99Cluso99 Posts: 18,069
    I found the other day that a minimum of 3 was required on some of my cards. There is an obscure SD reference I found where it said 8 clocks were required. That is what I had hoped my changes achieved. Perhaps I've missed a path :(
  • RaymanRayman Posts: 14,646
    The subject of getting uSD to release DO has been discussed in this forum for years...
    I don't think anyone has found a way to make it 100% reliable in all this time...
  • Perhaps we need to use the P2 analog superpowers, to clock until we see MISO float...
  • cgraceycgracey Posts: 14,152
    Tubular wrote: »
    Perhaps we need to use the P2 analog superpowers, to clock until we see MISO float...

    Or just give it 256 clocks. That ought to do it.
  • In Cluso's code, you could just call '_recvlong' instead of '_sendFF', it would send 32 rather than 8 clock pulses and not take any extra instructions

    http://forums.parallax.com/discussion/comment/1465387/#Comment_1465387
  • jmgjmg Posts: 15,173
    Tubular wrote: »
    In Cluso's code, you could just call '_recvlong' instead of '_sendFF', it would send 32 rather than 8 clock pulses and not take any extra instructions

    http://forums.parallax.com/discussion/comment/1465387/#Comment_1465387

    Could be worth trying - does that meet this rule from above ie is DI known to be HI ?
    "It needs at least one clock after the chip select goes high with DI high."
  • yeah, the Neg dataout, #1 means it only sends 1's out (when sending 8 or 32 bits)
  • Cluso99Cluso99 Posts: 18,069
    Rayman wrote: »
    The subject of getting uSD to release DO has been discussed in this forum for years...
    I don't think anyone has found a way to make it 100% reliable in all this time...

    I have been sharing the SD pins on P1 for many years. I had to patch all the different drivers tho (fsrw, kyes, etc) to send more clocks.
    Totally works, so i must still have a bug somewhere :(
  • Cluso99Cluso99 Posts: 18,069
    I am working on this today to find what is wrong.
  • My take on it...
    SanDisk works with code as is
    Samsung seems to need 1 extra clock pulse
    Team seems to need 2 extra clock pulses

    We need to check other brands, and other Sandisk types other than Ultra.

    The solution if the rom really can't be changed may be to keep buying SanDisk Ultra's
  • jmgjmg Posts: 15,173
    Cluso99 wrote: »
    Rayman wrote: »
    The subject of getting uSD to release DO has been discussed in this forum for years...
    I don't think anyone has found a way to make it 100% reliable in all this time...

    I have been sharing the SD pins on P1 for many years. I had to patch all the different drivers tho (fsrw, kyes, etc) to send more clocks.
    Totally works, so i must still have a bug somewhere :(

    Is it possible those exit-clocks need to be slower ?
  • Cluso99Cluso99 Posts: 18,069
    @tubular,
    I sent you an email :smiley:

    Just refreshing the problem...
    Do any of your SanDisk cards fail in any way?
    That's the easiest for me to replicate for now.
  • @"Peter Jakacki"
    This one's for you. Its not a show stopper, but with a brand new (exFAT) SDXC card, Taqoz gets into a loop. You can see where i type '0 format' to invoke the fat32 formatter, which works fine.

    The trouble is some users might see that looping happening and think they can't type in a command, because its not at the Taqoz# prompt.

    Ignore the SanDisk line early on in the log, thats what Taqoz has booted from

  • Cluso99Cluso99 Posts: 18,069
    @Tubular

    For the CMD8 problem cards...

    Attached is the new respin SD with debugging (ROM_Booter_v33j_SD-003c.spin)

    Run on P2-EVAL with P59 ^ switch on (bypasses SD ROM code on power up)
    Compile/download with pnut/etc and run PST/terminal program and see the results.
  • The was a late version of TAQOZ that i posted without the problematic automount although that has been fixed. Ray has the looping too but was using the older version not realising that the newer version was one he should've used.
  • Ok good point I'm probably not on the latest. Is the version header different eg v2.1?
  • Tubular wrote: »
    Ok good point I'm probably not on the latest. Is the version header different eg v2.1?

    This post here has the latest eval image.
Sign In or Register to comment.