>   - send_command() should be prefixed with sd_send_command() to avoid
> potential collision

Your right, I didn't notice this.

What if I need to read these values ? I don't understand the
> following loop:
>
>    if sd_byte_count == 0 then               -- beginning of sector read
>       while spi_master != 0xFE loop      -- wait till data is ready to read
>       end loop
>    end if
>
> Basically this is why my sample doesn't work, commenting the "while" loop
> fixes the issue.

Before a sector is ready to read, you should get one 0xFE.
Sector size is almost always 512 on hard disks and sd cards.
After a sector read, there are two CRC bytes.

Yes, you should read in 512 byte chunks and must write in 512 byte
chunks. I think some sd cards do support byte by byte reads/writes. I
have not looked into it.

I guess this method was chosen for speed of PC's, and smaller
addressing.

Matt.

-- 
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=en.

Reply via email to