can i use I/o Port pins of a processor as four SPI pins? i
Linux - Embedded & Single-board computerThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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).
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.