Exact match. Not showing close matches.
PICList
Thread
'[PIC]: Extending TMR2'
2001\10\17@085517
by
Mike Blakey
|
I'm currently using a 16f876 20Mhz. in an application. I need to delay an output
between 0.06s and 0.003s.
I have pre and post scaled to 16 on TMR2 but can only get a max. delay of 0.029s I
can not afford the overhead of waiting and counting interrupts. does anyone have
any *smart* ideas to extend the time period?
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuT
mitvma.mit.edu with SET PICList DIGEST in the body
2001\10\17@103825
by
Roman Black
Mike Blakey wrote:
>
> I'm currently using a 16f876 20Mhz. in an application. I need to delay an output
> between 0.06s and 0.003s.
>
> I have pre and post scaled to 16 on TMR2 but can only get a max. delay of 0.029s I
> can not afford the overhead of waiting and counting interrupts. does anyone have
> any *smart* ideas to extend the time period?
Hi Mike, what's the main problem? Do you need
seamless and adjustable period delays? What
resolution do you need, how may total delay
periods do you need etc. More info is needed
before the best solution can be suggested. :o)
-Roman
--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspam
@spam@mitvma.mit.edu with SET PICList DIGEST in the body
2001\10\17@111143
by
Drew Vassallo
|
>I'm currently using a 16f876 20Mhz. in an application. I need to delay an
>output
>between 0.06s and 0.003s.
>
>I have pre and post scaled to 16 on TMR2 but can only get a max. delay of
>0.029s I
>can not afford the overhead of waiting and counting interrupts. does anyone
>have
>any *smart* ideas to extend the time period?
Maybe this isn't what you're looking for, since you haven't included any
details about the function of your program, but, how about this:
1) Clear a flag bit when you set your output low (for example)
2) When you get your .029s interrupt, check the flag bit. If clear, set it.
If set, then change your output high (2*.029s ~ .06s).
Of course, you'd have to set your delay for 1/2 of what you need, then use
the flag to double it.
I'm not sure if you need better precision, but since you mentioned a range
of .003s and .06s, this might be good enough. And you'd only have a .002s
max error (assuming your max. delay possible is REALLY .0290 seconds) with
the flag's doubling effect.
--Andrew
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listserv
KILLspammitvma.mit.edu with SET PICList DIGEST in the body
2001\10\17@232933
by
Gennette, Bruce
A cheap, external hardware solution uses a counter chip fed from OSCout.
You select a counter output to feed back to the counter's reset AND to a
timer input.
Bye.
{Original Message removed}
2001\10\18@044719
by
Mike Blakey
|
Thanks for the help. I need to vary a pulse width between 0.06s and 0.003s (using a
20Mhz, TMR2 16prescale & 16 post scale, that is a count of between 563 and 4)
obviously, I run out at a count of 255 (0.029s) whilst TMR2 is timing this period
the PIC is busy doing other stuff. What am after is to put a value into TMR2, set
the output, have it time out the required period, interrupt once to reset the
output, therefore giving me the simple variable pulse width. This is a repetitive
pulse, but is initiated from an other input. All the other timers are 'in-use'.
8bit resolution is fine, and a minimum resolution of approx. 0.00012 will be fine.
Thanks for any advice.
.....fastvidKILLspam
.....EZY.NET.AU on 18/10/2001 01:25:43
Please respond to EraseMEPICLISTspam_OUT
TakeThisOuTMITVMA.MIT.EDUspam_OUT
TakeThisOuTINTERNETspam_OUT
TakeThisOuTwtgw
To: PICLIST
spam_OUTMITVMA.MIT.EDU
spam_OUTINTERNET
spam_OUTwtgw
cc:
Paper Mail:
Subject: Re: [PIC]: Extending TMR2
*** WARNING ***
This mail has originated outside your organization,
either from an external partner or the Global Internet.
Keep this in mind if you answer this message.
Mike Blakey wrote:
>
> I'm currently using a 16f876 20Mhz. in an application. I need to delay an output
> between 0.06s and 0.003s.
>
> I have pre and post scaled to 16 on TMR2 but can only get a max. delay of 0.029s
I
> can not afford the overhead of waiting and counting interrupts. does anyone have
> any *smart* ideas to extend the time period?
Hi Mike, what's the main problem? Do you need
seamless and adjustable period delays? What
resolution do you need, how may total delay
periods do you need etc. More info is needed
before the best solution can be suggested. :o)
-Roman
--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email @spam@listservKILLspam
mitvma.mit.edu with SET PICList DIGEST in the body
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
--
http://www.piclist.com hint: To leave the PICList
KILLspampiclist-unsubscribe-requestKILLspam
mitvma.mit.edu
2001\10\18@062552
by
Mike Blakey
|
Thanks for the reply, This is exactly what I was looking for, the only problem I
have is that during the pulse period the PIC is 'busy' doing some other stuff! I
think I'm going to have to do as you have suggested, even counting several
interrupts will give higher resolution, but may cause me stack problems, which is
what I am trying to avoid.
Thanks for the help.
RemoveMEsnurpleTakeThisOuT
HOTMAIL.COM on 17/10/2001 15:10:56
Please respond to spamBeGonePICLISTspamBeGone
MITVMA.MIT.EDUspamBeGone
INTERNETspamBeGone
wtgw
To: TakeThisOuTPICLISTEraseME
spam_OUTMITVMA.MIT.EDUEraseME
spam_OUTINTERNETEraseME
spam_OUTwtgw
cc:
Paper Mail:
Subject: Re: [PIC]: Extending TMR2
*** WARNING ***
This mail has originated outside your organization,
either from an external partner or the Global Internet.
Keep this in mind if you answer this message.
>I'm currently using a 16f876 20Mhz. in an application. I need to delay an
>output
>between 0.06s and 0.003s.
>
>I have pre and post scaled to 16 on TMR2 but can only get a max. delay of
>0.029s I
>can not afford the overhead of waiting and counting interrupts. does anyone
>have
>any *smart* ideas to extend the time period?
Maybe this isn't what you're looking for, since you haven't included any
details about the function of your program, but, how about this:
1) Clear a flag bit when you set your output low (for example)
2) When you get your .029s interrupt, check the flag bit. If clear, set it.
If set, then change your output high (2*.029s ~ .06s).
Of course, you'd have to set your delay for 1/2 of what you need, then use
the flag to double it.
I'm not sure if you need better precision, but since you mentioned a range
of .003s and .06s, this might be good enough. And you'd only have a .002s
max error (assuming your max. delay possible is REALLY .0290 seconds) with
the flag's doubling effect.
--Andrew
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistserv
TakeThisOuTmitvma.mit.edu with SET PICList DIGEST in the body
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestEraseME
.....mitvma.mit.edu
2001\10\18@135556
by
Drew Vassallo
2001\10\18@135953
by
Drew Vassallo
>interrupts will give higher resolution, but may cause me stack problems,
>which is
>what I am trying to avoid.
If you're expecting to safely enter the ISR anyways because of the "normal"
TMR2 interrupt, there's no reason to expect stack problems just because
you're entering the ISR effectively twice as often. And you will LOSE
resolution each time you go through the ISR (count more interrupts with a
smaller TMR2 scale), you won't get higher resolution.
--Andrew
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestEraseME
EraseMEmitvma.mit.edu
2001\10\19@033158
by
Mike Blakey
|
The instruction cycle time is 0.00000005s for a 20Mhz clock! and with both the post
scale and pre-scale set to 16 you get a TMR2 resolution of 0.0000128s!
Do you live near a black hole, where time is different from here?
RemoveMEsnurplespam_OUT
KILLspamHOTMAIL.COM on 18/10/2001 17:54:59
Please respond to RemoveMEPICLISTTakeThisOuT
spamMITVMA.MIT.EDUTakeThisOuT
spamINTERNETTakeThisOuT
spamwtgw
To: EraseMEPICLISTspam
spamBeGoneMITVMA.MIT.EDUspam
spamBeGoneINTERNETspam
spamBeGonewtgw
cc:
Paper Mail:
Subject: Re: [PIC]: Extending TMR2
*** WARNING ***
This mail has originated outside your organization,
either from an external partner or the Global Internet.
Keep this in mind if you answer this message.
>8bit resolution is fine, and a minimum resolution of approx. 0.00012 will
>be fine.
How can you expect to get a pulse resolution of .00012 if your instruction
cycle time is .0002 at 20 MHz?
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestKILLspam
mitvma.mit.edu
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
2001\10\19@120743
by
Drew Vassallo
>The instruction cycle time is 0.00000005s for a 20Mhz clock! and with both
>the post
>scale and pre-scale set to 16 you get a TMR2 resolution of 0.0000128s!
>
>Do you live near a black hole, where time is different from here?
The quadrature timing for instruction pipelining in the PIC line of products
is a 4:1 ratio. That means a 1/20MHz * 4 = cycle time per instruction.
20MHz cycle time = 200ns = .2us
I don't live near a black hole, but maybe your datasheets got sucked into
one.
--Andrew
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
2001\10\24@053449
by
Martin Hill
Without any units on here I could be completely wrong, but surely the cycle
time at 20MHz is 200ns, which is 0.0000002s. Unless you are talking mS in
which case it is .0002ms, either way, it helps if you use some units!!
Martin
{Original Message removed}
More... (looser matching)
- Last day of these posts
- In 2001
, 2002 only
- Today
- New search...