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.

TMS320F28388D: DMA_Registers_READ

Part Number: TMS320F28388D

Dear sir,

I met a problem when I was testing the example projects "adc_ex6_soc_continuous_dma".

The technical reference manual says the parameter in the register TRANSFER_COUNT will be 0 when the dma channel fishes the transfer, and I insert one line code in the dmach1ISR just as below,

but the variable reads as 63,not 0, and I read this register in the memory browser, it is read as 0.

I am confused how this happen? what is the problem?

look forward to your reply.

  • Wang,

    TRANSFER_COUNT register is 16 bit register. You are using HWREG macro  which is used to references a unsigned 32 bit integer as shown below. You should instead use HWREGH macro to reference to 16 bit unsigned integer. Once you do that you should get the correct TRANSFER_COUNT value.

    //Defined in hw_types.h

    #define HWREG(x)                                                              \
            (*((volatile uint32_t *)((uintptr_t)(x))))

    HWREGH macro references a unsigned 16 bit integer as shown below.

    //Defined in hw_types.h

    #define HWREGH(x)                                                             \
            (*((volatile uint16_t *)((uintptr_t)(x))))

    Regards,

    Manoj