8 thoughts on “(English) SHT75 Humidity and Temperature Sensor with PIC18F uC

  1. Please I am trying to adap this code to pic18F14K50 but I am having problem compiling the code. I have my SHT75 data pin on pin RC1 and SCK on Pin RC0 I am using 1 12MHz Cristal oscilator connected to pin RA4 and RA5 and my serial connection to PIN RA0 and RA1. I am using Hi-Tech Microchip MPLAB XC8 compiler Please can you help me. Because I have been troubleshouting the error since but it just not working

    1. Since I don’t have access to any development tool, I cannot help much. But some steps in porting.

      1. Start with skeleton code which just output something as the SHT75 code. Make sure your primary output method (serial terminal/LCD/SSD) works.

      2. Don’t use any delay/serial/clock related routines attached above. Use the routines provided by compiler.

      3. Make sure the pins used in SHT75 codes are set to digital-IO (not assigned to any peripheral). Two LEDs/switches connected to pins can be used to verify this.

      4. Make sure you use the pull-up resistor in SHT75 data-pin.

      5. Now insert the ported SHT75 code to your project with as many as debug codes required (you should identify where the code fail). When compiling turn-off compiler optimization first. May be it’s messing with bit-bang routines in the code. (s_read_byte, s_write_byte)

      6.If you have an oscilloscope you can see the actual timing for communication and would help you very much in debugging.

ප්‍රතිචාරයක් ලබාදෙන්න

ඔබගේ ඊමේල් ලිපිනය ප්‍රසිද්ධ කරන්නේ නැත.

This site uses Akismet to reduce spam. Learn how your comment data is processed.



අගෝස්තු 2011
බ්‍ර සි සෙ

නවතම ලිපි