Other Parts Discussed in Thread: MSP430F5659, DAC8750, ADS1292
Hi
I am working on ADS1292 and DAC8750 using SPI communication with MSP430F5659 controller.
Its working with normal write/read SPI routine. Since i am using TI RTOS i tried to use the TI RTOS API for the same.
Here i have a question how to set the DMA interrupt for both SPI, since ADS1292 i am using USCI B0 and for DAC8750 i am using USCI A1?
Or is it possible to use SPI without DMA for TI RTOS based application?
Can i get any reference code with or without DMA for TI RTOS?
i did the SPI attribute and H/w attribute as shown below is it correct?
/* Place into subsections to allow the TI linker to remove items properly */
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_SECTION(SPI_config, ".const:SPI_config")
#pragma DATA_SECTION(spiUSCIBDMAHWAttrs, ".const:spiUSCIBDMAHWAttrs")
#pragma DATA_SECTION(spiUSCIADMAHWAttrs, ".const:spiUSCIADMAHWAttrs")
#endif
#include <ti/drivers/SPI.h>
#include <ti/drivers/spi/SPIUSCIBDMA.h>
#include <ti/drivers/spi/SPIUSCIADMA.h>
SPIUSCIBDMA_Object spiUSCIBDMAObjects[MSP_EXP430F5529LP_SPICOUNT];
uint8_t spiUSCIBDMAscratchBuf[MSP_EXP430F5529LP_SPICOUNT];
SPIUSCIBDMA_Object spiUSCIADMAObjects[MSP_EXP430F5529LP_SPICOUNT];
uint8_t spiUSCIADMAscratchBuf[MSP_EXP430F5529LP_SPICOUNT];
const SPIUSCIBDMA_HWAttrs spiUSCIBDMAHWAttrs[0] = {
{
.baseAddr = USCI_B0_BASE,
.clockSource = USCI_B_SPI_CLOCKSOURCE_SMCLK,
.bitOrder = USCI_B_SPI_MSB_FIRST,
.scratchBufPtr = &spiUSCIBDMAscratchBuf[0],
.defaultTxBufValue = 0,
/* DMA */
.dmaBaseAddr = DMA_BASE,
/* Rx Channel */
.rxDMAChannelIndex = DMA_CHANNEL_1,
.rxDMASourceTrigger = DMA_TRIGGERSOURCE_18,
/* Tx Channel */
.txDMAChannelIndex = DMA_CHANNEL_0,
.txDMASourceTrigger = DMA_TRIGGERSOURCE_19
}
};
const SPIUSCIADMA_HWAttrs spiUSCIADMAHWAttrs[1] = {
{
.baseAddr = USCI_A1_BASE,
.clockSource = USCI_A_SPI_CLOCKSOURCE_SMCLK,
.bitOrder = USCI_A_SPI_MSB_FIRST,
.scratchBufPtr = &spiUSCIADMAscratchBuf[0],
.defaultTxBufValue = 0,
/* DMA */
.dmaBaseAddr = DMA_BASE,
/* Rx Channel */
.rxDMAChannelIndex = DMA_CHANNEL_1,
.rxDMASourceTrigger = DMA_TRIGGERSOURCE_20,
/* Tx Channel */
.txDMAChannelIndex = DMA_CHANNEL_0,
.txDMASourceTrigger = DMA_TRIGGERSOURCE_21
}
};
const SPI_Config SPI_config[] = {
{
.fxnTablePtr = &SPIUSCIBDMA_fxnTable,
.object = &spiUSCIBDMAObjects[0],
.hwAttrs = &spiUSCIBDMAHWAttrs[0]
},
{
.fxnTablePtr = &SPIUSCIADMA_fxnTable,
.object = &spiUSCIADMAObjects[1],
.hwAttrs = &spiUSCIADMAHWAttrs[1]
},
{NULL,NULL,NULL},
};
I don't know how to set the DMA channel for for SPI B0 and SPI A1,
Please can any one help me to resolve this issue.
Nitesh