4 Replies Latest reply on Jul 3, 2017 7:30 AM by rahb

    using die temperature sensor

    content.librarian

      Hi,

         

       

         

      i'm trying to use the die temperature sensor.

         

      It seems to working ok with a reference of 1.024v.

         

      But with a reference of 3.3volts the result is way off. I've converted the voltage as mentioned in the datasheet.

         

      If someone could have a look and tell me where i'm going wrong, id appreciate it.

         

      kind regards,

         

      Damian 

        • 1. Re: using die temperature sensor
          user_242978793

          Damian: when I loaded your program I found some errors and your printf was flagged with errors.  I added #include <stdio.h> as the printf requires it. After I fixed this I found that your answer was 61 that is not correct.  See this information.

             

          You also was not using the injection input as recommended in the die component data sheet. I am enclosing your program fixed for you to look at it reads 28 the correct reading.  Unzip this program in another directory so you don't overwrite your original program. 

             

          • 2. Re: using die temperature sensor
            user_242978793

            Also I changed the program you sent as I don't have your ble device I changed it to CY8C4247LQI-BL-483.

            • 3. Re: using die temperature sensor
              content.librarian

              Hi Bob,

                 

              thanks for you're response. And for looking at the code.

                 

              You have achieved the same results as i had. Interestingly i was also getting a value of 28!

                 

              The reason for me using the VDDA reference and not the internal 1.024v reference is that i have another project to add this code to, and unfortunately that project will have other analogue inputs which require the VDDA reference.

                 

              The formula to correct for the ADC reference change doesn't seem to work.

                 

              Also i will change to the injection channel, but i didn't think this would impact on the result as i'm not using the ADC in free running mode.

                 

              I'd appreciate any further thoughts.

                 

              Kind regards,

                 

              Damian

              • 4. Re: using die temperature sensor
                rahb

                Hello Damian,

                   

                Can you check the following things:

                   

                1. Please check if VDDA is exactly 3.3v. Since the VDDA is chosen as reference, if it is not exactly equal to 3.3v, this will cause the drift in the output. Please check the VDDA, and use external regulator to provide 3.3v if possible. 

                   

                2. Please use typecast to get the accurate result. For example, in the following comment:

                   

                tempVoltage = (3.3 / 1.024) * tempVoltage;

                   

                temp voltage is uint16, so the 3.3/1.024 with tempVoltage won't give accurate result. Please just follow the below comment as mentioned in the Die temp code example:

                   

                tempVoltage = (int16)(tempVoltage*((float)3300/1024));

                   

                Better to initialize tempVoltage with int16. 

                   

                3. Please test msgOut with char type casting. You have initialized uint8 msgOut[50], but please initialize with char msgOut[50];

                   

                4. Kindly use CyGlobalIntEnable in the main.c function. I could not find it in code. 

                   

                Let me know if the above modifications help the project to work.