EmbDev.net

Forum: ARM programming with GCC/GNU tools MISO from SD card never goes low?


Author: John Berry (twelvetones)
Posted on:

Rate this post
0 useful
not useful
I'm trying to get the EFS library running with my AT91SAM7S64 using
Martin Thomas's code (from
http://gandalf.arubi.uni-kl.de/avr_projects/arm_pr....)
My Olimex dev board has an MMC reader that I'm trying to access
currently.

I know SPI is working on my board (I'm using it to drive an LCD dispay
via SPI CS 1), but I can't seem to get the MMC to respond to the 'reset'
command.  The MISO line never goes low and so all responses come back as
0xFF.

I've checked that the MISO pin is configured as an input and that it's
under control of the peripheral A (and not configured as PIO.)

Any ideas where I could start trying to debug the problem?  One idea I'm
having is that the initial 20 SPI commands (with the card deselected)
aren't putting the MMC in SPI mode.

Thanks,
John Berry

Author: John Berry (twelvetones)
Posted on:

Rate this post
0 useful
not useful
OK, update... I managed to get Martin's example code for the AT91
running perfectly by disabling my LCD on SPI CS 1 and running in 'fixed'
peripheral mode.

Has anyone had any luck running the AT91 MMC driver in 'variable' mode?
This is ultimately what I'll need to do if I'm using an SPI DAC chip.

Thanks,
John

Author: Martin Thomas (Guest)
Posted on:

Rate this post
0 useful
not useful
john berry wrote:
> OK, update... I managed to get Martin's example code for the AT91
> running perfectly by disabling my LCD on SPI CS 1 and running in 'fixed'
> peripheral mode.

Yes, the current version of my interface for the efsl "graps" the
complete SPI interface by using fixed peripheral select.

> Has anyone had any luck running the AT91 MMC driver in 'variable' mode?
> This is ultimately what I'll need to do if I'm using an SPI DAC chip.

I have to look into my mailbox, I have got an e-mail from someone who
modified the efsl-interface for variable chip-select but so far I have
not received the source of the modified interface-code. It should be
rather easy  to modify the code but since I do not own a "ready-made"
AT91SAM7 with SD-slot I have to build some test-platform again ( or send
me your Olimex board ;-) ). This may take some time since I have several
other things to do. Maybe someone else can jump in here.

Martin Thomas

Author: John Berry (twelvetones)
Posted on:

Rate this post
0 useful
not useful
Hi Martin,

Actually, it was really quite easy to get your code working in
'variable' mode.  All I had to do was clear the 'FIXED' bit set in the
Mode Register!  Since you're writing the CSR value into the Transmit
Data Register everything seemed to work fine.

Now the real question :)  Are you aware of anyone who's gotten DMA to
work with your driver?  I'm interested in giving it a shot since I'm
going to need as many free CPU cycles as possible to process the data
I'm pulling off the card.

Thanks for your responses and for the work you've done on this driver.

John

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.