temperature_monitor example

cancel
Showing results for 
Search instead for 
Did you mean: 

temperature_monitor example

Jump to solution
560 Views
andydong1
Contributor I

Hi,

I use imxrt1052 evkboard (SDK version 2.5.0)

I test the temperaturemonitor example but it's a little bit strange.

1. when the temperature is higher than DEMO_HIGHALARMTEMP(42U) 

    DEMO_TEMP_LOW_HIGH_IRQHandler() is triggered and then it will decrease the core frequency

2. when the temperature is lower than DEMO_LOWALARMTEMP(40U)

    DEMO_TEMP_LOW_HIGH_IRQHandler() is triggered and then it will change the core frequency to original.

I run the example. I use hairdryer to increase the temperature.

1. happened when the temperature is higher than 42. 

and then 2. didn't happened when the temperature is lower than 40.

Is there any suggestions ?

Thanks.

Best Regards,

Andy Dong

Labels (1)
0 Kudos
1 Solution
462 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi Andy,

It seems the TEMPMON driver has a bug. Please modify the function TEMPMON_SetTempAlarm() as below:

   

    switch (alarmMode)
    {
        case kTEMPMON_HighAlarmMode:
            /* Set high alarm temperature code value */
            base->TEMPSENSE0 &= 0xfffff;    //clear first
            base->TEMPSENSE0 |= TEMPMON_TEMPSENSE0_ALARM_VALUE(tempCodeVal);
            break;

        case kTEMPMON_PanicAlarmMode:
            /* Set panic alarm temperature code value */

            base->TEMPSENSE2 &= 0xffff;
            base->TEMPSENSE2 |= TEMPMON_TEMPSENSE2_PANIC_ALARM_VALUE(tempCodeVal);
            break;

        case kTEMPMON_LowAlarmMode:

            /* Set low alarm temperature code value */

            base->TEMPSENSE2 &= 0xffff0000;

            base->TEMPSENSE2 |= TEMPMON_TEMPSENSE2_LOW_ALARM_VALUE(tempCodeVal);

            break;

        default:
            assert(false);
            break;
    }

Regards,

Jing

View solution in original post

0 Kudos
2 Replies
463 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi Andy,

It seems the TEMPMON driver has a bug. Please modify the function TEMPMON_SetTempAlarm() as below:

   

    switch (alarmMode)
    {
        case kTEMPMON_HighAlarmMode:
            /* Set high alarm temperature code value */
            base->TEMPSENSE0 &= 0xfffff;    //clear first
            base->TEMPSENSE0 |= TEMPMON_TEMPSENSE0_ALARM_VALUE(tempCodeVal);
            break;

        case kTEMPMON_PanicAlarmMode:
            /* Set panic alarm temperature code value */

            base->TEMPSENSE2 &= 0xffff;
            base->TEMPSENSE2 |= TEMPMON_TEMPSENSE2_PANIC_ALARM_VALUE(tempCodeVal);
            break;

        case kTEMPMON_LowAlarmMode:

            /* Set low alarm temperature code value */

            base->TEMPSENSE2 &= 0xffff0000;

            base->TEMPSENSE2 |= TEMPMON_TEMPSENSE2_LOW_ALARM_VALUE(tempCodeVal);

            break;

        default:
            assert(false);
            break;
    }

Regards,

Jing

0 Kudos
462 Views
andydong1
Contributor I

Hi Jing,

Thank you so much. It works.

Best Regards,

Andy Dong

0 Kudos