From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19484 invoked by alias); 1 Mar 2007 13:04:03 -0000 Received: (qmail 19474 invoked by uid 22791); 1 Mar 2007 13:04:01 -0000 X-Spam-Check-By: sourceware.org Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 01 Mar 2007 13:03:49 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1HMkwX-0005fb-00; Thu, 01 Mar 2007 14:03:33 +0100 Date: Thu, 01 Mar 2007 13:04:00 -0000 To: Julien St?phane Cc: Andrew Lunn , Etique Philippe , ecos-discuss@ecos.sourceware.org Message-ID: <20070301130333.GI14399@lunn.ch> Mail-Followup-To: Julien St?phane , Andrew Lunn , Etique Philippe , ecos-discuss@ecos.sourceware.org References: <20070228144319.GC24209@lunn.ch> <20070228151737.GA14399@lunn.ch> <20070228155857.GC14399@lunn.ch> <20070228173706.GD14399@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) From: Andrew Lunn X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] RE?: RE: RE: RE: [ECOS] Does AT91 SPI driver support external SPI devices? X-SW-Source: 2007-03/txt/msg00006.txt.bz2 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