Other Parts Discussed in Thread: BLE-STACK
Hi, everyone.
I'm working on how to add SPI interface in Simpleperipheral project. But in process I have many trouble.
I search some information and to see which one can ahcieve SPI.
But, from now on, none of one can achieve SPI or make compiler sucessfully.
I runs the project in:
BLE-stack 2.2v
TI-RTOS 2.18.0.03
And I use 2650DK_5XD chip with custom hardware. ( I had try some function, my custom hardware is correct)
So here are my question..
1. I follow the TI wiki file "CC2640 Adding a UART or SPI driver to s Sample project", on "adding TL file to existing project"..it says need to copy 5 required files in to porject folder, but I can't find "tl.c" and "tl.h" files in any folder, where are these files at?
2. In TI-RTOS Drivers, SPI.h file reference. I opening the driver in SimplePeripehral_init(), and make transfer function in an event that i create, but seems like the chip will stuck when the transfer function is in. ( This event will call when cycling period clock is interrupt ), why transfer function will stuck when the event is call?
3. Then I try to change the PIN config, and set like below
/* SPI Board */ #define Board_SPI0_MISO IOID_12 /* P1.20 */ #define Board_SPI0_MOSI IOID_11 /* P1.18 */ #define Board_SPI0_CLK IOID_10 /* P1.16 */ #define Board_SPI0_CSN IOID_15
/* SPI configuration structure, describing which pins are to be used */
const SPICC26XXDMA_HWAttrsV1 spiCC26XXDMAHWAttrs[CC2650DK_5XD_SPICOUNT] = {
{
.baseAddr = SSI0_BASE,
.intNum = INT_SSI0_COMB,
.intPriority = ~0,
.swiPriority = 0,
.powerMngrId = PowerCC26XX_PERIPH_SSI0,
.defaultTxBufValue = 0,
.rxChannelBitMask = 1<<UDMA_CHAN_SSI0_RX,
.txChannelBitMask = 1<<UDMA_CHAN_SSI0_TX,
.mosiPin = Board_SPI0_MOSI,
.misoPin = Board_SPI0_MISO,
.clkPin = Board_SPI0_CLK,
.csnPin = Board_SPI0_CSN
}
};
const PIN_Config BoardGpioInitTable[] = {
Board_DK_LED3 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
Board_DK_LED4 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
Board_KEY_SELECT | PIN_INPUT_EN | PIN_PULLUP | PIN_HYSTERESIS, /* Button is active low */
Board_KEY_UP | PIN_INPUT_EN | PIN_PULLUP | PIN_HYSTERESIS, /* Button is active low */
Board_KEY_DOWN | PIN_INPUT_EN | PIN_PULLUP | PIN_HYSTERESIS, /* Button is active low */
Board_KEY_LEFT | PIN_INPUT_EN | PIN_PULLUP | PIN_HYSTERESIS, /* Button is active low */
Board_KEY_RIGHT | PIN_INPUT_EN | PIN_PULLUP | PIN_HYSTERESIS, /* Button is active low */
Board_3V3_EN | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL, /* 3V3 domain off initially */
Board_UART_TX | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL, /* UART TX pin at inactive level */
Board_SPI0_CSN | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL,
PIN_TERMINATE /* Terminate list */
};
But when I debug program, the PIN can't initiate, why?
If I remove Board_SPI0_CSN config, the PIN initiate is correct.
4. Then I found a UDMACC26XX.h reference. it also have the same trouble like problem 2 and 3.
Is there some information that I have lost? Because I test all SPI PIN I can't see any wave on oscilloscope.
Or is there some example can provide for me?
I'm really confuse in this case..
Thanks a lot.