Dear Paven,
I don't know if it is the same case but check the link:
http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&message.id=7443#M7443
I hope it helps.
Cheers,
Celso
Dear Celso,
Thanks for your suggestion.
I had already tried the same but didn't get the correct response.
I also checked the whole forum regarding the SDCard interface and tried out the suggestions in the posts all are in vain.
So can you please find me a possible way to get this sorted.
Thanks,
Paven
Dear Paven,
Maybe you could try to run your software on SPI2 at the same hardware, maybe your software is a little bit different. Open your premises, don't assume everyhing is right. If you get stuck on it, it could take weeks to get out.
Have you scoped the SPI lines?
If you want help in your code, maybe it would be better to post it.
Cheers,
Celso
Dear Celso,
Please find the attachment for my code and schematic of my hardware.
I tried the SPI communication with another board and it seems to be working.
Please suggest me if any changes to be made on the code or on the hardware.
I can't try the same on SPI2 because I am using those pins for some I/O functions.
I tried to scoop the lines while in debug mode by single stepping
I got the correct signals on SS1 pin and couldn't able to see any pulses on the other pins (MOSI,MISO,SPCLK)but can see some kind of level changes (looks like spikes)on it initially.
Thanks,
Paven
Paven,
I don't know your processor frequency, I'm working on 24 MHz and the SPI baud rates don't match on yours.
In my case I've got SPIBR=0x15 for 400KHz and 0x11 for 3 MHz.
Cheers,
celso
Dear Celso,
My processor frequency is 16MHz.
spi baud rate = bus clock/(prescalar*divisor) // Refer page 337 on MCF51JM128RM.pdf
= 8MHz/(5*4)
= 400KHz
In your case, your processor freq is 24MHz
So, baud rate = 12MHz/(2*64)
= 93750Hz
I am confused.
Can you just explain your baud rate calculation.
Thanks,
Paven
Sorry Paven,
The frequency I was talking about is the internal frequency.
I've checked and I'm working on 187,5KHz on low speed and 3 MHz on hi-speed.
I can't check in on scope right now, but I'll probably check this week.
Cheers,
Celso
Dear Celso,
I have tried to shot the sequences of the SPI data (MOSI) that is sent to the SD Card.
I shot that and added in the attachment for your view.
The first 10 0xFF 's were the delay for 80 clocks with CS = 0.
Then, I send 8 0xFF 's with CS = 1 and that data is not seen the MOSI pin.
Then I send the command, 4 zero's and CRC.
After I tried to read from the SD Card with retry count 25.
But, I am always getting 0xFF as the response.
I hope this may give some clue to you about the issue.
Waiting for your reply.
Thanks,
Paven