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

Thread: FreqMeasureMulti not working with Teensy 4.0

  1. #1
    Junior Member
    Join Date
    Oct 2019
    Posts
    1

    FreqMeasureMulti not working with Teensy 4.0

    Hi All,

    Trying to use the FreqMeasureMulti example from the Teensy 4.0 examples in the Arduino IDE but I keep getting errors when compiling.

    Can anyone help with this?

    Thanks



    "Build options changed, rebuilding all
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp: In member function 'bool FreqMeasureMulti::begin(uint32_t, uint8_t)':

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp:48:59: error: 'PORT_PCR_MUX' was not declared in this scope

    case 22: channel = 0; CORE_PIN22_CONFIG = PORT_PCR_MUX(4); break;

    ^

    In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/core_pins.h:32:0,

    from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/wiring.h:38,

    from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/WProgram.h:45,

    from C:\Users\pgl23\AppData\Local\Temp\arduino_build_71 2706/pch/Arduino.h:6,

    from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.h:4,

    from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp:27:

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp:77:19: error: 'IRQ_FTM0' was not declared in this scope

    NVIC_DISABLE_IRQ(IRQ_FTM0);

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/imxrt.h:8297:52: note: in definition of macro 'NVIC_DISABLE_IRQ'

    #define NVIC_DISABLE_IRQ(n) (*(&NVIC_ICER0 + ((n) >> 5)) = (1 << ((n) & 31)))

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp:78:6: error: 'FTM0_MOD' was not declared in this scope

    if (FTM0_MOD != 0xFFFF || (FTM0_SC & 0x7F) != FTM_SC_VALUE) {

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp:78:29: error: 'FTM0_SC' was not declared in this scope

    if (FTM0_MOD != 0xFFFF || (FTM0_SC & 0x7F) != FTM_SC_VALUE) {

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp:29:23: error: 'FTM_SC_TOIE' was not declared in this scope

    #define FTM_SC_VALUE (FTM_SC_TOIE | FTM_SC_CLKS(1) | FTM_SC_PS(0))

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp:78:48: note: in expansion of macro 'FTM_SC_VALUE'

    if (FTM0_MOD != 0xFFFF || (FTM0_SC & 0x7F) != FTM_SC_VALUE) {

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp:29:50: error: 'FTM_SC_CLKS' was not declared in this scope

    #define FTM_SC_VALUE (FTM_SC_TOIE | FTM_SC_CLKS(1) | FTM_SC_PS(0))

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp:78:48: note: in expansion of macro 'FTM_SC_VALUE'

    if (FTM0_MOD != 0xFFFF || (FTM0_SC & 0x7F) != FTM_SC_VALUE) {

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp:29:65: error: 'FTM_SC_PS' was not declared in this scope

    #define FTM_SC_VALUE (FTM_SC_TOIE | FTM_SC_CLKS(1) | FTM_SC_PS(0))

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp:78:48: note: in expansion of macro 'FTM_SC_VALUE'

    if (FTM0_MOD != 0xFFFF || (FTM0_SC & 0x7F) != FTM_SC_VALUE) {

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp:80:3: error: 'FTM0_CNT' was not declared in this scope

    FTM0_CNT = 0;

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp:95:28: error: 'FTM0_C0SC' was not declared in this scope

    volatile uint32_t *csc = &FTM0_C0SC + channel * 2;

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp:30:26: error: 'FTM_CSC_CHIE' was not declared in this scope

    #define FTM_CSC_RAISING (FTM_CSC_CHIE | FTM_CSC_ELSA)

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp:100:9: note: in expansion of macro 'FTM_CSC_RAISING'

    *csc = FTM_CSC_RAISING; // first capture is always rising

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp:30:41: error: 'FTM_CSC_ELSA' was not declared in this scope

    #define FTM_CSC_RAISING (FTM_CSC_CHIE | FTM_CSC_ELSA)

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp:100:9: note: in expansion of macro 'FTM_CSC_RAISING'

    *csc = FTM_CSC_RAISING; // first capture is always rising

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp: In member function 'void FreqMeasureMulti::end()':

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp:173:28: error: 'FTM0_C0SC' was not declared in this scope

    volatile uint32_t *csc = &FTM0_C0SC + channel * 2;

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp: In function 'void ftm0_isr()':

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp:180:6: error: 'FTM0_SC' was not declared in this scope

    if (FTM0_SC & FTM_SC_TOF) {

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp:180:16: error: 'FTM_SC_TOF' was not declared in this scope

    if (FTM0_SC & FTM_SC_TOF) {

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp:189:17: error: 'FTM0_STATUS' was not declared in this scope

    uint8_t mask = FTM0_STATUS & channelmask;

    ^

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp: In member function 'void FreqMeasureMulti::isr(bool)':

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FreqMe asureMulti\FreqMeasureMulti.cpp:206:28: error: 'FTM0_C0SC' was not declared in this scope

    volatile uint32_t *csc = &FTM0_C0SC + channel * 2;

    ^

    Error compiling for board Teensy 4.0.
    "

  2. #2
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,236
    As noted in https://forum.pjrc.com/threads/54711...irst-Beta-Test, FreqMeasureMulti has NOT been ported to Teensy 4.

Posting Permissions

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