Thanks for reply !
The display show like in picture from post #116. But pushing the buttons '+' , '-' or 'Mode' has no effect.
Thanks for reply !
The display show like in picture from post #116. But pushing the buttons '+' , '-' or 'Mode' has no effect.
Hello Fratello,
I have been looking over your code for a while now. I have not found anything obvious to me, although there may be something obvious to others.
One thing I did notice, is that your MainLoop will cycle through modes 0, 1, and 2, even without any buttons being pressed. This is fine, but one thing you are doing in mode 2, and after mode 2, is writing to the eeprom. At 4 mhz, you will reach that 1,000,000 write cycles quicker than you think (have not calculated it, but if this is really going to be a thermostat, I assume it is going to be running for a while). A better way to do it would be to only write the targettemp, etc to the eeprom when targettemp is different than the eeprom value for targettemp (ie, it has been adjusted).
Seems like the next step is to see if the 16f628a even knows if the buttons have been pressed. Why not make a simple light an LED line inside some of your if then statements to verify the chip knows a button has been pressed? This could help point to the source of the problem.
Walter
The code works PERFECT with LCD 2x16...I just try to insert the parts for Nokia display...(and removing, of course, the parts for other display). I think the problems are generated by wrong 'substitution'. Thanks anyway for reply !
That's great! If it is working perfectly with the 2 x 16 lcd, you should be seeing the new changed values in your eeprom. This should be an indication that only your LCD_3310 code is bad, and that the thermostat functions are working!
Hi fratello, Do you have pullup resistors on those switches ? You do not have WPU enabled, so you need them, or change the Option_Reg, to enable them.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Me again !
I found the mistake ; after MainLoop the code must be :
If PortB.3=0 then ; this is the missing line
If PortB.3=0 then MainLoop
...
...
Endif
Endif
Work correct on pushing MODE button , but...
Now I have another problem... I attach the code for display the temperature in both cases (LCD 2X16 ; N3310).
How do I convert this line :
LcdOut $FE, $C0, "OUT ", Sign, DEC (Temperature2 / 100), ".", DEC2 Temperature2, " ",223,"C "
for correct results on Nokia display ?
DEC (Temperature2 /100) it's what char ?
DEC2 Temperature2 it's what char ?
I try many codes but on display appears numbers and strange characters....
Thanks !
Here I am assuming that at 25.1 degrees c , Temperature2 = 2510
On yours, it looks like it would be:
But I thought from your picture in post #116 that you were printing temperature already?Code:char = (Temperature2 dig 3) + 2 'get digit 3 ("2"510) and add 2 so it matches eeprom move x y to right location and print it 'do whatever you do to print to lcd char = (Temperature2 dig 2) + 2 'get digit 2 (2"5"10) and add 2 move x y to right location and print it char = 14 'in you eeprom this is a "." move x y to right location and print it char = (Temperature2 dig 1) + 2 'get digit 1 (25"1"0) and add 2 move x y to right location and print it
Now I am confused again...
I now see that your change to MainLoop fixes the write to eeprom every cycle problem too. Very nice.
Last edited by ScaleRobotics; - 26th April 2009 at 22:06.
THANK YOU ! And THANK YOU ALL !
It's work ! Yes !!!!!! I'm -once again, thanks to you, all- happy !
This is the 1.0 version of code for dual zone & thermostat with Nokia 3310 display ! All the best to all !
Version 2. Some minors but necessary modifications. Tested - function of thermostat work fine. Not tested for negative temperatures...
Bookmarks