I'm not sure but I have been modifying the code and I think the problem is displaying the temp on the lcd and I am not displaying/changing it correctly
From dallas app note 105
DS1620, DS1623, and DS1625:
1. Issue Start Convert protocol (EEh).
2. When conversion is finished, read 9–bit temperature value (AAh).
3. Truncate half–degree bit from reading.
4. Convert truncated value from 2’s complement to signed integer (named temp_read).
5. Read 9–bit counter value (A0h; named count_remain).
6. Send undocumented Load Counter protocol (41h).
7. Read 9–bit counter value (A0h; named count_per_degree).
APPLICATION NOTE 105
4 of 20
8. Calculate high–resolution temperature using the high resolution temperature equation given in the
previous section.
The equation is tempreture=˝ LSB = 0.25.temp_read-1/2 LSB + (count_per_degree - count_remain)/count_per_degree
When I use the code on the lcd
Lcdout $fe, 1, dec (degc >> 1), ".", dec (degc.0 * 5), " degrees C"
The lcd displays 2562
When I use the code on the lcd
Lcdout $fe, 1, rep "-"\degC.bit15,dec abs degC/10,".",dec2 abs degC
The lcd displays 51.24
My maths is quite bad and some parts look very alien to me so if anyone has got any sugestions on what I can try.
Bookmarks