DS18B20 temp sensor/08m/AXE033 LCD module question
Might be a good idea to post a diagram and also your code.
Forget the DS18B20 for now. Can you display correct text on the LCD (I assume yes but please confirm)
Can you get the display to show numbers correctly?
eg if w0 has the value 1234 can you get the display to show "w0 = 1234"
(don't forget the # before w0 in serout line or use BINTOASCII)
Once the above is working, then and only then involve the DS18B20.
Are you using ReadTemp or ReadTemp12?
Can you get the correct value by using Sertxd instead of sending it to the LCD?
If not, what value do you get? (maybe 0, 255 or 85. Any of those three values will give us a clue about what is happening)
Do you have a 4k7 pull-up resistor on pin 2 of the DS18B20?
Leg 7 (C.0) is also the sertxd pin so any debug or sertxd or new program download will mess up the serial LCD screen. Use a different output like leg 6 (C.1) for the LCD
Thanks for getting back to me.
I'm afraid that I didn't quite understand all your questions, but this is what I have been able to find out so far.
If I use this code:-
main:
readtemp 4,b1 'read temperature
debug b1 'display on screen
pause 250 'short pause
goto main
Leg 7 to LCD gives "debug" box on Prog/Ed screen plus all black blobs LCD screen with blob ativity when I hold temp sensor.
Leg 6 to LCD gives "debug" box with empty LCD screen.
If I use this code:- (using correct leg # in code )
init: pause 500
main: serout 1,N2400,(254,128)
serout 1,N2400,("1234")
end
Leg 7 ( c.0 ) to LCD gives nonsense on the LCD creen and empty serial terminal box (2400,n,8,1 ) on Prog/Ed screen
Leg 6 ( c.1 ) to LCD gives just 1234 and empty serial terminal box (2400,n,8,1 ) on Prog/Ed screen.
Yes, I have 4.7k resistor on middle leg of temp sensor.
I didn't understand the Sertxd bit, but as it seemed important, I tried this code:-
main:
for b1 = 0 to 63 ; start a loop
sertxd(“255 ”,#b1,13,10)
pause 1000
next b1 ; next loop
When I ran this code I got nonsense on terminal box in Prog/Ed and an LCD screen full of nonsense that changed when I held Temp sensor.
I hope that you can make some sense of all this and are ( hopefully ) able to come up with some ideas to enable me to read the DS18B20 in 12 bit mode!
David Miles.