#include <msp430x16x.h>
const unsigned char testconst[] = { 0x00, 0x03, 0x02, 0x03, 0x00, 0x01 };
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog
P1DIR |= 0x03; // P1.0/1.1 output
DMACTL0 = DMA0TSEL_1; // CCR2IFG trigger
DMA0SA = (unsigned int)testconst; // Source block address
DMA0DA = P1OUT_; // Dest single address
DMA0SZ = sizeof testconst; // Block size
DMA0CTL = DMADT_4 + DMASRCINCR_3 + DMASBDB + DMAEN; // Rpt, inc src, enable
TACTL = TASSEL_2 + MC_2; // SMCLK, cont-mode
_BIS_SR(LPM0_bits); // Enter LPM0
}
帮忙看一下 程序怎么在连续计数下使TA0CCR2IFG置位然后触发DMA的?
此帖出自
小平头技术问答
我也是今天才发现,个性签名也改了。以后恢复就用“请看我的签名”
一周热门 更多>