LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 07-17-2009, 04:11 AM   #1
sunr2007
Member
 
Registered: Jan 2009
Location: Bangalore , India
Distribution: Fedora 12
Posts: 65

Rep: Reputation: 17
can i use I/o Port pins of a processor as four SPI pins? i


Hi all,
I want to do an experiment . i want to use processor I/0 pins as SPI pins namely MOSI,MISO,CLK , SS . can i use it ? if not why ? if yes any additional changes i have to make?
warm regards,
Ravi Kulkarni.
 
Old 07-25-2009, 06:13 PM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
clarification

Are you asking if you can integrate this functionality into the kernel, or are you just wanting to write your own SPI interface using these general purpose I/O pins?

Running GPIO pins as an SPI interface is easier from the master side, because you control the clock rate. It is a matter of making sure all of the relevant pins transition at the same time (ideally they will all be on the same port), or at least in the right order. But it won't be fast. From the slave side, you would need to rely on interrupts triggered from the clock pin, and you may not be able to respond to the interrupt in time (within the SPI clock cycle).
 
Old 08-20-2009, 12:50 AM   #3
sunr2007
Member
 
Registered: Jan 2009
Location: Bangalore , India
Distribution: Fedora 12
Posts: 65

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by neonsignal View Post
Are you asking if you can integrate this functionality into the kernel, or are you just wanting to write your own SPI interface using these general purpose I/O pins?

Running GPIO pins as an SPI interface is easier from the master side, because you control the clock rate. It is a matter of making sure all of the relevant pins transition at the same time (ideally they will all be on the same port), or at least in the right order. But it won't be fast. From the slave side, you would need to rely on interrupts triggered from the clock pin, and you may not be able to respond to the interrupt in time (within the SPI clock cycle).
I want to use this functionality from kernel. set up a module and transfer a data. there is a driver called /driver/spi/spi_bitbang.c
this driver helps to make use four gpio pins as spi pins. how to write a kernel module which helps me to use this particular driver?. and btw there is no SPI slave support in linux kernel. so i av to use spi masterr only. can anyone please guide me on this ?
warm regards,
Ravi Kulkarni.

Last edited by sunr2007; 08-20-2009 at 12:52 AM. Reason: added some more info
 
Old 08-20-2009, 01:23 AM   #4
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
Perhaps worth at looking how other people have made use of it, for example, this AT91 driver. Hope that is helpful.
 
  


Reply



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
can broken pins on a HD be repaired/replaced? newbiesforever General 7 02-12-2009 07:04 PM
ezUsb--I2Cio---linux how to test I/0 pins knockout_artist Linux - Kernel 0 09-07-2008 01:14 AM
ATX power supply 20 or 24 pins? paddyjoy Linux - Hardware 10 09-04-2006 06:44 AM
Tri-state pins kamransoomro84 General 2 07-23-2005 06:19 AM
howto monitor i386 serial-port pins? Mike Yates Linux - Hardware 0 06-29-2004 03:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 06:31 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration