Standalone MCI-Code?

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi
I am looking for Code for the MCI-Interface.
I need to interface SD-(SDHC)-Cards.
Currently I only need to initialize them and Read Blocks. I prefere the 4bit mode.

Did someone managed to interface sd-cards?
Can someone provide code?

This would be a grat help..

Greetings

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK.. due to nobody is answering:
I do not need it due to laziness.. the point is that i am having a CPLD programmed as a 5way-Bidirekctional multiplexer fot 2 SD-Cards.
The SPI-Mode does work. Now the AP7k must learn to manage the SD-Card with its MCI-Interface. This is verry complex. (more complex than the SPI-Mode)

The point is, that i do not want to search bugs that are not softwarebugs.
I need working code to chack the CPLD-Programm.

Please help!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There is a driver in the UC3A3 software framework.
http://www.atmel.no/beta_ware
See in DRIVERS/MCI and COMPONENTS/MEMORY/SD
You might be able to get something from it for AP7.

-sma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

haha sma ;-)
There is no directory called MCI and no Directory calles MEMORY/SD (of course there is one - but it uses the SPI)

Can you give an exact dowenload where to find these directories?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Of course there is in A3 framework.
http://www.atmel.no/beta_ware/av...

-sma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sry.. i have rrad UC3A and missed the last "3" ;-)
Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hehe :D

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK. I have ported the Code into my environment.
Init works completly, reading is also no problem.
Writing data is weird.

Software says "no problem" while writing, but read after write shows, that the card didnt write anything. But commands were accepted ans everything looks good (point of view: software return values)

Does this beavior can be explained?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are you using DMA?

-sma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not yet. Time for DMA comes when non-dma-transfers are working.
Do you think that my writing to AVR32_MCI.tdr is the problem?

Last Edited: Tue. Jun 2, 2009 - 09:56 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hmm the MCI on UC3A3 and AP7000 might be different version. I wonder if this might comes from here.

-sma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There were some differences, yes.. bus this was almost the respons-type-field.

But the Idea seems to be right. Datalines seems to have a constant level :-/(I am wringting 0xaa55aa55 / 0x55aa55aa)
What reason could the MCI-Controller have to be so lazy? ;-)
Are there special bit to enable the TX-Channel?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Did someone managed to interface sd-cards (UC3A3 driver for AP7000), properly?
Can someone provide code?

This would be a great help!

Greetings.