Well, I feel honored for winning the chocolate fish, and sorry for anyone who hasn't got a mute function on this email thread.<div>I've had a frustrating day trying to code up a brushless DC motor controller... (hence the procrastinating).</div>
<div><meta http-equiv="content-type" content="text/html; charset=utf-8">Anyway I'd like to put this winning chocolate fish up for grabs again to the first person that tells me how to measure a pulse-width (connected to an external interrupt), glitch-free!! :</div>
<div><meta http-equiv="content-type" content="text/html; charset=utf-8">This is roughly what I got:</div><div><br></div><div>#define TIMERWRAP 1024</div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>
<br></div><div>ISR(ExternalInterrupt) // highest priority</div><div>{</div><div> if (triggered on +ve edge) {</div><div> set to trigger on -ve edge;</div><div> count = TIMERWRAP - Timer;</div><div> }</div>
<div> else {</div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div> set to trigger on +ve edge;</div><div> count += Timer;</div><div> // Now Count should be the pulse length... but it has glitches see below</div>
<div> }</div><div>}</div><div><br></div><div>ISR(TimerOverflow) // overflows at TIMERWRAP ticks</div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>{</div><div> count += TIMERWRAP;</div><div>
....</div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>}</div><div><br></div><div>ISR(other)</div><div>{</div><div> ...</div><div>}</div><div><br></div><div>Now the problem occurs (very infrequent) when both the TimerOverflow and External interrupt occur while another (non-nesting) ISR is being processed. The Ext Interrupt will be processed first therefore missing out on the extra TIMERWRAP. I've tried compensating by reading the interrupt flag register when processing the external interrupt, it reduces the frequency of glitches but as-long as there is any time between reading the flags register and the timer I get glitches.</div>
<div>Is this one of those impossible micro-processor problems?</div><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>
<br></div><div><br></div><div><div><br><div class="gmail_quote">On 22 July 2011 14:55, Charles Manning <span dir="ltr"><<a href="mailto:manningc2@actrix.gen.nz">manningc2@actrix.gen.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Friday 22 July 2011 14:46:43 Synco Reynders wrote:<br>
> HP-12C is a finacial calculator.<br>
<br>
</div>Synco wins the prize!<br>
<br>
Yes folks, the HP-12C has been in continuous production for over 30 years and<br>
is still the preferred choice of accountants and auditors the world over.<br>
<br>
There have been some slight internal changes to adjust to changes in<br>
manufacturing processes, but the 12C looks the same and does the same thing<br>
as it has always done.<br>
<br>
As with most "real" HP calculators, it's RPN which makes it faster to use than<br>
those damn "arithmetic" calculators. Anyone who can't use RPN doesn't know<br>
what they're missing!<br>
<font color="#888888"><br>
-- Charles<br>
</font><div><div></div><div class="h5"><br>
<br>
<br>
> /s<br>
><br>
> On 22 July 2011 14:42, Cass Jones <<a href="mailto:jones.cass@gmail.com">jones.cass@gmail.com</a>> wrote:<br>
> > The F91w still looks the same as far as I know, wikipedia reckons they<br>
> > have only been around since 1991<br>
> ><br>
> > On Fri, Jul 22, 2011 at 2:40 PM, Charles Manning<br>
> ><br>
> > <<a href="mailto:manningc2@actrix.gen.nz">manningc2@actrix.gen.nz</a>> wrote:<br>
> > > On Friday 22 July 2011 14:33:35 Synco Reynders wrote:<br>
> > >> Digital watch?<br>
> > ><br>
> > > I don't want a category of item. I want a Make/Model that is the same<br>
> > > as<br>
> ><br>
> > it<br>
> ><br>
> > > was years ago with no cosmetic changes.<br>
> > ><br>
> > > While Casio G-Shocks have been around for well over 20 years they are<br>
> > > not<br>
> ><br>
> > the<br>
> ><br>
> > > same model as the original ones and don't look the same.<br>
> > ><br>
> > > Hints so far:<br>
> > > It takes batteries<br>
> > > It has an LCD<br>
> > > If you have one you probably wear a tie.<br>
> > ><br>
> > > No more hints yet to give others a chance...<br>
> > ><br>
> > >> /s<br>
> > >><br>
> > >> On 22 July 2011 14:31, Charles Manning <<a href="mailto:manningc2@actrix.gen.nz">manningc2@actrix.gen.nz</a>> wrote:<br>
> > >> > On Friday 22 July 2011 14:24:23 Cass Jones wrote:<br>
> > >> > > Oh a pocket calculator the fx-82 I presume<br>
> > >> ><br>
> > >> > Getting closer.<br>
> > >> ><br>
> > >> > The FX-82 is not a single model. It is a family of models with<br>
> ><br>
> > different<br>
> ><br>
> > >> > capabilities and different look and feel.<br>
> > >> ><br>
> > >> > What I am looking for is a gizzmo that looks identical over the last<br>
> ><br>
> > many<br>
> ><br>
> > >> > decades (except for different "Made In xxx" etc).<br>
> > >> ><br>
> > >> > One manufacturer. One model. Looks exactly the same.<br>
> > >> ><br>
> > >> > Hint3: If you have one you probably wear a tie.<br>
> > >> ><br>
> > >> > > On Fri, Jul 22, 2011 at 2:23 PM, Charles Manning<br>
> > >> > ><br>
> > >> > > <<a href="mailto:manningc2@actrix.gen.nz">manningc2@actrix.gen.nz</a>> wrote:<br>
> > >> > > > These are not the same gadget. They are different models made by<br>
> > >> > > > different manufacturers.<br>
> > >> > > ><br>
> > >> > > > The answer I want is a fully functional gizzmo made by the same<br>
> > >> > > > manufacturer under the same model number for decades.<br>
> > >> > > ><br>
> > >> > > > Hint 2: It has an LCD.<br>
> > >> > > ><br>
> > >> > > > On Friday 22 July 2011 14:20:11 Synco Reynders wrote:<br>
> > >> > > >> Light-bulb? Fuse? Spark-plugs? Torch? Door-bell? ...<br>
> > >> > > >> Hoping to get atleast 1 chocolate fish ;-)<br>
> > >> > > >> /s<br>
> > >> > > >><br>
> > >> > > >> On 22 July 2011 14:08, Charles Manning<br>
> > >> > > >> <<a href="mailto:manningc2@actrix.gen.nz">manningc2@actrix.gen.nz</a>><br>
> > >> ><br>
> > >> > wrote:<br>
> > >> > > >> > I hereby off a choc fish to the first correct answer to this<br>
> > >> > > >> > question...<br>
> > >> > > >> ><br>
> > >> > > >> > In this crazy world we live in, electronic gadgets change all<br>
> ><br>
> > the<br>
> ><br>
> > >> > > >> > time. Try to<br>
> > >> > > >> > find something you bought last and you will find it has been<br>
> > >> ><br>
> > >> > replaced<br>
> > >> ><br>
> > >> > > >> > by a different model.<br>
> > >> > > >> ><br>
> > >> > > >> > There is, however, one electronic gadget that has been in<br>
> > >> > > >> > production for a few<br>
> > >> > > >> > decades. Same model. Same function. Still in production.<br>
> > >> > > >> ><br>
> > >> > > >> > What is it?<br>
> > >> > > >> ><br>
> > >> > > >> > Charles<br>
> > >> > > >> ><br>
> > >> > > >> > _______________________________________________<br>
> > >> > > >> > Chchrobotics mailing list <a href="mailto:Chchrobotics@lists.linuxnut.co.nz">Chchrobotics@lists.linuxnut.co.nz</a><br>
> > >> > > >> > <a href="http://lists.ourshack.com/mailman/listinfo/chchrobotics" target="_blank">http://lists.ourshack.com/mailman/listinfo/chchrobotics</a><br>
> > >> > > >> > Mail Archives:<br>
> ><br>
> > <a href="http://lists.ourshack.com/pipermail/chchrobotics/" target="_blank">http://lists.ourshack.com/pipermail/chchrobotics/</a><br>
> ><br>
> > >> > > >> > Web site: <a href="http://kiwibots.org" target="_blank">http://kiwibots.org</a><br>
> > >> > > >> > Meeting Time and Location uncertain while Science Alive is<br>
> > >> > > >> > out<br>
> ><br>
> > of<br>
> ><br>
> > >> > > >> > action.<br>
> > >> > > >> ><br>
> > >> > > >> > When replying, please edit your Subject line to reflect new<br>
> > >> > > >> > content.<br>
> > >> > > ><br>
> > >> > > > _______________________________________________<br>
> > >> > > > Chchrobotics mailing list <a href="mailto:Chchrobotics@lists.linuxnut.co.nz">Chchrobotics@lists.linuxnut.co.nz</a><br>
> > >> > > > <a href="http://lists.ourshack.com/mailman/listinfo/chchrobotics" target="_blank">http://lists.ourshack.com/mailman/listinfo/chchrobotics</a><br>
> > >> > > > Mail Archives: <a href="http://lists.ourshack.com/pipermail/chchrobotics/" target="_blank">http://lists.ourshack.com/pipermail/chchrobotics/</a><br>
> > >> > > > Web site: <a href="http://kiwibots.org" target="_blank">http://kiwibots.org</a><br>
> > >> > > > Meeting Time and Location uncertain while Science Alive is out<br>
> > >> > > > of<br>
> > >> ><br>
> > >> > action.<br>
> > >> ><br>
> > >> > > > When replying, please edit your Subject line to reflect new<br>
> ><br>
> > content.<br>
> ><br>
> > >> > > _______________________________________________<br>
> > >> > > Chchrobotics mailing list <a href="mailto:Chchrobotics@lists.linuxnut.co.nz">Chchrobotics@lists.linuxnut.co.nz</a><br>
> > >> > > <a href="http://lists.ourshack.com/mailman/listinfo/chchrobotics" target="_blank">http://lists.ourshack.com/mailman/listinfo/chchrobotics</a><br>
> > >> > > Mail Archives: <a href="http://lists.ourshack.com/pipermail/chchrobotics/" target="_blank">http://lists.ourshack.com/pipermail/chchrobotics/</a><br>
> > >> > > Web site: <a href="http://kiwibots.org" target="_blank">http://kiwibots.org</a><br>
> > >> > > Meeting Time and Location uncertain while Science Alive is out of<br>
> > >> > > action.<br>
> > >> > ><br>
> > >> > > When replying, please edit your Subject line to reflect new<br>
> > >> > > content.<br>
> > >> ><br>
> > >> > _______________________________________________<br>
> > >> > Chchrobotics mailing list <a href="mailto:Chchrobotics@lists.linuxnut.co.nz">Chchrobotics@lists.linuxnut.co.nz</a><br>
> > >> > <a href="http://lists.ourshack.com/mailman/listinfo/chchrobotics" target="_blank">http://lists.ourshack.com/mailman/listinfo/chchrobotics</a><br>
> > >> > Mail Archives: <a href="http://lists.ourshack.com/pipermail/chchrobotics/" target="_blank">http://lists.ourshack.com/pipermail/chchrobotics/</a><br>
> > >> > Web site: <a href="http://kiwibots.org" target="_blank">http://kiwibots.org</a><br>
> > >> > Meeting Time and Location uncertain while Science Alive is out of<br>
> ><br>
> > action.<br>
> ><br>
> > >> > When replying, please edit your Subject line to reflect new content.<br>
> > ><br>
> > > _______________________________________________<br>
> > > Chchrobotics mailing list <a href="mailto:Chchrobotics@lists.linuxnut.co.nz">Chchrobotics@lists.linuxnut.co.nz</a><br>
> > > <a href="http://lists.ourshack.com/mailman/listinfo/chchrobotics" target="_blank">http://lists.ourshack.com/mailman/listinfo/chchrobotics</a><br>
> > > Mail Archives: <a href="http://lists.ourshack.com/pipermail/chchrobotics/" target="_blank">http://lists.ourshack.com/pipermail/chchrobotics/</a><br>
> > > Web site: <a href="http://kiwibots.org" target="_blank">http://kiwibots.org</a><br>
> > > Meeting Time and Location uncertain while Science Alive is out of<br>
> > > action.<br>
> > ><br>
> > > When replying, please edit your Subject line to reflect new content.<br>
> ><br>
> > _______________________________________________<br>
> > Chchrobotics mailing list <a href="mailto:Chchrobotics@lists.linuxnut.co.nz">Chchrobotics@lists.linuxnut.co.nz</a><br>
> > <a href="http://lists.ourshack.com/mailman/listinfo/chchrobotics" target="_blank">http://lists.ourshack.com/mailman/listinfo/chchrobotics</a><br>
> > Mail Archives: <a href="http://lists.ourshack.com/pipermail/chchrobotics/" target="_blank">http://lists.ourshack.com/pipermail/chchrobotics/</a><br>
> > Web site: <a href="http://kiwibots.org" target="_blank">http://kiwibots.org</a><br>
> > Meeting Time and Location uncertain while Science Alive is out of action.<br>
> ><br>
> > When replying, please edit your Subject line to reflect new content.<br>
<br>
<br>
<br>
_______________________________________________<br>
Chchrobotics mailing list <a href="mailto:Chchrobotics@lists.linuxnut.co.nz">Chchrobotics@lists.linuxnut.co.nz</a><br>
<a href="http://lists.ourshack.com/mailman/listinfo/chchrobotics" target="_blank">http://lists.ourshack.com/mailman/listinfo/chchrobotics</a><br>
Mail Archives: <a href="http://lists.ourshack.com/pipermail/chchrobotics/" target="_blank">http://lists.ourshack.com/pipermail/chchrobotics/</a><br>
Web site: <a href="http://kiwibots.org" target="_blank">http://kiwibots.org</a><br>
Meeting Time and Location uncertain while Science Alive is out of action.<br>
<br>
When replying, please edit your Subject line to reflect new content.<br>
</div></div></blockquote></div><br></div></div>