[ECOS] RE?: RE: RE: RE: [ECOS] Does AT91 SPI driver support external SPI devices?

Andrew Lunn andrew@lunn.ch
Thu Mar 1 13:04:00 GMT 2007


On Thu, Mar 01, 2007 at 11:15:17AM +0100, Julien St?phane wrote:
> Mornin',
> 

> I have tested the code you gave me to test the GPIO functiuns and it
> works well! So the problem doesn't become from the GPIO
> functions. They works under AT91M55800A.

O.K. That is good. It is one thing less to worry about.
 
> To understand what the multiplexor does, I have studied its datasheet. If I would like to activate the NSPICS5, I have to put the next values:NSPCS0=1, NSPCS1=0, NSPCS2=1, NSPCS0=3. I did it with the next code. By this way, I think that the dev_num value is ignored. Am I right? :
> 
> static void
> spi_at91_set_npcs(cyg_spi_at91_bus_t *spi_bus,int val)
> {
>    HAL_ARM_AT91_GPIO_PUT(AT91_SPI_NPCS0, 1);
>    HAL_ARM_AT91_GPIO_PUT(AT91_SPI_NPCS1, 0);
>    HAL_ARM_AT91_GPIO_PUT(AT91_SPI_NPCS2, 1);
>    HAL_ARM_AT91_GPIO_PUT(AT91_SPI_NPCS3, 0);
> }
> 

> As I was not sure of the NPCS3 value, I tried to change it and no
> changes appeared. I made many measures before/after the multioplexor
> and on the final board's pins. I checked the connections between
> pins of board and multiplexor, they are OK. No changes appears on
> the final board's pins.

So you are saying that the input to the multiplexor is working as
expected, but the output from the multiplex is not? 
 
> Are you sure that the switches inside the processor are closed (see
> attached schema)? I have never seen this operation... If I want to
> close it anyway, have I got to use the HAL_WRITE_UINT32 function
> with the address and the value of the corresponding register?

Those are set via the HAL_ARM_AT91_GPIO_CFG_DIRECTION macro in the
function spi_at91_init_bus(). If the output from the processors is
working as expected, it means this cannot be the problem.

So it sounds like the multiplexor is the problem. Does it have a chip
select line? Do you need to set a jumper to enable it? 

       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



More information about the Ecos-discuss mailing list