Teensyduino 1.56 Beta #2

Status
Not open for further replies.
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
 
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:
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.
 
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
 
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
 
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.
 
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.
 
Status
Not open for further replies.
Back
Top