Forum Rule: Always post complete source code & details to reproduce any issue!
Page 3 of 3 FirstFirst 1 2 3
Results 51 to 59 of 59

Thread: Teensyduino 1.56 Beta #2

  1. #51
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    7,677
    I have only tested with the adafruit one mentioned above. So if you have a real function generator it would be good to test with. Will get it set up anyway on my end and let me know

  2. #52
    Turns out my function generator only goes up to 3.1 MHz. Everything looks good, though. Tested from 1 Hz to 3.1 MHz.
    Last edited by joepasquariello; 11-04-2021 at 08:22 PM.

  3. #53
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    7,677
    Quote Originally Posted by joepasquariello View Post
    Turns out my function generator only goes up to 3.1 MHz. Everything looks good, though. Tested from 1 Hz to 3.1 MHz.
    Sorry just saw this update now. Just issued the PR: https://github.com/PaulStoffregen/FreqCount/pull/16 to the library.

  4. #54
    Just a note that I did my testing without the addition of "count = 0" in read(). As long as read() is not called without first checking available(), there is no issue. However, if read() is called without calling first checking available(), having count = 0 in read() will result in some calls returning 0, and other calls returning a real measurement, which sounds like what you were seeing in your tests. If read() does not set count = 0, calls to read() will always return the last actual measurement, and that seems more logical to me.

  5. #55
    Junior Member
    Join Date
    May 2020
    Location
    South East England
    Posts
    14
    Hi,
    First, sorry for not replying to those who have kindly looked into the FreqCount() problem; things have been a bit hectic.


    I downloaded the library that mjs513 posted and it solves the problem. I now have a functioning frequency meter on a T4.1 that runs up to c.72MHz with gate periods of between 1uSec and 1 Sec.


    I notice that FreqCount.end() no longer compiles and gives an error message <undefined reference to <FreqCountClass::end()>. I recollect that with previous versions of the library .end was simply ignored and appeared to generate no code.


    It would be very convenient if FreqCount.end() terminated the current measuring cycle and cleared any buffered results thus allowing a new FreqCount.begin(n) to start promptly. Currently I'm having to mark time for (3 * GatePeriod) after changing the period before I can be certain a new value is valid.


    Thanks for the help.
    RichardL

  6. #56
    Quote Originally Posted by RichardL View Post
    I notice that FreqCount.end() no longer compiles and gives an error message <undefined reference to <FreqCountClass::end()>.

    Currently I'm having to mark time for (3 * GatePeriod) after changing the period before I can be certain a new value is valid.
    I see in the library source code that end() is not implemented for T4.x, but I'm sure it could be, because there is a timer_shutdown() function for the IntervalTimer. Until that happens, I think this would be a work-around that would be close to the minimum time required to change gate periods.

    - call begin( new_gate_period )
    - call read() once to clear data_ready (and ignore the return value)
    - in your loop, call available()
    - when available() returns true, call read() to get count for new_gate_period

  7. #57
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    7,677
    Quote Originally Posted by RichardL View Post
    Hi,
    First, sorry for not replying to those who have kindly looked into the FreqCount() problem; things have been a bit hectic.


    I downloaded the library that mjs513 posted and it solves the problem. I now have a functioning frequency meter on a T4.1 that runs up to c.72MHz with gate periods of between 1uSec and 1 Sec.


    I notice that FreqCount.end() no longer compiles and gives an error message <undefined reference to <FreqCountClass::end()>. I recollect that with previous versions of the library .end was simply ignored and appeared to generate no code.


    It would be very convenient if FreqCount.end() terminated the current measuring cycle and cleared any buffered results thus allowing a new FreqCount.begin(n) to start promptly. Currently I'm having to mark time for (3 * GatePeriod) after changing the period before I can be certain a new value is valid.


    Thanks for the help.
    RichardL
    @joepasquariello

    Actually it is part of this PR which updates the library: https://github.com/PaulStoffregen/FreqCount/pull/16

    The posted zip file does not have that change in it since it was based on the existing library.

  8. #58
    @mjs513, thanks, and I see that Paul just committed the changes, including the missing end() function.

    @RichardL, you can get the update here.

    https://github.com/PaulStoffregen/FreqCount

  9. #59
    Junior Member
    Join Date
    Jun 2020
    Posts
    17
    Tested 1.56 beta.
    In a VMWare 16.2 virtual machine running Windows 10 home. Arduino 1.8.16
    Compiled without a hitch our largest, most complicated sketch.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •