UCA0–UART DMA发送无法触发,DMA接收可以。
配置如下。不理解什么原因?
目前SPI用了通道0-1,正常 通道2用了UART接收。通道3配置如下,无法触发发送,只能使用UART_WRITE,或者UART_WRITEPOLLING。
{
DMA_initParam param = {0};
param.channelSelect = DMA_CHANNEL_3;
param.transferModeSelect = DMA_TRANSFER_SINGLE;
param.transferSize = len;
param.triggerSourceSelect = DMA_TRIGGERSOURCE_17;
param.transferUnitSelect = DMA_SIZE_SRCBYTE_DSTBYTE;
param.triggerTypeSelect = DMA_TRIGGER_HIGH;
DMA_init(¶m);
/*
* Configure DMA channel 0
* Use ADC10_A Memory Buffer as source
* Increment destination address after every transfer
*/
DMA_setSrcAddress(DMA_CHANNEL_3,
(uint32_t)buf,
DMA_DIRECTION_INCREMENT);
/*
* Base Address for the DMA Module
* Configure DMA channel 0
* Use ADC_Result[0] as destination
* Increment destination address after every transfer
*/
DMA_setDstAddress(DMA_CHANNEL_3,
USCI_A_UART_getTransmitBufferAddressForDMA (USCI_A0_BASE),
DMA_DIRECTION_UNCHANGED);
//Enable DMA channel 0 interrupt
//DMA_disableTransfers(DMA_CHANNEL_3);
//DMA_clearInterrupt(DMA_CHANNEL_3);
DMA_enableInterrupt(DMA_CHANNEL_3);
//Enable transfers on DMA channel 0
DMA_enableTransfers(DMA_CHANNEL_3);
DMA_startTransfer(DMA_CHANNEL_3);
}
li dong:
这玩意,没人知道么??我看TI参考设计也没有, SPI DMA的有,使用验证可以
Lina Lian:
回复 li dong:
li dong,
我看了MSP430F5529 code example, 一般你安装了CCS,MSPWare中就有,其对应的下列例程 “MSP430F55xx_dma_02.c”就是使用DMA-UART进行数据发送的。你可以参考一下。
MSP430F55xx_dma_01.c DMA0, Repeated Block to-from RAM, Software TriggerMSP430F55xx_dma_02.c DMA0, Repeated Block UCA1UART 9600, TACCR2, ACLKMSP430F55xx_dma_03.c SPI TX & RX using DMA0 & DMA1 Single Transfer in Fixed Address ModeMSP430F55xx_dma_04.c DMA0, Single transfer using ADC12 triggered by TimerB