Page 1 of 2

Thermometer PIC code

Posted: Wed Apr 17, 2013 2:57 pm
by Tony
For anyone who wants to try tinkering with it, here is the ASM file for the PIC. Usual rules apply - you can do what you want with it as long as it's non-commercial.

Most of the code is safe to play with but don't modify the PWM settings unless you're measuring the current taken by the inverter and are prepared to switch off quick/replace the MOSFET.
As there was plenty of memory available it only uses loops where required, with much of it being linear and I hope easier to follow. Some of the comments will be out of date as things were tweaked later, or pasted from other sections and not modified. An example is the temperature smoothing, the comment still refers to *32 but one bit operation has been remmed out so it currently uses *16 as it settled faster and had little impact on the result.
.
.
.

Re: Thermometer PIC code

Posted: Sat Apr 20, 2013 8:45 pm
by alex
Thanks for uploading the code!

I guess I will have to learn more about assembly language ( I'm more familiar with C).

What compiler are you using with this code?

Re: Thermometer PIC code

Posted: Sat Apr 20, 2013 9:32 pm
by Tony
Just the standard MPLAB IDE software with a PICKIT3.

Re: Thermometer PIC code

Posted: Wed Nov 05, 2014 2:12 am
by Tony
The code posted above is intended for a PIC16F1847 as originally used, the current kits use an 1827 and I've attached the latest version of the code for use with these. The only difference is the loaction of the saved display state has been fixed.

Re: Thermometer PIC code

Posted: Wed Aug 26, 2015 2:39 am
by Tony
The AM2302 sensor is a more accurate substitute for the DHT11 but the data is formatted slightly differently. This is a modified hexfile you can try out if you want to upgrade the current sensor(s) and improve the humidity accuracy.

Re: Thermometer PIC code

Posted: Thu Aug 27, 2015 1:25 am
by Tony
And of course a version which should detect and process either a DHT11 or AM2303. The detection may or may not be 100% so consider it V0.1 ;)

(it depends on both LSBs of temp and humidity having a non-zero value)

Re: Thermometer PIC code

Posted: Thu Dec 17, 2015 5:26 am
by alex
Hi,

I would like to try the dual sensor mod but my nixie thermometer have the pic16f1847. Can you upload an hex file for the pic16f1847.

Thank you!

Re: Thermometer PIC code

Posted: Sat Dec 19, 2015 5:07 am
by Tony
This should work:
2x IN-12 pod piccode.rar
(3.66 KiB) Downloaded 1375 times

Re: Thermometer PIC code

Posted: Tue Dec 22, 2015 4:53 pm
by alex
Yes, it work great! I get more accurate values with am2302 sensor.

Thanks again.

Re: Thermometer PIC code

Posted: Sun Dec 11, 2016 3:12 am
by Tony
Just in case you can't compile the original .ASM file I've attached the final .hex to this post.