<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#3333FF" bgcolor="#FFFFCC">
<div class="moz-cite-prefix">Interrupts are the way to. I have been
advocating and professing using asynchronous coding techniques
over synchronous techniques ever since the late 1980s. Interrupt
routines are to get the values of an interface quickly and set a
handshake variable to a slower processing routine. You never use
timers in the routine, let the timer create the interrupt for
timing, and never use delays or cycle-wasting functions or loops
in the routine. In the main operational loop, check the handshake
and process the values as needed -- but always in an interruptible
way (always process to the buffer pointer minus one to keep from
catching a value that is currently being written by the interrupt
routine). This is actually standard best practice, and makes for
far more responsive processes.<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">On 1/26/21 12:51 PM, Carl Nobile via
TriEmbed wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAGQqDQ+5+_FyvBCTE7LTHvrHesukAX=M=ahVU1NL7U=JWd8N1Q@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Yeah, delays could mess with interrupts even if
they are not in the interrupt itself. Actually what happens is
the interrupt messes with the delay. If the interrupt happens in
the middle of the delay the delay will be longer than what you
set it at.
<div>Almost all processors will be running interrupts even if
you're not using any.</div>
<div>There are other people in the group that have more
experience with this than I, so just my two cents.</div>
<div><br>
</div>
<div>~Carl</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, Jan 26, 2021 at 12:23
PM John Vaughters <<a href="mailto:jvaughters04@yahoo.com"
moz-do-not-send="true">jvaughters04@yahoo.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
You see that, now you guys are making me dig and I was happy
with my solution. `,~)<br>
<br>
ticker lib uses millis() and micro() and not interrupt, but
with your obsessed curiosities, now I may have found the real
problem. You are not supposed to use delay() in the task. And
I did use delay(), so I probably need to change the long task
to do a task with set number of ticks at my delay time instead
of using the delay. Which is much more responsible programming
anyway. This will solve it for sure, now that I know how
Ticker works.<br>
<br>
Back to the testing with me. Oh well, in the end you guys are
making me better.<br>
<br>
Thanks,<br>
<br>
John Vaughters<br>
<br>
<br>
<br>
<br>
<br>
On Tuesday, January 26, 2021, 11:49:44 AM EST, Carl Nobile
<<a href="mailto:carl.nobile@gmail.com" target="_blank"
moz-do-not-send="true">carl.nobile@gmail.com</a>> wrote:
<br>
<br>
<br>
<br>
<br>
<br>
I wonder if your code used an interrupt that couldn't handle
the 25 ms time period.<br>
~Carl<br>
<br>
On Tue, Jan 26, 2021 at 11:10 AM John Vaughters via TriEmbed
<<a href="mailto:triembed@triembed.org" target="_blank"
moz-do-not-send="true">triembed@triembed.org</a>> wrote:<br>
> Pete,<br>
> <br>
> There is a debug port on the board for sure, not sure if
it qualifies as JTAG. I've never actually used a debugger on a
micro-processor, only on regular desktop/server programming. I
never invested the time or money to get that up to speed. I
will say it dumps a bunch of hex code to the serial port when
it crashes and I did not really look at that either. The
reason being that I never ran into a limitation that prevented
my pragmatic application results and I'm more interested in
the end result than the finer details. I just hack until I get
it to work. Same goes for oscilloscopes and electronics, I
just use basic concepts and practices and usually get it to
work. However, I definitely want to gear up with oscilloscopes
and logic analyzers one day. But until I have the time to
play, no need in putting out the dough for it to sit on the
shelf. This attitude is from experience of too many things
sitting on the shelf.<br>
> <br>
> There are two timers on the board, but one is used for
wifi. The other one is available, and I might be able to use
that with better results, but the Ticker library does magic in
the background and appears to act like a simple task
scheduler. So in the code it appears you are setting tasks,
but behind the scenes I have not investigated what it is
actually doing. For sure if you use the single timer you are
limited to one task or a tight management of tasks on that
timer. I'm not quite sure because I did not go that route, I
am just parroting my perception of what I read. So I opted for
the code appearance of tasking through the Ticker library to
make my code more readable. It seems to work great so far and
I am close to being done with my wifi modbus device. The next
application will be a very simple wifi serial to tcp converter
to be able to use with micro-processors that have no network
connections. This will allow modbus over TCP via serial
conversion. You get the sense I like modbus? `,~) What I found
so far is that the serial to tcp application is already solved
and out there in multiple forms, so I just need to pick one
and give it a go. <br>
> <br>
> I never really exposed my end applications; it is for my
home SCADA system that monitors energy use for the goal of
reducing energy while remaining comfortable. Basically, I am
trying to use technology to "Stick it to the Man" `,~) Oh and
have fun learning along the way. I'm pretty sure on just the
electric controls implemented on the hot water heater alone I
have saved enough to pay for my electronics. So anything above
that is pay dirt. <br>
> <br>
> For Robotics, I am really liking the ESP32 combined with
some nano arduinos as specialized processors. Top priority
being a weed eater head remote controlled lawnmower to
minimize allergen exposure. And for the record that has been
on the task list for years and I wouldn't be surprised if it
waits years longer, but hey the technology keeps making the
idea easier as time flies by.<br>
> <br>
> Dreams are good, jobs are better! `,~)<br>
> <br>
> Bottom line is I am loving the ESP line of products.<br>
> <br>
> John Vaughters<br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> On Tuesday, January 26, 2021, 10:20:04 AM EST, Pete Soper
via TriEmbed <<a href="mailto:triembed@triembed.org"
target="_blank" moz-do-not-send="true">triembed@triembed.org</a>>
wrote: <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> Does ESP-12E support JTAG debugging? It might be
interesting to figure <br>
> out what the crash is about (maybe there isn't actually a
task scheduler <br>
> present and if you don't "yield" back you've violated the
API <br>
> contract?). But you've stuck with the pragmatic approach,
John. Thanks <br>
> for the tip.<br>
> <br>
> Getting SparkFun "Micromod" boards with ESP32 and
ESP8266 (no idea what <br>
> flavors) and the "All the Pins" carrier board today. But
these go on the <br>
> shelf as I wait for the RP2040 Micromod board, and my
stack is pushed <br>
> anyway. Particle Land, here I come. :-)<br>
> <br>
> -Pete<br>
> <br>
> On 1/26/21 10:03 AM, John Vaughters via TriEmbed wrote:<br>
>> In my playing around with the ESP-12e's that I have,
I found something that may save someone some time. Using the
Ticker library to schedule a task, I quickly found out that
the task better be quick or it will crash the program. To
define quick, my task was maybe 25ms, which was enough to
crash the program. To get around this I found on the web a
quick tip that made alot of sense. Just use the Ticker task to
flip a bool and then have an if statement run the task and
reset the bool.<br>
>><br>
>> It's not what I consider a great programming
technique, but I consider it a valid workaround on the
limitation. And it still beats running the task on every loop
cycle.<br>
>><br>
>> I am certainly open to other suggestions, but it
works quite well and I will be sticking with it for now.<br>
>><br>
>> John Vaughters<br>
> <br>
>><br>
>> _______________________________________________<br>
>> Triangle, NC Embedded Computing mailing list<br>
>><br>
>> To post message: <a
href="mailto:TriEmbed@triembed.org" target="_blank"
moz-do-not-send="true">TriEmbed@triembed.org</a><br>
>> List info: <a
href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br>
>> TriEmbed web site: <a href="http://TriEmbed.org"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://TriEmbed.org</a><br>
>> To unsubscribe, click link and send a blank message:
mailto:<a href="mailto:unsubscribe-TriEmbed@bitser.net"
target="_blank" moz-do-not-send="true">unsubscribe-TriEmbed@bitser.net</a>?subject=unsubscribe<br>
>><br>
> <br>
> _______________________________________________<br>
> Triangle, NC Embedded Computing mailing list<br>
> <br>
> To post message: <a href="mailto:TriEmbed@triembed.org"
target="_blank" moz-do-not-send="true">TriEmbed@triembed.org</a><br>
> List info: <a
href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br>
> TriEmbed web site: <a href="http://TriEmbed.org"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://TriEmbed.org</a><br>
> To unsubscribe, click link and send a blank message:
mailto:<a href="mailto:unsubscribe-TriEmbed@bitser.net"
target="_blank" moz-do-not-send="true">unsubscribe-TriEmbed@bitser.net</a>?subject=unsubscribe<br>
> <br>
> <br>
> <br>
> _______________________________________________<br>
> Triangle, NC Embedded Computing mailing list<br>
> <br>
> To post message: <a href="mailto:TriEmbed@triembed.org"
target="_blank" moz-do-not-send="true">TriEmbed@triembed.org</a><br>
> List info: <a
href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br>
> TriEmbed web site: <a href="http://TriEmbed.org"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://TriEmbed.org</a><br>
> To unsubscribe, click link and send a blank message:
mailto:<a href="mailto:unsubscribe-TriEmbed@bitser.net"
target="_blank" moz-do-not-send="true">unsubscribe-TriEmbed@bitser.net</a>?subject=unsubscribe<br>
> <br>
> <br>
<br>
<br>
-- <br>
-------------------------------------------------------------------------------<br>
Carl J. Nobile (Software Engineer)<br>
<a href="mailto:carl.nobile@gmail.com" target="_blank"
moz-do-not-send="true">carl.nobile@gmail.com</a><br>
-------------------------------------------------------------------------------<br>
<br>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="gmail_signature">-------------------------------------------------------------------------------<br>
Carl J. Nobile (Software Engineer)<br>
<a href="mailto:carl.nobile@gmail.com" target="_blank"
moz-do-not-send="true">carl.nobile@gmail.com</a><br>
-------------------------------------------------------------------------------</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Triangle, NC Embedded Computing mailing list
To post message: <a class="moz-txt-link-abbreviated" href="mailto:TriEmbed@triembed.org">TriEmbed@triembed.org</a>
List info: <a class="moz-txt-link-freetext" href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a>
TriEmbed web site: <a class="moz-txt-link-freetext" href="http://TriEmbed.org">http://TriEmbed.org</a>
To unsubscribe, click link and send a blank message: <a class="moz-txt-link-freetext" href="mailto:unsubscribe-TriEmbed@bitser.net?subject=unsubscribe">mailto:unsubscribe-TriEmbed@bitser.net?subject=unsubscribe</a>
</pre>
</blockquote>
<p><br>
</p>
<pre class="moz-signature" cols="80">--
Scott G. Hall
Raleigh, NC, USA
<a class="moz-txt-link-abbreviated" href="mailto:ScottGHall1@GMail.Com">ScottGHall1@GMail.Com</a>
_Although kindness is rarely a job, no matter what you do it's always an option._
</pre>
</body>
</html>