Hi Community,
the Title says (almost) all - ´m quite Stuck concerning using the HSMCI-Interface with Assembly in order to get Access to a HCSD-Card.
If i may add - i´m not totally unfamiliar with handling of SD-Cards, since a lot of self-written SD-ASM-Code has been involved in
my AVR and X51-Projects (for the past 25 Years) and it works there quite happy, but the HSMCI-Interface vs SPI-Access is of course quite different.
Well, after some struggeling regarding a proper Port Setup/Peripheral assigment/Clock speed i think that the interfacing to the card does work at all-
on a very basic level. Far below the 400 KHZ-Limit for initialisation. After sending 74 Clock Cycles in 1 Bit-Mode and after CMD0 (without response)
i send a CMD8 with Argument 0x1AA and the card responses with 0x1AA. So far, so good. Although the card normally responses on CMD0 with 0X01
on my other platforms, but here it doesn´t happen.
The next command is CMD59 with an 48 Bit response in order to turn CRC checking off (of course unnecessary on this platform, but just "for the sake of it"),
but the card also responses with 0x1AA and i´m not sure if this would be correct, because i have maximum difficulties to switch my brain from 8 to 32 Bits
when it comes to the response at all.
The 0x1AA-Response of CMD8 is understandable to me (0x1=Voltage accepted, 0xaa=Command mirror), but the next Command, which throws the same response,
couldn´t let me decide if the command response is ok or not. At the moment í am "feeling" that the last command (CMD8) hasn´t been successfully terminated - for whatever reason.
Before each submitted command i fill of course the Argument register with the proper values, check XFRDONE in HSMCI_SR for the command register being "free" and after
submitting the command register i also check CMDRDY in HSMCI_SR.
In 8 Bit SPI Mode i would read consecutive one byte after another from the Response and, in this case, at the third byte i would get "0x01", which indicates
an idle state=OK, next command. But at 32 Bits (or more) i would have to cut up those 32 Bits in 4*8 Bit Chunks and check if any of these chunks contain a valid response.
And here i don´t know if this would be a correct method or not, because i am unaware if a correct response would be rather "0x00000001" in the resposne register or the above
mentioned method. I´m also unaware which role play the additional response registers of the HSMCI-Interface - if this is more a buffer where the contents move from Response
Register 4 up to Response Register 1 for each consecutive read of Response Register 1 - or not....
Any help is very appreciated !
Kind regards !