1st question divide by 0x010000
2nd question = 464
Do you really need 1 second intervals and how exact do you need to be?
1st question divide by 0x010000
2nd question = 464
Do you really need 1 second intervals and how exact do you need to be?
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Thanks paul. I am planning to build a temperature datalogger, that will collect data every two minutes for a month or two, so I need to get it as accurate as possible. Also, in my country, Argentina, there are not RTC availables....
Now following Ronsimpson way, (the second one, with the 20.000 MHz), the variable to which we add 859 on every interrupt, I should never clear it, right??? Or should I clear it every time the variable overflows???
Sorry for my english, and thanks again.
Manuel
>>collect data every two minutes for a month
Check out
http://www.picbasic.co.uk/forum/showthread.php?t=2129
It would be easy to add in the data logger every two minutes.
With Ron's approach, do not stop the timer, just add fast after the interrupt.
Why 20MHz for a datalogger?
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Hey
Thanks so much for the links. There great because the dont have interreptsand they are not too complicated!!!
Yes youre right 20MHz is WAY too much for this project. I could use only 32KHz and bring down the current draw.
I am going to use an LM34 or LM35 to measure temperature, and I was thinking of shutting it down while im waiting to save power. How long before making the actual measurement do you think I should turn it on so that the sensor has stabilized???
Thanks
Manuel
>>I was thinking of shutting it down while im waiting to save power
I am guessing you are referring to the LM34/35 and not the Pic? If so, I am sure it is in the datasheet. If you are planning to run off of batteries, then the lower XTAL speed would be ideal for the PIC
A free runing TMR1 will overflow every 8 seconds (prescaler = 1) with a 32768 XTAL. You could count 15 overflows for 2 minutes.
Or you cold poll TMR0, also free running (prescaler = 256) with a 32768 XTAL. You could count 15 overflows for 2 minutes. The link I gave you has an example of polling TMRO.
Too many options - also check the LM34/35 datasheet and see what it needs in the way of communication speeds, etc. I have not looked for some time and do not recall the method.
There have been a zillion questions in this forum about the LM34/35 over the years - search and you shall be rewarded.
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Hi. Thanks for your help.
Yes, as you said, it would be ideal the low frequency crystal, and the timing is also much simplerLOL.
The LM35 outputs a linear 10 mV/`C and the LM34 is 10 mV/`F
Anyway, that wouldnt be a problem with speed, but will I be able to interface an I2C EEPROM like 24LM32 with that speed??? I guess yes because its syhncronus transmission, but i ask to be sure
Thanks a lot
Manuel
Bookmarks