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.

MSPM0G3507: LP-MSPM0G3507

Part Number: MSPM0G3507


Tool/software:

Hello!

I have a question regarding the DL_ADC12_SVT_OFFSET. I don’t quite understand why this offset value is needed. I did not find any information about this offset value in the reference manual or the data sheet.

Could you please explain the purpose of the DL_ADC12_SVT_OFFSET in this context?

/**
* @brief Returns the conversion result memory address.
*
* @param[in] adc12 Pointer to the register overlay for the peripheral
* @param[in] idx Memory conversion index. @ref DL_ADC12_MEM_IDX.
*
* @return Conversion result memory address
*
*/
__STATIC_INLINE uint32_t DL_ADC12_getMemResultAddress(
ADC12_Regs *adc12, DL_ADC12_MEM_IDX idx)
{
return ((uint32_t)(&adc12->ULLMEM.MEMRES[idx] + DL_ADC12_SVT_OFFSET));
}

Best regards,

Ali

  • Hi,

    According to MSPM0G3507 RTM manual, the actual address of MEMRES and MEMCTL in ADC is a standalone memory region and their base address is not 0x4000000 (for ADC0). So when we need to get the result in MEMRES, we need to access data stored in memory with base address 0x40556000. 

    To fetch a MEMRES[x] data in ADC0, its address will be calculated as (ADC0 base address)0x40000000 + (MEMRES offset address) 0x1180 + (DL_ADC12_SVT_OFFSET) 0x555000 + x*4  , and this will locate in the range of 0x40556000 ~ 0x40557000.

    Regards,

    Pnegfei

  • Hi Pnegfei,

    But why is DL_ADC12_SVT_OFFSET = 0x155400 ? Where came this value from?


    I still did not understand why 0x555000 is shifted by 2?

    Best Regards,

    Ali

  • Hi Ali,

    I took a test of this API. And the result matched the description before (Attention to correct the MEMRES offset address from 0x1180 to 0x1280 ).

    The data type of "&ADC12_0_INST->ULLMEM.MEMRES[0]" is "volatile const uint32_t *", which is a pointer type. And any addition and subtraction based on it correspond to 32-bit offset. As the address in memory is organized by 8-bit,   DL_ADC12_SVT_OFFSET need to be shifted by 2 to make the result address to be 0x555000 offset to base address.

    Regards,

    Pengfei

  • Hi Ali,

    Is there any other problem of this thread? If not, could you please help close this thread? thanks.

    Regards,

    Pengfei