Hey seb, sorry I didn't notice your reply to this... I can add a constant for this delay, but the default value must contain this delay (or if defined like you suggested)
Also however... in order to do a write, you must write 512 bytes at a time (1 sector), so in worst case you will need 10ms delay after a 512 byte write. that is about 20us per byte + whatever speed you can clock it in at (up to 50mhz). This delay is only used when you stop writing, not for every byte or for each sector. you could write 50 sectors then stop, resulting in one 10ms delay at stop_write. Matt. On Nov 18, 1:41 am, Sebastien Lelong <[email protected]> wrote: > Hi Matt, > > > Log: added 10ms delay to sd_stop_write procedure per colin at jallist > >http://tech.groups.yahoo.com/group/jallist/message/27415, fixed notes in > > large_array sample. > > If I understand correctly, these 10ms delay are here for some SD-Cards. Some > works without, some require this delay. I've never experimented SD-Card (I'm > waiting for your tutorial :)), but 10ms for each write seems quite a long > delay, it may slow down things quite a lot ? > > Maybe this _usec_delay call can take a constant, defaulting to 10_000, user > could adjust it to his cards, including not using delay at all. Some > documentation will be required explaining this value. > > -- in sample > const bit SD_SLOW_CARD = true > const word SD_WRITE_IDLE_DELAY = 5_000 > > -- in lib > if defined(SD_SLOW_CARD) == true & SD_SLOW_CARD == true then > if defined(SD_WRITE_IDLE_DELAY) == false then > -- defaulting > const word SD_WRITE_IDLE_DELAY = 10_000 > end if > end if > > -- then in write procedure > > procedure sd_stop_write() is > ... > if defined(SD_SLOW_CARD) == true & SD_SLOW_CARD == true then > _usec_delay (SD_WRITE_IDLE_DELAY) > end if > end procedure > > What do you think ? > > Cheers, > Seb > -- > Sébastien Lelonghttp://www.sirloon.nethttp://sirbot.org -- You received this message because you are subscribed to the Google Groups "jallib" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jallib?hl=.
