I am new to programming stuff. Can anybody help me out with this problem. I need to transmit the data once in 15 sec. In order to save battery life i am sending the controller into Sleep mode.
As of now the sleep function i am using is like this :
SETUP_WDT(WDT_288MS);
RESTART_WDT();
SLEEP();
My question is can we setup the WDT to 14 sec or is their any maximum limit to the WDT??
Thanks for the update Mike.
After completing the 288ms the WDT will generate a WDT wake up (read from the datasheet). So the program comes out of sleep. Is there any use in providing a counter?
I thought about that but i should check the WDT flag every time. This will increase futher more steps. Did u hear about crontab? Is it what i am looking for..??
i don't know what it is...
if this links the time and numbers then i will google it and see..
i have mentioned it in the first post.
i will elobarate it here..
the program has to send data to the reader circuit for every 15sec. As the transmission ends battery cannot be changed regularly. We want it to be minimum.
i have mentioned it in the first post.
i will elobarate it here..
the program has to send data to the reader circuit for every 15sec. As the transmission ends battery cannot be changed regularly. We want it to be minimum.
Yes, but how accurate does the 15 seconds need to be?, by using the WDT it can vary from roughly 7.5 seconds to 30 seconds - that's all the accuracy it gives, varying a LOT with temperature.
What current is the rest of your circuit taking?, if you run the PIC at a low clock speed it's got very low consumption anyway - if the rest of your circuit takes any appreciable current, using sleep mode probably isn't going to save you anything worthwhile?.
Yes, but how accurate does the 15 seconds need to be?, by using the WDT it can vary from roughly 7.5 seconds to 30 seconds - that's all the accuracy it gives, varying a LOT with temperature.
The WDT is temperature sensitive and makes for a horrible clock timebase. The WDT was designed to get your PIC out of a program lockup.
The right way to do it is add a 32768Hz crystal on Timer1's oscillator pins. This will interrupt / wakeup the PIC every 2 seconds (programmable see my Dragonfly documentation for an example)
Also make sure to turn off internal peripherals as they draw power.
Some PICs like the 16F88 have an enhanced WDT which can be programmed for up to 4 minutes.
Before any efforts or the "addition" of parts to aid in a problem, first measure the Full main line power consumption without sleeping to get a baseline. Then measure Full main line power consumption with the PIC in sleep mode as a comparison. Repeat for each existing devices. Once whatever device is found to be the biggest contributor of power consumption then target it, be it PIC or da..da.. da...
This is a stupid question to ask but i have to ask..
Can i use the timer1 without external clock? The datasheet says timer1 should have a oscillator . But as i have made my PCB already in bulk with no external clock, is there any change of using Timer1 without osc?
Before any efforts or the "addition" of parts to aid in a problem, first measure the Full main line power consumption without sleeping to get a baseline. Then measure Full main line power consumption with the PIC in sleep mode as a comparison. Repeat for each existing devices. Once whatever device is found to be the biggest contributor of power consumption then target it, be it PIC or da..da.. da...