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.

求cc2530八路ADC配合DMA序列转换的例程代码!不要叫我看说明书呀,协议栈API啊,看过了 都没有具体讲序列转换的

Other Parts Discussed in Thread: CC2530

求cc2530八路ADC配合DMA序列转换的例程代码!不要叫我看说明书呀,协议栈API啊,看过了 都没有具体讲序列转换的

  • void dma_channel_init ( DMA_DESC __xdata *dma_p,
    uint16 __xdata *dest_adr,
    uint8 lenl,
    uint8 trig )
    {
    // Setup DMA confiuration
    dma_p->SRCADDRH = (uint16)(&X_ADCL) >> 8;
    dma_p->SRCADDRL = (uint16)(&X_ADCL);
    dma_p->DESTADDRH = ((uint16)dest_adr) >> 8;
    dma_p->DESTADDRL = ((uint16)dest_adr);
    dma_p->VLEN = DMA_VLEN_FIXED;
    dma_p->LENH = 0;
    dma_p->LENL = lenl; // Tranfer Count
    dma_p->WORDSIZE = DMA_WORDSIZE_BYTE;
    dma_p->TMODE = DMA_TMODE_BLOCK;
    dma_p->TRIG = trig; // Channel trigger
    dma_p->SRCINC = DMA_SRCINC_1;
    dma_p->DESTINC = DMA_DESTINC_1;
    dma_p->IRQMASK = DMA_IRQMASK_DISABLE;
    dma_p->M8 = DMA_M8_USE_7_BITS;
    dma_p->PRIORITY = DMA_PRI_HIGH;
    }
    例程里面这里是不是有问题
    dma_p->SRCADDRH = (uint16)(&X_ADCL) >> 8;
    dma_p->SRCADDRL = (uint16)(&X_ADCL);
    改成
    dma_p->SRCADDRH = (uint16)(&X_ADCH) >> 8;
    dma_p->SRCADDRL = (uint16)(&X_ADCL);
    是吗?