From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7359 invoked by alias); 28 Feb 2007 16:45:58 -0000 Received: (qmail 7346 invoked by uid 22791); 28 Feb 2007 16:45:57 -0000 X-Spam-Check-By: sourceware.org Received: from smtpgw1.he-arc.ch (HELO smtpgw1.he-arc.ch) (157.26.64.10) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 28 Feb 2007 16:45:44 +0000 Received: from neptune.he-arc.ch [157.26.81.11] by smtpgw1.he-arc.ch with XWall v3.35 ; Wed, 28 Feb 2007 17:45:16 +0100 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Wed, 28 Feb 2007 16:45:00 -0000 Message-ID: References: <20070228144319.GC24209@lunn.ch> <20070228151737.GA14399@lunn.ch> <20070228155857.GC14399@lunn.ch> From: =?iso-8859-1?Q?Julien_St=E9phane?= To: Cc: , "Etique Philippe" 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: [ECOS] =?iso-8859-1?Q?RE=A0=3A_=5BECOS=5D_RE=3F=3A_RE=3F=3A_=5BECOS=5D_Does_AT?= =?iso-8859-1?Q?91_SPI_driver_support_external_SPI_devices=3F?= X-SW-Source: 2007-02/txt/msg00269.txt.bz2 Yes, the processor is a AT91M55800A. Effectively, it has only one SPI devic= e. First, I printed the values of "val" in the set_npcs function. Effectively,= they change when I change the dev_num value. As I understand the function = and the values printed, it is not writed to work with a multiplexor. So I h= ave redefined this function : static void spi_at91_set_npcs(cyg_spi_at91_bus_t *spi_bus,int val) { /*cyg_uint32 ctr; for(ctr=3D0;ctr<4;ctr++) { printf("### val1=3D%i, val2=3D%i ###\n",val, (val & (1<cs_en[ctr]) { HAL_ARM_AT91_GPIO_PUT(spi_bus->cs_gpio[ctr], (val & (1<cs_gpio[0], 0); HAL_ARM_AT91_GPIO_PUT(spi_bus->cs_gpio[1], 1); HAL_ARM_AT91_GPIO_PUT(spi_bus->cs_gpio[2], 0); HAL_ARM_AT91_GPIO_PUT(spi_bus->cs_gpio[3], 1); } I have tried many values for the different bits because I don't know which = is the MSB and the LSB. No changes appeared. I never had the chip select CS= 5-8 activated. Thanks very much, St=E9phane. ________________________________ On Wed, Feb 28, 2007 at 04:33:57PM +0100, Julien St?phane wrote: > I don't know how to put the correct value because my board > (AT91EB55) use a BIN/OCT converter. So if I want to use the device > 4, the value of NPCS0=3D0, NPCS1=3D0, NPCS2=3D1 and NPCS3=3D0. > The pins number of different NPCS are : NPCS0=3Dpin98 (PA26), > NPCS1=3Dpin99 (PA27), NPCS2=3Dpin100 (PA28) and NPCS3=3Dpin101 (PA29). The EB55 is actually an M55800A? If so, its pins are not as flexible as the AT91SAM7 devices. There is only one place the SPI pins come out of the chip. > What does the AT91_PIN(.., .., ..) mean? Do I have to define the > AT91_SPI_NPCS1 in my code or in the driver? I think in my code... They are defined in var_io.h in the HAL. You can just use them in your SPI configuration. The default values should be O.K. I suggest you single step through spi_at91_set_npcs(). As it sets the bits you should see the NPCS outputs from the chip change. Check what is going into the demultiplexor and what is coming out of the demultiplexor. 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