mcbsp配置成SPI 时我把 字宽度设置为8bIt 一帧中包含2个字,如图片上信息, ss(FSX)应该是信号1 所示,但是我抓出来的波形是信号2。
我函数操作是
spi_transmit_data(0x60);
spi_transmit_data(0xfe);
也就是说发了两下,但是我配置的帧长度是2, 那发出去的ss信号不应该连续的低两个8bit吗?怎么中间高了一下
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.
mcbsp配置成SPI 时我把 字宽度设置为8bIt 一帧中包含2个字,如图片上信息, ss(FSX)应该是信号1 所示,但是我抓出来的波形是信号2。
我函数操作是
spi_transmit_data(0x60);
spi_transmit_data(0xfe);
也就是说发了两下,但是我配置的帧长度是2, 那发出去的ss信号不应该连续的低两个8bit吗?怎么中间高了一下
可是上面的图是根据SPI flash/EEPROM画出来的,不是测出来的。而且实际上SPI flash不要求CS一定要连续。
而McBSP是不能产生这种连接的CS的。
Figure 51 is the timing diagram when CLKSTP = 11b. Data transfer begins before the transition of the
serial clock. Therefore, the transition of the slave enable signal FSX/SS from high to low, instead of the
transition of the serial clock, marks the beginning of transfer in this SPI transfer format. In SPI master
mode, as well as SPI slave mode, the McBSP requires an FSX/SS edge for each transfer. This means the
FSX/SS signal must toggle for each word. The McBSP clock stop mode requires single-phase frames
((R/X)PHASE = 0) and one element per frame ((R/X)FRLEN = 0).
I2C也是1/6 CPU clock, 和mcbsp都是用SYSCLK3。见数据手册第133页的PLL说明。
SYSCLK3 clocks the PCI, HPI, UTOPIA, McBSP, GPIO, TIMER, and I2C peripherals, as well as the
configuration bus of the PLL2 Controller.
http://www.ti.com/lit/ds/symlink/tms320c6455.pdf
CLKX0 但是我量出来的时钟确实是1MHZ左右。下面是我的初始化代码
我特意在主函数里读了一下CPU倍频值, PLL1_PLLM 值为0x13 (20x)
#define PLL1_PLLM ( *(int*)(0x029A0110))
SPCR0 = SPCR0 & 0xFFFEFFFE;
c = SPCR0;
a = RCR0;
PCR0 = 0x00000b0e; //0x00000b0c; //CLKXP =1
SRGR0= 0x2000001a; // f=CPUCLK/166; a6
RCR0 = 0x00010080; //RDATDLY=1 //24 bit
XCR0 = 0x00010080; //XDATDLY=1
SPCR0 = (SPCR0 | 0x00001000) & 0xFFFFF7FF; //CLKSTP BIT12=1,BIT11=0 CLKSTP=10
for(i=0;i<2048;i++);
SPCR0 = SPCR0 | 0x400000;
for(i=0;i<2048;i++);
SPCR0 = SPCR0 | 0x10001;
/*
#define DRR0 ( *(int*)(0x028C0000))//McBSP0 Data Receive Register via Configuration Bus
#define DXR0 ( *(int*)(0x028C0004))//McBSP0 Data Transmit Register via Configuration Bus
#define SPCR0 ( *(int*)(0x028C0008))//McBSP0 Serial Port Control Register
#define RCR0 ( *(int*)(0x028C000C))//McBSP0 Receive Control Register
#define XCR0 ( *(int*)(0x028C0010))//McBSP0 Transmit Control Register
#define SRGR0 ( *(int*)(0x028C0014))//McBSP0 Sample Rate Generator register
#define MCR0 ( *(int*)(0x028C0018))//McBSP0 Multichannel Control Register
#define RCERE00 ( *(int*)(0x028C001C))//McBSP0 Enhanced Receive Channel Enable
#define XCERE00 ( *(int*)(0x028C0020))//McBSP0 Enhanced Transmit Channel Enable
#define RCERE10 ( *(int*)(0x028C0028))//McBSP0 Enhanced Receive Channel Enable
#define XCERE10 ( *(int*)(0x028C002C))//McBSP0 Enhanced Transmit Channel Enable
#define RCERE20 ( *(int*)(0x028C0030))//McBSP0 Enhanced Receive Channel Enable
#define XCERE20 ( *(int*)(0x028C0034))//McBSP0 Enhanced Transmit Channel Enable
#define RCERE30 ( *(int*)(0x028C0038))//McBSP0 Enhanced Receive Channel Enable
#define XCERE30 ( *(int*)(0x028C003C))//McBSP0 Enhanced Transmit Channel Enable
#define PCR0 ( *(int*)(0x028C0024))//McBSP0 Pin Control Register