Loading ...
Sorry, an error occurred while loading the content.

Si570 MC9S08QG8 running Fast

Expand Messages
  • John H. Fisher
    Today I rewrote the N1 & HS_DIV routine and it computes in 56 ms at 10 MHZ and 5.6 ms at 160 MHz. I went to long integers for this calculation. Then I used
    Message 1 of 4 , Mar 1, 2008
    • 0 Attachment
      Today I rewrote the N1 & HS_DIV routine and it computes in 56 ms at 10
      MHZ and 5.6 ms at 160 MHz. I went to long integers for this calculation.
      Then I used some logic to limit the N1 search range between N1 max and
      N1 min. Works like a charm. The lower frequencies have more possible
      combinations of N1 and HS_DIV so it takes longer to calculate. Before
      it took 500ms to do the calculation in floating point. The RFREQ
      calculation is still done in double floating point for 1 Hz accuracy up
      to 160 MHz. Still fighting RF feedback which kills me if I have the
      scope probes on the SDA and SCL lines. Other than that we are delighted
      with the new speed. Should be able to spin an encoder and update 10 to
      50 times per second depending on the frequency range. This has been a
      real learning experience :-)

      --
      Regards,
      John

      =========================================================
      email: k5jhf@...
      photos: http://www.flickr.com/photos/k5jhf/sets/
      videos: http://www.youtube.com/profile?user=k5jhf
      files: http://briefcase.yahoo.com/k5jhf@...
      web page: http://www.geocities.com/k5jhf@...
      call sign: K5JHF
      =========================================================
    • R Bishop - W0CNN
      ... Interesting work John. I timed my AVR (8-bit) code today, and the timings are always close to the same, regardless of frequency. Using 32 bit floats for
      Message 2 of 4 , Mar 2, 2008
      • 0 Attachment
        --- In softrock40@yahoogroups.com, "John H. Fisher" <k5jhf@...> wrote:
        >
        > Today I rewrote the N1 & HS_DIV routine and it computes in 56 ms
        > at 10 MHZ and 5.6 ms at 160 MHz. I went to long integers for this
        > calculation.

        Interesting work John. I timed my AVR (8-bit) code today, and the
        timings are always close to the same, regardless of frequency. Using
        32 bit floats for all calcuations, the total time to compute and set
        frequency ranges between 5.8ms and 6.7ms. This was calculated by
        doing a 1 Mhz sweep, 1KHz at a time. I'm not sure if your readings
        including setting the freq on the device as well- I'd be interested
        in hearing.

        I too am pleased with the quick calculation times- it will make
        interfacing with an encode quite a bit smoother (although not perfect-
        there will be hiccups as the encoder interrupt fires.)

        -Reid-
        W0CNN
      • anjo.gragt
        Reid I had the same problem some years ago in an encoder driven system I used an stack to log the encoder interupt with an up/down marker so the ISR became
        Message 3 of 4 , Mar 3, 2008
        • 0 Attachment
          Reid
          I had the same problem some years ago in an encoder driven system
          I used an stack to log the encoder interupt with an up/down marker
          so the ISR became very short. The main routine then evaluates the
          table. Maybe you do the same thing but in case of....
          Keep up the good work.
          73 de PA0FAN
          Anjo

          --- In softrock40@yahoogroups.com, "R Bishop - W0CNN" <rbish@...>
          wrote:
          >
          > --- In softrock40@yahoogroups.com, "John H. Fisher" <k5jhf@>
          wrote:
          > >
          > > Today I rewrote the N1 & HS_DIV routine and it computes in 56 ms
          > > at 10 MHZ and 5.6 ms at 160 MHz. I went to long integers for
          this
          > > calculation.
          >
          > Interesting work John. I timed my AVR (8-bit) code today, and the
          > timings are always close to the same, regardless of frequency.
          Using
          > 32 bit floats for all calcuations, the total time to compute and
          set
          > frequency ranges between 5.8ms and 6.7ms. This was calculated by
          > doing a 1 Mhz sweep, 1KHz at a time. I'm not sure if your
          readings
          > including setting the freq on the device as well- I'd be
          interested
          > in hearing.
          >
          > I too am pleased with the quick calculation times- it will make
          > interfacing with an encode quite a bit smoother (although not
          perfect-
          > there will be hiccups as the encoder interrupt fires.)
          >
          > -Reid-
          > W0CNN
          >
        • John H. Fisher
          Hi Reid, very nice performance from your AVR. I toggle a port bit during execution so I can measure times with a scope. So those measurements I posted are
          Message 4 of 4 , Mar 3, 2008
          • 0 Attachment
            Hi Reid, very nice performance from your AVR. I toggle a port bit during
            execution so I can measure times with a scope. So those measurements I
            posted are measured with a scope. The load time is about 1.23ms at
            400kbps. I am very impressed by your calculation speed. I suppose the
            AVR is RISC running about 20 MHz where as the Freescale is CISC with an
            8 MHz buss. I like AVR, and the only reason for trying Freescale is the
            debugger. Thanks for your input :-)

            R Bishop - W0CNN wrote:
            >
            > --- In softrock40@yahoogroups.com
            > <mailto:softrock40%40yahoogroups.com>, "John H. Fisher" <k5jhf@...> wrote:
            > >
            > > Today I rewrote the N1 & HS_DIV routine and it computes in 56 ms
            > > at 10 MHZ and 5.6 ms at 160 MHz. I went to long integers for this
            > > calculation.
            >
            > Interesting work John. I timed my AVR (8-bit) code today, and the
            > timings are always close to the same, regardless of frequency. Using
            > 32 bit floats for all calcuations, the total time to compute and set
            > frequency ranges between 5.8ms and 6.7ms. This was calculated by
            > doing a 1 Mhz sweep, 1KHz at a time. I'm not sure if your readings
            > including setting the freq on the device as well- I'd be interested
            > in hearing.
            >
            > I too am pleased with the quick calculation times- it will make
            > interfacing with an encode quite a bit smoother (although not perfect-
            > there will be hiccups as the encoder interrupt fires.)
            >
            > -Reid-
            > W0CNN
            >
            >

            --
            Regards,
            John

            =========================================================
            email: k5jhf@...
            photos: http://www.flickr.com/photos/k5jhf/sets/
            videos: http://www.youtube.com/profile?user=k5jhf
            files: http://briefcase.yahoo.com/k5jhf@...
            web page: http://www.geocities.com/k5jhf@...
            call sign: K5JHF
            =========================================================
          Your message has been successfully submitted and would be delivered to recipients shortly.