|
|
View previous topic :: View next topic |
Author |
Message |
jecottrell
Joined: 16 Jan 2005 Posts: 559 Location: Tucson, AZ
|
10F202 Timer Questions |
Posted: Mon Jul 31, 2006 10:54 am |
|
|
Hello All,
3.236
10F202
Standard Run Mode
~3V
4MHz, internal
Just started fiddling with a 10F part and ran into some new situations.
10F's have a TIMER_0 and can be set up for RTCC, but I notice in the part header file there is no INT_RTCC?
Can someone give me a nudge in the right direction to be able to beep a buzzer once every thirty seconds or so? Normally the timer would interrupt the processor, add to a counter and then once the counter reached the desired count a flag would get set to beep.... How do you use a timer without an interrupt?
Thanks,
John |
|
|
Ttelmah Guest
|
|
Posted: Mon Jul 31, 2006 11:29 am |
|
|
The chip has no interrupts, so this is 'why' INT_RTCC is missing.
You can read the timer register, and wait for it to reach a value, but if you are not doing anything else (which is the normal reason to use a 'hardware' counter), then just use delay loops.
If you feed the counter of something 'external', such as a 1Hz clock, then you can just read the counter, and beep when it reaches your required count.
Best Wishes |
|
|
jecottrell
Joined: 16 Jan 2005 Posts: 559 Location: Tucson, AZ
|
|
Posted: Mon Jul 31, 2006 11:39 am |
|
|
RJ,
Thanks for the help. I figured out the lack of interrupts when I compared the part header file with another I knew had interrupts.
I would like to save power during the time the processor is waiting to beep. I had hoped to have it sleep and then wake up and beep then go back to sleep. Granted, I should have learned all this when I studied the datasheet before starting.... but we know how that goes.
So, the questions are:
Can I kludge together some duty cycle reducing scheme with the WDT or some other feature of the chip?
Or, the power draw on the chip is relatively small anyway... just live with it? (I'd like to avoid this, because every little bit of life will help.)
Thanks,
John
EDIT:
And that also begs the question.... The wake on change feature obviously doesn't generate an interrupt, it just wakes the processor. I'll then have to poll the port after waking. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|