EmbDev.net

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


von John B. (twelvetones)


Rate this post
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_projects/efsl_arm/index.html.)
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

von John B. (twelvetones)


Rate this post
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

von Martin Thomas (Guest)


Rate this post
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

von John B. (twelvetones)


Rate this post
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

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.