<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi Mark,<br>
    <br>
    Changed all three to 10mhz.  I only have stuff hung off CAN3 right
    now, but the change to 10mhz seems to work.  Wireshark shows that
    the inter-frame time for the back-to-back messages reduced from
    somewhere around 800 us to about 550us.  Certainly helps!<br>
    <br>
    Surprisingly, the variability between runs is a lot less than
    before.  No idea why.<br>
    <br>
    I'll let it run this way over night, with obd2ecu talking to OBDWiz,
    and report if any issues become apparent.<br>
    <br>
    Greg<br>
    <br>
    <br>
    <div class="moz-cite-prefix">Mark Webb-Johnson wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:A0014AA5-8456-45FB-AB20-957277A8F9CF@webb-johnson.net">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <div class=""><br class="">
      </div>
      No specific reason for the clock speed to be 1MHz. I know that I
      have changed it multiple times during development of the initial
      module, and often run it very low (as it is easier to get complete
      logic analyser captures, and store more capture data, at lower
      clock speeds). I suspect the 1MHz choice was a compromise between
      performance and being able to store more than a couple of seconds
      of logic analyser capture.
      <div class=""><br class="">
      </div>
      <div class="">I think our circuit should be able to cope with
        10MHz. MAX7317 is good for up to 26MHz. MCP2515 should be ok up
        to 10MHz. Espressif documentation says:</div>
      <div class=""><br class="">
      </div>
      <blockquote style="margin: 0 0 0 40px; border: none; padding:
        0px;" class="">
        <div class=""><i class="">While in general, speeds up to 80MHz
            on the dedicated SPI pins and 40MHz on GPIO-matrix-routed
            pins are supported, full-duplex transfers routed over the
            GPIO matrix only support speeds up to 26MHz.</i></div>
      </blockquote>
      <div class="">
        <div><br class="">
        </div>
        <div>Clock should be fine at 10MHz.</div>
        <div><br class="">
        </div>
        <div>Can you try it (simple fix in ovms_peripherals.cpp lines
          118 and 120)?</div>
        <div><br class="">
        </div>
        <div>MAX7317 is at line 93 and probably worth setting to the
          same speed, although I don’t think it matters much if they are
          different as control is on the CS lines anyway. That said, we
          have to drive the MISO line on MAX7317 via a tri-state on the
          CS pin, so that will be speed limited via the tri-state.</div>
        <div><br class="">
        </div>
        <div>If it works ok for you at that speed, I’ll put it on an
          oscilloscope later this week and just verify the signals still
          look clean. I did that on the original board design, and they
          seemed ok.</div>
        <div><br class="">
        </div>
        <div>Regards, Mark.</div>
        <div><br class="">
          <blockquote type="cite" class="">
            <div class="">On 17 Jan 2018, at 1:59 AM, Michael Balzer
              <<a href="mailto:dexter@expeedo.de" class=""
                moz-do-not-send="true">dexter@expeedo.de</a>> wrote:</div>
            <br class="Apple-interchange-newline">
            <div class="">
              <div class="">Greg, Mark,<br class="">
                <br class="">
                I'm having two basic issues with this:<br class="">
                <br class="">
                a) This will limit the TX speed achievable on the mcp
                interfaces. I generally hate not fully utilizing
                available hardware capabilities. And this is SPI,
                filling<br class="">
                a TX buffer is expensive.<br class="">
                <br class="">
                b) It again feels like fixing without understanding. I
                really think we should first understand how the reported
                race condition of the mcp interrupt signal<br class="">
                affects our driver design, and we should check the
                effect of level interrupts before resorting to limiting
                the speed.<br class="">
                <br class="">
                The mcp SPI interface is running at 1 MHz, so a TX will
                … wait a moment, why is it running at 1 MHz? According
                to the data sheet, it can do 10 MHz?<br class="">
                <br class="">
                Mark, is there some scaling done in the spinodma module,
                or is there a reason (other than typo / copy-paste) for
                this?<br class="">
                <br class="">
                <br class="">
                <br class="">
                Am 16.01.2018 um 09:47 schrieb Greg D.:<br class="">
                <blockquote type="cite" class="">Hi Mark,<br class="">
                  <br class="">
                  Yes, absolutely.  In fact, I just thought of a corner
                  case while nodding<br class="">
                  off to sleep (hate it when that happens!).  Fixed,
                  verified, and pushed<br class="">
                  to my branch.  Anxiously awaiting review from
                  Michael...<br class="">
                  <br class="">
                  Greg<br class="">
                  <br class="">
                  <br class="">
                  Mark Webb-Johnson wrote:<br class="">
                  <blockquote type="cite" class="">I think best for
                    @michael to review. A single tx buffer is certainly
                    easier to manage.<br class="">
                    <br class="">
                    Regards, Mark.<br class="">
                    <br class="">
                    <blockquote type="cite" class="">On 16 Jan 2018, at
                      1:59 PM, Greg D. <<a
                        href="mailto:gregd2350@gmail.com" class=""
                        moz-do-not-send="true">gregd2350@gmail.com</a>>
                      wrote:<br class="">
                      <br class="">
                      Mark Webb-Johnson wrote:<br class="">
                      <blockquote type="cite" class="">In vino veritas.<br
                          class="">
                        <br class="">
                      </blockquote>
                      Indeed!<br class="">
                      <br class="">
                      Fixes look good (can't seem to kill it).  Pushed
                      to my fork on Git Hub,<br class="">
                      along with removal of the delays in the
                      obd2ecu.cpp code.<br class="">
                      <br class="">
                      This was done on the older tool chain; wanted to
                      be sure the fix was<br class="">
                      real before upgrading and potentially hiding the
                      issue with a slight<br class="">
                      change in timing.  Will upgrade the toolchain
                      tomorrow and verify.<br class="">
                      <br class="">
                      Greg<br class="">
                      <br class="">
                      _______________________________________________<br
                        class="">
                      OvmsDev mailing list<br class="">
                      <a href="mailto:OvmsDev@lists.teslaclub.hk"
                        class="" moz-do-not-send="true">OvmsDev@lists.teslaclub.hk</a><br
                        class="">
                      <a class="moz-txt-link-freetext" href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a><br
                        class="">
                    </blockquote>
                    _______________________________________________<br
                      class="">
                    OvmsDev mailing list<br class="">
                    <a href="mailto:OvmsDev@lists.teslaclub.hk" class=""
                      moz-do-not-send="true">OvmsDev@lists.teslaclub.hk</a><br
                      class="">
                    <a class="moz-txt-link-freetext" href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a><br
                      class="">
                  </blockquote>
                  _______________________________________________<br
                    class="">
                  OvmsDev mailing list<br class="">
                  <a href="mailto:OvmsDev@lists.teslaclub.hk" class=""
                    moz-do-not-send="true">OvmsDev@lists.teslaclub.hk</a><br
                    class="">
                  <a class="moz-txt-link-freetext" href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a><br
                    class="">
                </blockquote>
                <br class="">
                -- <br class="">
                Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal<br
                  class="">
                Fon 02333 / 833 5735 * Handy 0176 / 206 989 26<br
                  class="">
                <br class="">
                <br class="">
                _______________________________________________<br
                  class="">
                OvmsDev mailing list<br class="">
                <a href="mailto:OvmsDev@lists.teslaclub.hk" class=""
                  moz-do-not-send="true">OvmsDev@lists.teslaclub.hk</a><br
                  class="">
                <a class="moz-txt-link-freetext" href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a><br
                  class="">
              </div>
            </div>
          </blockquote>
        </div>
        <br class="">
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OvmsDev@lists.teslaclub.hk">OvmsDev@lists.teslaclub.hk</a>
<a class="moz-txt-link-freetext" href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>