Hi, Malc
I don't remember your program, but why not use the time the DS1820s make their measure/conversion to update the LCD, instead of waiting for conversion complete ???
Alain
Hi, Malc
I don't remember your program, but why not use the time the DS1820s make their measure/conversion to update the LCD, instead of waiting for conversion complete ???
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Malcolm,
You could also do this via a Timer Interrupt using DT's Instant Interrupts.
Say, Timer2 (8bit timer) with both a Prescaler and Postscaler, then in the ISR decrement a word variable that is preset to a number that gets you to 3 seconds or whatever time you want. When the var reaches zero set a flag to run the display routine and reset the word var back to your preload value. In your main loop test for the flag and call the display routine if set and then clear the flag.
This would allow you to hit a time-based delay much easier.
Regards,
TABSoft
Why not just count the number of data updates and after so many, Update the display with a different set of data? That way you won't slow down the data taking and control timing and you will get a "cycling" data display you want. That way there is no need for a delay of any type.
Dave Purola,
N8NTA
EN82fn
Thanks for the suggestions guys.
Dave, your suggestions sounds simple enough for me to understand. I guess I could have a variable that is updated every time the program goes around the main loop, then when it reaches a certain value display one set of data for the 1st probe, then when reaches another it displays the second set etc... I'll have a look at implementing that. I guess that provided the program doesn't loop more than 65535 times in 8 seconds then I will be able to use a word variable and each update would be visible for 2 seconds
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.
Since you are using DT interrupts, another approach would be to use a variable to count every time the program goes to the interrupt routine. After so many hits, then you update the LCD display. Depending on how long you set the time intervals for the interrupts, this might be a "cleaner" solution.
"No one is completely worthless. They can always serve as a bad example."
Anonymous
Guys, thanks for your continued input.
I've hit a hurdle and it's doing my head in. In the original code the readings from the 4 sensors were displayed constantly on the LCD, so within the main program loop there is a for next loop which runs through and reads the 4 DS18B20's and puts the results into a 4 line array. This results in a fast response in updating the display when temperatures change. Now that I'm also reading an AM2302 and want to display data from that too, the LCD looks cluttered if I follow the same method, hence my idea of displaying the readings from each vivarium on a single line, which would overwrite the values for each vivarium every few seconds. The problem is that if I opt to change this so the for next loop which reads the sensors is changed so that it reads sensor 1 and then goes to a subroutine to display the results for two or three seconds it means that it can take 8 - 12 seconds to go round the loop to read all four sensors, which defeats the object of having fast response times, and in 12 seconds the temp in the vivarium could become dangerously high as this would effect the PID timings.
I think to only option is to use two 20 x 4 LCD's or one 40 x 4 LCD, or possibly a GLCD
Can you post a mockup of your display in text and how you use it and how you see using it?
Regards,
TABSoft
Bookmarks