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.

MSP432P401R: DriverLib code is opposite to TRM

Part Number: MSP432P401R


I look for the Technical Reference Manual about Comparator E Module,and the registers CExCTL1 says

CEIES = 0 is rsing edge and CEIES = 1 is falling edge,

but when it goes to the driverLib code of comp_e.c

1
2
3
4
5
6
7
8
9
10
11
void COMP_E_setInterruptEdgeDirection(uint32_t comparator,
        uint_fast8_t edgeDirection)
{
    ASSERT(edgeDirection <= COMP_E_RISINGEDGE);
    // Set the edge direction that will trigger an interrupt
    if (COMP_E_RISINGEDGE == edgeDirection)
        BITBAND_PERI(COMP_E_CMSIS(comparator)->CTL1, COMP_E_CTL1_IES_OFS) = 1;
    else if (COMP_E_FALLINGEDGE == edgeDirection)
        BITBAND_PERI(COMP_E_CMSIS(comparator)->CTL1, COMP_E_CTL1_IES_OFS) = 0;
}

the CEIES = 1 is rising edge and CEIES = 0 is falling edge?

Am i wrong or the code is wrong?

  • Tom,

    Let me look into this for you and get back to you within the next two days. I need to reach out to our systems team to confirm functionality.
  • Tom,

    I can confirm that this is a bug in the driverlib, the TRM reflects what the true operation should be for the silicon. I have filed a bug to have this fixed in driverlib. The best way to fix this is to swap out the values for COMP_E_RISINGEDGE and COMP_E_FALLINGEDGE so you do not have to patch the ROM driverlib and you should see a good fix.

**Attention** This is a public forum