Help a newbie connect the PSOC 5 dev kit to a digital temperature sensor!

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hello, I'm working with a LMT01LPG temperature sensor from Texas Instruments and am trying to interface with the PSOC 5 kit. The LMT01 outputs a square wave every 54 ms that lasts for up to 50 ms (duration of the communication not size of the wave). The number of pulses during this 50 ms corresponds to the temperature.

   

I've been trying to figure out how to count the number of pulses properly. Currently I am taking in the input on a standard GPIO with a resistor to bias it per the datasheet's instructions. I have a comparator running with a VDAC as a reference voltage to ensure a good signal. Currently I've been trying to count using a Counter block. The second Counter I have is to theoretically act as what causes a capture of the signal at the end of 50 ms (i don't think this is right). Anyway, none of this works and I get a 0 outputted to my display.

   

I feel like I'm doing this very wrong. Should I be counting the data entirely on the software side and avoid blocks? I think I'm probably making a number of stupid mistakes. Please point them out and help please!

   

Attached is a picture of the top design. I can attach the code, but its essentially just read the counter, and display it to my seven segment display. 

   

Thanks,

   

-Jordan

0 Likes
1 Reply
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

OK, so the procedure of reading the LMT01 is:

   
        
  • use a resistor to convert the changing current of the sensor to a voltage you can measure
  •     
  • use a comparator to generate
  •     
  • apply power to the LMT01
  •     
  • wait for the first rising flank and start counting
  •     
  • after the first rising flank, count fort at most 50ms
  •     
  • after the 50ms are over, stop counting and power off the sensor
  •    
   

So, first I think you should route the output of your comparator to a pin an connect a scope there (together with looking at the LMT01 current consumption). Make sure the comparator delivers a usable result.

   

Since the pulse frequency is up to 94kHz, your comparator needs to be clocked at least twice that, preferrably much more than that (I would suggest using a 1MHz clock or faster). Same for the counter.

   

The counter for your pulse is wired fine. For measuring the 50ms I would use a second counter, which gets configured to start counting on a rising flank. It should have its TC count so that TC is reached after 50ms, and you use this to capture the pulse counter result, and trigger an interrupt to read the results.

0 Likes