Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Frequency count Teensy 4

  1. #1
    Member
    Join Date
    May 2017
    Location
    Netherlands
    Posts
    92

    Frequency count Teensy 4

    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.

    Click image for larger version. 

Name:	td_libs_FreqCount_sch.gif 
Views:	2 
Size:	2.7 KB 
ID:	17623

    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);

    }

  2. #2
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,231
    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 by manitou; 09-18-2019 at 07:23 PM.

  3. #3
    Member
    Join Date
    May 2017
    Location
    Netherlands
    Posts
    92
    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);
    }
    }

  4. #4
    Member
    Join Date
    May 2017
    Location
    Netherlands
    Posts
    92
    @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

Posting Permissions

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