This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Does AT91 SPI driver support external SPI devices?


On Wed, Feb 28, 2007 at 03:04:10PM +0100, Julien St?phane wrote:
> Hi,
>  

> I still have problems to make SPI work on my AT91 evaluation
> board. I hava nothing to the SPI output of my AT91EB55 board
> (sniffing with scope). I've studied the datasheet of my processor
> and have seen the block diagram attached to this mail. Apparently,
> there are switches default openned to activate SPI signals.

> I didn't found in code where these switches are closed, so I have
> tried to write directly to the memory with HAL_WRITE_UINT32 to close
> them but no chages appears. Furthermore, I've studied the at91 SPI
> driver code and I have readed this comment in the function
> spi_at91_transaction_begin() :

>  
>     /* As we are using this driver only in master mode with NPCS0 
>        configured as GPIO instead of a peripheral pin, it is neccessary 
>        for the Mode Failure detection to be switched off as this will
>        cause havoc with the driver */ 

This is to work around a hardware bug. When the SPI peripheral drives
the NPCS lines, it gets it wrong for all but NPCS0. This is documented
in the errata somewhere. To work around this, the NPCS lines are set
as GPIO lines and controlled that way.
  
> My question is the next one : Does the driver support sending datas
> through SPI to external devices or not?

Well a number of people have reported it working, John Eigelaar,
Sebastian Block, Savin Zlobec.

> If the answer is "yes", can I get help please? I think I initialize
> the SPI bus and device correctly and I'm sure that I call the
> correct functions because I print debug messages in the driver. If
> it can help, I attached my source code.

O.K. Lets start with a silly question. Are you sure you are looking at
the correct pins. The pins used for NPCS are configurable by CDL. On
most AT91 devices, the peripheral devices can select between multiple
pins on the chip. Which pins do you have you logic analyze connected
to? Which pins is the SPI device driver using?

    Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]