You can use DTs stuff for this but regular interrupts should be fast enough.
You can use DTs stuff for this but regular interrupts should be fast enough.
Dave
Always wear safety glasses while programming.
ok thanks, ill just use normal interupts! im gonna look around and try and make some code to use interupts
ok ive made my code, probably got some errors in, however thats not the problem. ive been thinking about this whole trouble with if the voltage is idling on a point lower than my low voltage detection level but not low enough that it causes a reset... problem is.. if it gets too that point my program starts looping because the interupt keeps getting set off by the low voltage.
i was thinking since when the wind turbine actually gets slow enough that the voltage is about 2-3 volts, its not actually giving out any power (if it does then its completely negligible). so when i get to a low point can i just turn off the pic? and get it too restart when the power gets higher?
You might be able to use an external comparator to watch the voltage and kill the PIC that way....
What about a small rechargable battery pack to run the PIC for a few hours then the PIC is always on.
Dave
Always wear safety glasses while programming.
im gonna look into the battery idea actually, but flaws with it could be that over 20 years a rechargeable battery will have effectively "lost its ability to recharge" and also there will be points where the wind is dead for longer than the battery can keep the pic and lcd running...
are there any commands to just turn off the pic and then get it back going when the voltage is high enough? cos surely if the pic is turned off... how can it be turned back on again? since the software is obvioulsy not running because the pic is off :S
actually does the power on reset turn the pic back on after i have turned it off? if i put the mclr pin to Vdd, it will detect a rise in voltage? and cause a reset?
if i turned the pic off at a certain voltage... and then when the pic detects a rise in voltage the power on reset occurs and turns my pic back on and restarts the program?
Pros and cons no matter what. I have one of the "smart thermostats" at the house. It runs on two AA batteries that need changed once a year or so. Might have to be a bit of upkeep for the end user???? I know, not good.
There is the sleep command but that just puts the PIC in low power mode.are there any commands to just turn off the pic and then get it back going when the voltage is high enough? cos surely if the pic is turned off... how can it be turned back on again? since the software is obvioulsy not running because the pic is off :S
I have a feeling that the best way to go will be an external comparator working a latching relay or FET on the 12 volt line. Rig it so when the voltage drops below X the relay stays off untill the voltage comes back up to Z. Give a little range between the two points.
Then the interrupt thing should work. If the PIC shuts down only from lack of power it will restart.
Just thinking.... Or is it babbling![]()
Dave
Always wear safety glasses while programming.
no ive been thinking and the ways that you describe are the only two ways i can think of doing it... the battery thing would work nicely i just dont think a customer would be too happy having to change batteries much...
im gonna try out ur second example with the comparator! thanks for your help once again mack! ill let u know how it goes
Bookmarks