2011-04-27 02:51:02     bf518 SPI chip_select

Document created by Aaronwu Employee on Aug 26, 2013
Version 1Show Document
  • View in full screen mode

2011-04-27 02:51:02     bf518 SPI chip_select

Bingo Cui (CHINA)

Message: 100185   

 

hi,Aaron Wu

 

 

我在驱动SPI设备时,片选信号选择有些迷茫

我的开发板是bf518

当我尝试修改linux-2.6.x/arch/blackfin/mach-bf518/boards/ezbrd.c中的

#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)

{

  .modalias = "spidev",

  .max_speed_hz = 3125000,     /* max spi clock (SCK) speed in HZ */

  .bus_num = 1,

  .chip_select = 1,

  .controller_data = &spidev_chip_info,

},

#endif

将chip_select = 1时,SPISEL1是片选信号脚;

将chip_select = 3时,SPISEL2是片选信号脚;

 

它们是什么样的逻辑关系呢?我希望SPISS做片选信号脚,那么chip_select应该赋值几呢?

TranslateQuoteReplyEditDelete

 

 

2011-04-27 03:12:18     Re: bf518 SPI chip_select

Aaron Wu (CHINA)

Message: 100186   

 

chip_select indicates which hardware chipselect PIN you are using for your SPI device. We have 7 hardware chipselect PINs for each of the SPI controller in BF518, there are two SPI controller on the BF518 in total. bus_num indicates which SPI controller you are using, range from 0 to 1, representing Controller 0 and Controller 1.  For which bus_num and chip_select value to use in your case you need to check your board schematic, please take our default ezbrd schematic and ezbrd.c for reference, if your schematic changes, then change your code accordingly.  

QuoteReplyEditDelete

 

 

2011-04-27 03:17:51     Re: bf518 SPI chip_select

Aaron Wu (CHINA)

Message: 100190   

 

By the way, SPISS PIN can not be used as the SPI chipselect if BF518 is going to act like master (actually in your product it is). SPISS is an input, acts as the active low enablement signal for the BF518 to act as SPI slave.

QuoteReplyEditDelete

 

 

2011-04-27 03:27:21     Re: bf518 SPI chip_select

Bingo Cui (CHINA)

Message: 100195   

 

thanks a lot for your help.

Attachments

    Outcomes