Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/25/08 06:49
Read: times


 
#159341 - some answers
Responding to: ???'s previous message
Per Westermark said:
2) Yes, I know SPI is synchronous. But I have to assume one of two things. You either added the delay because you considered it needed. Or you added it because you thought it looked neat. If you do need the delay, then modify the delay function so it can be trusted on different compilers (or compiler versions) or with different optimization levels. If you added the delay just for fun - remove it and run full-speed.


I think the delay is necessary. Reading the specs (those i found may be not complete), i found that during the initialization phase, your spi transmission speed must stay under 400 khz. Once initialized, you can go on with full speed.

Per Westermark said:

6) Ouch. Hard to read the code when unknown parts gets lost in the translation.



That's life ! When you write code, you have to pay attention to lost tabs and space but also to code avoiding HTML tags...


Per Westermark said:

7) Are your code to wait for the response correct? You check if the response is =1. Shouldn't you first write 0xff and get back a 0xff, and then write one more 0xff and get back an answer with most significant bit zero and the other flags representing the status?


I think a part of the problem is here. I've try different solutions copying what has be done on other µC (pic and avr). But before to get access to card status, you have to initiate a correct spi connection.


Per Westermark said:


8) What voltage to you have on your signals?


5 volts on the µC side - 3.3Volts on sd card side

I use discrete levels translators made from transistors and resistances.

Per Westermark said:


9) Are the signals looking distinct on the scope?



Yes, well squarred. I have keep the distance between µc and the card as short as possible (5 cm/ 2")

Thanks to everyone for your answers. i will post here a solution if i find one.






List of 12 messages in thread
TopicAuthorDate
bit banged spi on ds89C420 for sd card            01/01/70 00:00      
   Some notes about the code            01/01/70 00:00      
      some more details            01/01/70 00:00      
         Have you found the "real" specification?            01/01/70 00:00      
            Keil logic analyzer            01/01/70 00:00      
               GIGO - verify with the so-called standard            01/01/70 00:00      
                  I agree !            01/01/70 00:00      
         More comments            01/01/70 00:00      
            some answers            01/01/70 00:00      
               Have you considered....            01/01/70 00:00      
                  3V3 to 5V is easily accomplished ..            01/01/70 00:00      
               To Show My Point            01/01/70 00:00      

Back to Subject List