Hi everyone,
Warning: Complete newbie to embedded processors here! I've recently begun working through the manuals and my mind is a-glow with whirling transient nodes of thought, careening through a cosmic vapor of invention with the possibilities of these wonderful chips. Right now, it's hard for me to stay focused on the basics when I keep coming up with new (to me) ideas. You know the feeling, I bet: I'm stuck in one of those "Do...While Having a New Idea" loops. The simulator on the Programming Editor is just too cool for words.
I need to have long delay times of multiple hours before firing a relay for a few seconds to a few minutes, but I would like to have a "heartbeat" led to reassure me that things are well. That means using Pause for long times is out, obviously.
A couple of quick questions about implementation, if you don't mind...
First, what's the most efficient way to do a long delay? Should I convert the delay time to minutes or use hours and minutes with the appropriate amount of nested loops? (Hours, Minutes, Seconds)
Second, is there a better way to do this than with nested loops? I assume the best way to have the led heartbeat is to have a loop at the core counting the seconds and switching the LED, but please let me know if there's an advanced technique that works better.
Third, split second accuracy isn't important right now, but how much trouble is it to hook up the DS1307 later? I have some 08 and 14 kits ordered, but can get the bigger ones, if needed.
Are the external crystal controlled PICs significantly more accurate for this?
BTW, power is not an issue for this since it will be hooked to a wallwart.
Thanks very much in advance!
Warning: Complete newbie to embedded processors here! I've recently begun working through the manuals and my mind is a-glow with whirling transient nodes of thought, careening through a cosmic vapor of invention with the possibilities of these wonderful chips. Right now, it's hard for me to stay focused on the basics when I keep coming up with new (to me) ideas. You know the feeling, I bet: I'm stuck in one of those "Do...While Having a New Idea" loops. The simulator on the Programming Editor is just too cool for words.
I need to have long delay times of multiple hours before firing a relay for a few seconds to a few minutes, but I would like to have a "heartbeat" led to reassure me that things are well. That means using Pause for long times is out, obviously.
A couple of quick questions about implementation, if you don't mind...
First, what's the most efficient way to do a long delay? Should I convert the delay time to minutes or use hours and minutes with the appropriate amount of nested loops? (Hours, Minutes, Seconds)
Second, is there a better way to do this than with nested loops? I assume the best way to have the led heartbeat is to have a loop at the core counting the seconds and switching the LED, but please let me know if there's an advanced technique that works better.
Third, split second accuracy isn't important right now, but how much trouble is it to hook up the DS1307 later? I have some 08 and 14 kits ordered, but can get the bigger ones, if needed.
Are the external crystal controlled PICs significantly more accurate for this?
BTW, power is not an issue for this since it will be hooked to a wallwart.
Thanks very much in advance!
Last edited: