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.

[参考译文] MSP430F2619:无法从计时器触发DMA

Guru**** 2538955 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/583353/msp430f2619-cannot-trigger-dma-from-a-timer

部件号:MSP430F2619

我无法从计时器获得要触发的DMA块传输。 我可以通过软件(DMA_REQ)触发,但计时器触发器不起作用。 下面是我的代码,试图从计时器B CCR2触发DMA0:

// SMCLK为12 MHz

//------------------
// DMA设置
//------------------

DMACTL0 = DMA0Tsel_2;//通道0触发计时器B =(TBCCR2 CCIFG)

DMACTL1 = 0;

DMA0CTL = 0
+ DMADT_1 //阻止传输
+ DMASRCINCR_3 //源地址递增

//来源
__data20_write_long ((unsigned long)&DMAN0SA,wave_buffer_addr);

//目的地
__data20_write_long ((unsigned long)&DMA0DA,(unsigned long)&DAC12_0DAT);

//大小
DMA0SZ =波形缓冲器大小;

//------------------
//计时器B设置
//------------------
TBCTL = 0
+ TBSSEL_2 // SMCLK
+ ID_0 //除以1
+ MC_0 //停止模式:计时器停止(配置期间)

TBR = 0x0;//计数器寄存器初始化为0

TBCCTL0 = 0;

TBCCR0 = 1.2万 - 1;// 1.2万 / 12 MHz = 1 ms
TBCCR2 = 1.2万 - 1;// 1.2万 / 12 MHz = 1 ms

set_bit (TBCTL,MC_1);// up模式:计时器计数最高为TBCCR0

//------------------
//设置DMAEN不起作用
//------------------
set_bit (DMA0CTL,DMAEN);