Frequency count Teensy 4

Status
Not open for further replies.

pd0lew

Well-known member
I did some tests with my Teensy 4 to count the frequency of my transceiver this work till 21MHz, above I get no readings. (0.0)
I use input 9 as input and use a small interface.

td_libs_FreqCount_sch.gif

The count looks like this count= 7001.00 but my transceiver is set on 7001.350 so I miss some digits.
What can I do ? a bit weird that I must divide by 2 to get the right value too.

Who can help me with this ....


if (FreqCount.available()) {
unsigned long count = FreqCount.read();
Serial.print("count= ");
Serial.println(count /2);

}
 
can you try the FreqCount example Serial_Output_T4 with pin 9 jumpered to pin 8. maybe change the pin 8 write frequency to 25mhz and see what it reports. if you have a T3*, can you try FreqCount on your T3*. high frequency signals need short jumpers ... (what version of Arduino IDE and Teensyduino are you using?)

the example schematic you attached (from FreqCount web page) uses 5V -- hopefully, you are using 3.3v. Teensy 4 is NOT 5v tolerant.
 
Last edited:
Used Arduino IDE 1.89 and Teensyduino 1.47

I connected in the test sketch 8 and 9 together, I adjusted the analogWriteFrequency(8, 30000000); //

The serial monitor report exactly 30000000 I think for my application ok (> 30000000 give rubbish) so I need a decent interface between Teeny input 9 is that correct ?

I used code below...



#include <FreqCount.h>

void setup() {
Serial.begin(57600);

delay(2000);
analogWriteFrequency(8, 30000000); // test jumper 11 to 25
analogWrite(8, 128);

FreqCount.begin(1000000); //Time in microseconds
}

void loop() {
if (FreqCount.available()) {
unsigned long count = FreqCount.read();
Serial.println(count);
}
}
 
@manitou

Transceiver on 14000005 gives now with a correction factor 14000006 that's very very good.

I build a correction factor for 1900= 1916, 3500 = 3530, 7000 = 7060, 14000 = 14120.

The only thing is that I can go for this moment to 18MHz but that has to do I think with the 74HC14 and the input circuit....

Thanks for helping.

Best,
Johan
 
For the Teensy 4 I saw on PRJC web page frequency input pin 22 and analog write on pin 23.
I think this is not right.... on pin 8 and 9 this working, this a pity because I need pin 9 for something else. Is there a solution ?
Best,
Johan
 
Status
Not open for further replies.
Back
Top