From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25286 invoked by alias); 27 Feb 2007 21:28:09 -0000 Received: (qmail 25271 invoked by uid 22791); 27 Feb 2007 21:28:08 -0000 X-Spam-Check-By: sourceware.org Received: from secure.webhostingcanada.org (HELO secure.webhostingcanada.org) (64.246.1.38) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 27 Feb 2007 21:28:01 +0000 Received: from [149.99.187.190] (helo=RX8) by secure.webhostingcanada.org with esmtp (Exim 4.52) id 1HM9rU-0007Rb-Kn; Tue, 27 Feb 2007 15:27:52 -0600 From: "Nicolas Brouard" To: =?iso-8859-1?Q?'Julien_St=E9phane'?= , Cc: "'Etique Philippe'" Date: Tue, 27 Feb 2007 21:28:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook, Build 11.0.5510 In-Reply-To: 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] RE: SPI problem on AT91EB55 X-SW-Source: 2007-02/txt/msg00256.txt.bz2 Message-ID: <20070227212800.RKvbSOdwsYXwVtYn2KPTtvNpW4vCiwMlpB7v95mVtgU@z> Maybe try to reduce the baudrate. Use 50000 or 500000 instead of 3000000 to see the signal easily with the scope. Put an infinite loop to send data during a long time in order to be able to setup your scope.=20 Nicolas -----Original Message----- From: Julien St=E9phane [mailto:Stephane.Julien@he-arc.ch]=20 Sent: Tuesday, February 27, 2007 04:26 To: ecos-discuss@ecos.sourceware.org Cc: Etique Philippe Subject: SPI problem on AT91EB55 Hy everybody, =20 I have problems for programming SPI on AT91EB55. I have plugged an oscilloscope 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 transfer start .cs_dw_udly =3D CS_DW_UDLY, // Delay in usec between transfer end 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(); } -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss