LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices

Reply
 
Search this Thread
Old 02-15-2013, 08:28 AM   #1
domenicocelentano
LQ Newbie
 
Registered: Feb 2013
Posts: 2

Rep: Reputation: Disabled
SPI driver with two devices sharing the same CS


I'm developing on a AM1808 based board (w sdk 5.03.02.00) an I want to use the AD7682 shared with an LCD.

I modified the board configration file in this way in order to use the same CS with two devices:

static struct spi_board_info da850_k5_spi_info[] = {

[0] = {

.modalias = "ili934", /* spidev */

.mode = SPI_MODE_0,

.max_speed_hz = 5000000,

.bus_num = 1,

.chip_select = 2,

},

............................

............................

[3] = {

.modalias = "hx8238",

.mode = SPI_MODE_0,

.max_speed_hz = 5000000,

.bus_num = 1,

.chip_select = 2,

}

}

The kernel start correctly but I have the following message: "spi_davinci spi_davinci.1: chipselect 2 already in use"

I wanto to comunicate with the LCD only at startup. After that I close the LCD driver and start to comunicate with the AD7682 driver.
Is there a way to do this?

Thanks everyone in advance.
 
Old 02-20-2013, 06:50 PM   #2
gdejonge
Member
 
Registered: Aug 2010
Location: Netherlands
Distribution: Kubuntu, Debian, Suse, Slackware
Posts: 298

Rep: Reputation: 70
Sorry, but you can't share the cs line directly. That's the whole point of chip select. Both chips would be active at the same time and the results would be unpredictable. A possible option could be connecting one of the chips through an inverter chip. In this case only one of the chips would be active at any given moment.
Somthing like this:
Code:
|
|------------- cs
|
|-------|>o--- cs
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to write a SPI driver ? baboundu81 Linux - Embedded & Single-board computer 1 02-01-2013 11:02 AM
Problems with dynamic registration of SPI protocol slave devices Brahmsian Linux - Embedded & Single-board computer 1 04-18-2012 02:20 AM
Can i register a ssc driver (a serial interface device) to be a spi driver ? 5883 Programming 0 03-04-2012 07:14 PM
SPI Driver for Remote Control? NSS Linux - Embedded & Single-board computer 1 09-26-2011 04:09 PM
Communication with SPI driver Mactub Linux - Software 2 03-16-2010 03:17 AM


All times are GMT -5. The time now is 06:11 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration