尊敬的TI技术支持:
我们在编写TMS320C5505的时候遇到些问题,问题详见附件,谢谢您的回复~
Terry Huang
qhbhhq@163.com
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.
尊敬的TI技术支持:
我们在编写TMS320C5505的时候遇到些问题,问题详见附件,谢谢您的回复~
Terry Huang
qhbhhq@163.com
你好,我也遇到了类似的问题,PCGCR中,只有SYSCLKDIS、TMR0CG、UARTCG这几个位active。其它的都disable。然后复位之后,再打开SPICG。
我的问题是:External Bus Selection Register (EBSR)设置PPMODE为
1、4 signals of the SPI module有时钟信号且只有cs0有片选信号。
2、7 signals of the SPI module无时钟信号,但cs0-3有片选信号。
请问:1、这个问题该怎么解决,如何使7 signals of the SPI module下既有时钟信号又有片选信号?
2、cs0-3是如何实现slave device的选择,其具体控制逻辑是什么?
万分期待您的解答,先谢谢各位!!!
001 Mode 1 (SPI, GPIO, UART, and I2S2). 7 signals of the SPI module, 6 GPIO signals, 4 signals ofthe UART module and 4 signals of the I2S2 module are routed to the 21 external signals of theparallel port.
你好,
我现在用的 C5505 SPI 也出现问题了,clock 没信号,请问您当时怎么解决的。谢谢
#include <stdio.h>
#include <csl_spi.h>
#include <cslr_spi.h>
#include <csl_sysctrl.h>
#include <csl_general.h>
#include <spirom.h>
#define CSL_TEST_FAILED (1)
#define CSL_TEST_PASSED (0)
#define CSL_SPI_BUF_LEN (64)
#define SPI_CLK_DIV (100)
#define SPI_FRAME_LENGTH (1)
Uint16 spiWriteBuff[CSL_SPI_BUF_LEN];
Uint16 spiReadBuff[CSL_SPI_BUF_LEN];
Uint16 byteBuf[1];
Uint16 cmdBuffer[3] = {0, 0, 0};
long delay_i;
extern void spirom_write( Uint32 src, Uint16 dst, Uint32 length );
CSL_SpiHandle hSpi;
Int16 spi_sample(void)
{
Int16 status = CSL_TEST_FAILED;
Int16 result;
SPI_Config hwConfig;
Uint16 looper;
/*Uint16 value = 0;
Uint16 pageNo = 0x0000;
Uint16 pollStatus;
Uint16 delay;
Uint16 fnCnt;*/
result = SPI_init();
if(CSL_SOK != result)
{
status = CSL_TEST_FAILED;
return (status);
}
else
{
printf ("SPI Instance Intialize successfully\n");
}
hSpi = SPI_open(SPI_CS_NUM_1, SPI_POLLING_MODE);
if(NULL == hSpi)
{
return (CSL_TEST_FAILED);
}
else
{
printf ("SPI Instance Opened successfully\n");
}
/** Set the hardware configuration */
hwConfig.spiClkDiv = SPI_CLK_DIV;
hwConfig.wLen = SPI_WORD_LENGTH_8;
hwConfig.frLen = SPI_FRAME_LENGTH;
hwConfig.wcEnable = SPI_WORD_IRQ_ENABLE;
hwConfig.fcEnable = SPI_FRAME_IRQ_DISABLE;
hwConfig.csNum = SPI_CS_NUM_1;
hwConfig.dataDelay = SPI_DATA_DLY_1;
hwConfig.csPol = SPI_CSP_ACTIVE_LOW;
hwConfig.clkPol = SPI_CLKP_LOW_AT_IDLE;
hwConfig.clkPh = SPI_CLK_PH_FALL_EDGE;
result = SPI_config(hSpi, &hwConfig);
if(CSL_SOK != result)
{
return (CSL_TEST_FAILED);
}
else
{
printf ("SPI Instance Configured successfully\n");
}
byteBuf[0] = 0xABCD;
for(looper = 0; looper < 64; )
{
spiWriteBuff[looper] = 0x0011;
spiWriteBuff[(looper + 1)] = 0x00AB;
spiReadBuff[looper] = 0x0000;
spiReadBuff[(looper + 1)] = 0x00CD;
looper += 2;
}
return (status);
}
void main(void)
{
Int16 status;
pll_sample(); //时钟初始化
status = spi_sample();
//spirom_init();
while(1)
{
delay_i = 5000000;
while(delay_i--);
SPI_dataTransaction(hSpi ,spiWriteBuff, CSL_SPI_BUF_LEN, SPI_WRITE);
}
}