From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21619 invoked by alias); 27 Feb 2007 10:09:18 -0000 Received: (qmail 21606 invoked by uid 22791); 27 Feb 2007 10:09:16 -0000 X-Spam-Check-By: sourceware.org Received: from nyclavin2.bloomberg.net (HELO nyclavin1.bloomberg.net) (206.156.53.165) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 27 Feb 2007 10:09:11 +0000 Received: from ns2.bloomberg.com ([160.43.8.240] [160.43.8.240]) by nyclavin2.bloomberg.net with ESMTP; Tue, 27 Feb 2007 05:09:09 -0500 Received: from ny2570-dr.corp.bloomberg.com ([172.20.193.211]) by ns2.bloomberg.com (8.11.7p1+Sun/8.10.2) with ESMTP id l1RA96p03283; Tue, 27 Feb 2007 05:09:09 -0500 (EST) Received: from ny2528-dr.corp.bloomberg.com (ny2528-dr.corp.bloomberg.com [172.20.193.160]) by ny2570-dr.corp.bloomberg.com (8.13.8/8.13.8) with ESMTP id l1RA94Zm022631; Tue, 27 Feb 2007 05:09:04 -0500 Received: from lo2525.corp.bloomberg.com ([172.16.16.57]) by ny2528-dr.corp.bloomberg.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 27 Feb 2007 05:09:03 -0500 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Tue, 27 Feb 2007 10:09:00 -0000 Message-Id: <4B24CC52E8A6EB4A95B414126492987C0334816B@lo2525.corp.bloomberg.com> References: From: "Chris Zimman" To: =?iso-8859-1?Q?Julien_St=E9phane?= , 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: RE: [ECOS] SPI problem on AT91EB55 X-SW-Source: 2007-02/txt/msg00253.txt.bz2 Julien, As a first step, why don't you just see if you can get the chip select to t= oggle high/low? If you can't get the driver to do this for you, I'm sure y= ou can write a small piece of code quite easily to do it. I don't know the AT91 in the level of detail to be able to look at this bit= of code and see specifically what might be wrong, but you should make sure= that the SPI interface is being initialized correctly (eg. trace spi_at91_= transaction_begin() in=20 packages/devs/spi/arm/at91/{your version}/src/spi_at91.c In general, I would trace into there and see what's going on. People here = are more willing/likely to be able to help you with specific questions vers= us 'This doesn't work, what's wrong with my code?' --Chris -----Original Message----- From: ecos-discuss-owner@ecos.sourceware.org [mailto:ecos-discuss-owner@eco= s.sourceware.org] On Behalf Of Julien St=E9phane Sent: 27 February 2007 09:26 To: ecos-discuss@ecos.sourceware.org Cc: Etique Philippe Subject: [ECOS] SPI problem on AT91EB55 Hy everybody, =20 I have problems for programming SPI on AT91EB55. I have plugged an oscillos= cope to the corresponding pins of I/O extension connector and nothing come = to the pins. Does it come from a driver problem or an error in code? I have= checked the connections. Here is part of my code :=20 =20 ---------------------------------------------------------------------------= --------------------------------- #include #include #include #include #include =20 #define DEV_NUM 4 //default 0 #define CL_POL 1 //default 1 / mode3=3D1 #define CL_PHA 1 //default 0 / mode3=3D1 #define CL_BRATE 3000000 //default 8192000, 2000000?, 3000000? #define CS_UP_UDLY 1 //default 1 #define CS_DW_UDLY 1 //default 1 #define TR_BT_UDLY 1 //default 1 =20 static cyg_spi_at91_device_t spi_eb55_device CYG_SPI_DEVICE_ON_BUS(DEV_NUM)= =3D //CYG_SPI_DEVICE_ON_BUS(0) { .spi_device.spi_bus =3D &cyg_spi_at91_bus.spi_bus, .dev_num =3D DEV_NUM, // Device number .cl_pol =3D CL_POL, // Clock polarity (0 or 1) .cl_pha =3D CL_PHA, // Clock phase (0 or 1) .cl_brate =3D CL_BRATE, // Clock baud rate .cs_up_udly =3D CS_UP_UDLY, // Delay in usec between CS up and t= ransfer start .cs_dw_udly =3D CS_DW_UDLY, // Delay in usec between transfer en= d and CS down .tr_bt_udly =3D TR_BT_UDLY // Delay in usec between two transfe= rs }; =20 cyg_spi_device *cyg_spi_eb55_device =3D &spi_eb55_device.spi_device; =20 int main(void) { cyg_uint8 tx_data0, tx_data1, tx_data2, tx_data3; cyg_uint8 rx_data; =20=20=20=20 printf("Entering application !\n"); hal_diag_led(0x0); =20=20=20=20 tx_data0=3D0x0; tx_data1=3D0x1; tx_data2=3D0x90; tx_data3=3D0x15; =20=20=20=20=20=20=20=20 printf("Sending data...\n"); cyg_spi_transfer(cyg_spi_eb55_device, 0, 1, &tx_data0, &rx_data); printf("Datas deceived : %i\n",rx_data); cyg_spi_transfer(cyg_spi_eb55_device, 0, 1, &tx_data1, &rx_data); printf("Datas deceived : %i\n",rx_data); cyg_spi_transfer(cyg_spi_eb55_device, 0, 1, &tx_data2, &rx_data); printf("Datas deceived : %i\n",rx_data); cyg_spi_transfer(cyg_spi_eb55_device, 0, 1, &tx_data3, &rx_data); printf("Datas deceived : %i\n",rx_data); =20=20=20=20 cyg_spi_tick(cyg_spi_eb55_device, 0, 1000); =20=20=20=20 printf("End of main !\n"); //cyg_thread_exit(); } --=20 Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss