最近在做spi驱动开发,目前按照StarterWare中对spi模块配置之后,没有时钟输出。请问这可能是什么原因?
Ps:我使用的是am3354,配置为Master,Single Channel,使用的是SPI1,使用普通的GPIO作为片选引脚;
还有个疑问就是SPI1模块使用channel0是可以的吧?
谢谢各位!
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
仿真查看相关时钟源的寄存器,可以检查 MCSPI_SYSCONFIG 的 位 CLOCKACTIVITY,还有跟SPI相关的时钟域是否都开启了
PD_PER_L4LS_GCLK (Interface/OCP) PD_PER_SPI_GCLK (Func) |
恩 没有时钟 SPICLK 的这个问题解决了。是因为CS引脚,之前使用的是GPIO,不知道为什么会有问题。
现在换成了SPI1 的 CS0引脚。
但是现在的问题是可以读到数据,只是 SPI 读取到的数据错位了(每次数据中1的个数是相同的,并且和0的组合方式也是相同的),具体如下:
'0b10110000000000010010000000000000'
'0b01011000000000001001000000000000'
'0b00000000000100100000000010110000'
'0b00000000010010000000000000101100'
这是为什么?
Ps: 时钟极性和相位和从设备设置的是相同的。
你再仔细检查下SPI驱动配置这部分吧,spi0 是按照SPI FLASH配置的时序,估计还是工作模式配置的有点问题。
你好,请问
linux-3.2.0-psp04.06.00.08.sdk
中用该如何配置spi1,使用spi1的总线呢?
求交流
q1833630366
参考】
http://processors.wiki.ti.com/index.php/AM335x_PSP_User%27s_Guide
你好,我的现在默认是这个脚:MCASP0_ACLKX
怎么配置成SPI1_SCLK这个功能呢?
是在mux33xx.c里面么?
在这个文件Board-am335xevm.c ,里面有很多引脚的定义,比如uart
* pinmux for profibus */
static struct pinmux_config profibus_pin_mux[] = {
{"uart1_rxd.pr1_uart0_rxd_mux1", OMAP_MUX_MODE5 | AM33XX_PIN_INPUT},
{"uart1_txd.pr1_uart0_txd_mux1", OMAP_MUX_MODE5 | AM33XX_PIN_OUTPUT},
{"mcasp0_fsr.pr1_pru0_pru_r30_5", OMAP_MUX_MODE5 | AM33XX_PIN_OUTPUT},
{NULL, 0},
};
am3352 的结出来的两个spi,spi0 spi1,做成驱动设备后,用收发短接,自测都成功了。但是还是有疑惑,因为我看到驱动中有个mcspi,不知道这个驱动和我的这两个spi有什么差别呢?
是在源文件
spi-omap2-mcspi.c中
还有我用的是spi.c和spidev.c
不知道这个mcspi跟我用的spi有什么差别?
因为我在编内核的时候
--- SPI support │ │
│ │ [*] Debug support for SPI drivers │ │
│ │ *** SPI Master Controller Drivers *** │ │
│ │ < > Altera SPI Controller │ │
│ │ < > Utilities for Bitbanging SPI masters │ │
│ │ < > GPIO-based bitbanging SPI Master │ │
│ │ < > OpenCores tiny SPI │ │
│ │ <*> McSPI driver for OMAP │ │
│ │ < > Xilinx SPI controller common module │ │
│ │ < > DesignWare SPI controller core support │ │
│ │ *** SPI Protocol Masters *** │ │
│ │ <*> User mode SPI device driver support │ │
│ │ < > Infineon TLE62X0 (for power switching)
看到有个 McSPI driver for OMAP
spi 我们TI内部把它叫做Mcspi,没什么区别的,要在我们的芯片使能spi,就需要<M>或者 <*> McSPI driver for OMAP,参考:
http://processors.wiki.ti.com/index.php/AM335x_McSPI_Driver%27s_Guide