| Welcome to AT91SAM Community Forum http://www.at91.com/samphpbb/ |
|
| Need help SPI full-duplex operation http://www.at91.com/samphpbb/viewtopic.php?f=12&t=18886 |
Page 1 of 1 |
| Author: | meihou [ Fri Jan 15, 2010 8:03 pm ] |
| Post subject: | Need help SPI full-duplex operation |
Hi everybody, I plan to interface AT91SAM9260ek with MFRC531 RFID controller chip. My problem is: The host SPI port should operate as full-duplex mode, but I couldn't find any doccument about using SPI full-duplex mode in the Linux's kernel space. How to perform "write a byte and read a byte concurrently" operation with SPI port ? Thank for helping. |
|
| Author: | meihou [ Tue Jan 26, 2010 12:09 pm ] |
| Post subject: | Re: Need help SPI full-duplex operation |
no reply, Temporarily, I'm using "bitbanging" method, and my driver works fine. Code: static u8 spi_byte_transceive (u8 sendbyte) { u8 i, temp = 0; for(i=0; i<8; i++) { CLK_LOW; if(sendbyte & 0x80) MOSI_HIGH; else MOSI_LOW; sendbyte <<= 1; CLK_HIGH; temp <<= 1; if (GET_MISO) temp |= 0x01; } CLK_LOW; MOSI_LOW; return (temp); } But, I'm wasting GPIOs for SPI purpose |
|
| Author: | theawddone [ Sat Mar 06, 2010 9:37 am ] |
| Post subject: | Re: Need help SPI full-duplex operation |
meihou wrote: Hi everybody, I plan to interface AT91SAM9260ek with MFRC531 RFID controller chip. My problem is: The host SPI port should operate as full-duplex mode, but I couldn't find any doccument about using SPI full-duplex mode in the Linux's kernel space. How to perform "write a byte and read a byte concurrently" operation with SPI port ? Thank for helping. Is it acceptable to use it in user space instead? Since you mentioned specifically kernel space, I am guessing you have already seen the full duplex documentation, but figured I would mention it anyway, since I have been able to use it successfully... I just took a quick look at the atmel_spi.c driver file and did not see a system call for full duplex, but I don't know how spidev would be able to do full duplex but not a kernel space module/driver... http://git.kernel.org/?p=linux/kernel/g ... 35;hb=HEAD |
|
| Author: | meihou [ Mon Mar 15, 2010 8:06 am ] |
| Post subject: | Re: Need help SPI full-duplex operation |
Thanks for your suggestion, But I think we can't use the spidev because of the timming problem, user space is really slow for controlling the MFRC531 chip (such as interrupt proccessing for each command...) Does the AT91SAM9260 not support SPI with full duplex operation mode ? |
|
| Page 1 of 1 | All times are UTC + 1 hour [ DST ] |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|



Forum