Forum Rule: Always post complete source code & details to reproduce any issue!
Page 152 of 152 FirstFirst ... 52 102 142 150 151 152
Results 3,776 to 3,787 of 3787

Thread: Teensy 4.0 First Beta Test

  1. #3776
    Senior Member Wozzy's Avatar
    Join Date
    Jan 2013
    Location
    Philadelphia, Pennsylvania USA
    Posts
    348

    FreqMeasureMulti Fails to compile

    I was able to successfully compile the serial.ino FreqMeasure example, but failed to compile the FreqMeasureMulti serial.ino example for Teensy 4-Beta2.
    The Arduino IDE returned the following errors:
    Code:
    Error compiling for board Teensy 4-BETA2
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\FreqMeasureMulti.cpp: In member function 'bool FreqMeasureMulti::begin(uint32_t, uint8_t)':
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\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:\Arduino189_T147B4\hardware\teensy\avr\cores\teensy4/core_pins.h:32:0,
                     from C:\Arduino189_T147B4\hardware\teensy\avr\cores\teensy4/wiring.h:38,
                     from C:\Arduino189_T147B4\hardware\teensy\avr\cores\teensy4/WProgram.h:45,
                     from C:\Users\Rober\AppData\Local\Temp\arduino_build_67275/pch/Arduino.h:6,
                     from C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\FreqMeasureMulti.h:4,
                     from C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\FreqMeasureMulti.cpp:27:
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\FreqMeasureMulti.cpp:77:19: error: 'IRQ_FTM0' was not declared in this scope
      NVIC_DISABLE_IRQ(IRQ_FTM0);
                       ^
    C:\Arduino189_T147B4\hardware\teensy\avr\cores\teensy4/imxrt.h:8293:52: note: in definition of macro 'NVIC_DISABLE_IRQ'
     #define NVIC_DISABLE_IRQ(n)     (*(&NVIC_ICER0 + ((n) >> 5)) = (1 << ((n) & 31)))
                                                        ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\FreqMeasureMulti.cpp:78:6: error: 'FTM0_MOD' was not declared in this scope
      if (FTM0_MOD != 0xFFFF || (FTM0_SC & 0x7F) != FTM_SC_VALUE) {
          ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\FreqMeasureMulti.cpp:78:29: error: 'FTM0_SC' was not declared in this scope
      if (FTM0_MOD != 0xFFFF || (FTM0_SC & 0x7F) != FTM_SC_VALUE) {
                                 ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\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:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\FreqMeasureMulti.cpp:78:48: note: in expansion of macro 'FTM_SC_VALUE'
      if (FTM0_MOD != 0xFFFF || (FTM0_SC & 0x7F) != FTM_SC_VALUE) {
                                                    ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\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:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\FreqMeasureMulti.cpp:78:48: note: in expansion of macro 'FTM_SC_VALUE'
      if (FTM0_MOD != 0xFFFF || (FTM0_SC & 0x7F) != FTM_SC_VALUE) {
                                                    ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\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:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\FreqMeasureMulti.cpp:78:48: note: in expansion of macro 'FTM_SC_VALUE'
      if (FTM0_MOD != 0xFFFF || (FTM0_SC & 0x7F) != FTM_SC_VALUE) {                                                ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\FreqMeasureMulti.cpp:80:3: error: 'FTM0_CNT' was not declared in this scope
       FTM0_CNT = 0;
       ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\FreqMeasureMulti.cpp:95:28: error: 'FTM0_C0SC' was not declared in this scope
      volatile uint32_t *csc = &FTM0_C0SC + channel * 2;
                                ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\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:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\FreqMeasureMulti.cpp:100:9: note: in expansion of macro 'FTM_CSC_RAISING'
      *csc = FTM_CSC_RAISING; // first capture is always rising
             ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\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:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\FreqMeasureMulti.cpp:100:9: note: in expansion of macro 'FTM_CSC_RAISING'
      *csc = FTM_CSC_RAISING; // first capture is always rising
             ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\FreqMeasureMulti.cpp: In member function 'void FreqMeasureMulti::end()':
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\FreqMeasureMulti.cpp:173:28: error: 'FTM0_C0SC' was not declared in this scope
      volatile uint32_t *csc = &FTM0_C0SC + channel * 2;
                               ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\FreqMeasureMulti.cpp: In function 'void ftm0_isr()':
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\FreqMeasureMulti.cpp:180:6: error: 'FTM0_SC' was not declared in this scope
      if (FTM0_SC & FTM_SC_TOF) {
          ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\FreqMeasureMulti.cpp:180:16: error: 'FTM_SC_TOF' was not declared in this scope
      if (FTM0_SC & FTM_SC_TOF) {
                    ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\FreqMeasureMulti.cpp:189:17: error: 'FTM0_STATUS' was not declared in this scope
      uint8_t mask = FTM0_STATUS & channelmask;
                     ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\FreqMeasureMulti.cpp: In member function 'void FreqMeasureMulti::isr(bool)':
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqMeasureMulti\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-Beta2.
    I noticed that Paul had made modifications to FreqMeasure in January.
    Also FreqCount and FreqTimer2 Failed... I'll list the errors separately below.
    Let me know if this is not appropriate.
    Last edited by Wozzy; Today at 08:05 PM. Reason: clarify formatting

  2. #3777
    Senior Member Wozzy's Avatar
    Join Date
    Jan 2013
    Location
    Philadelphia, Pennsylvania USA
    Posts
    348

    FreqCount Fails to compile.

    Below are the errors returned by the Arduino IDE when compiling the FreqCount serial_output.ino example for Teensy 4-Beta2:
    Code:
    Error compiling for board Teensy 4-BETA2
    In file included from C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqCount\FreqCount.cpp:27:0:
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqCount\util/FreqCountTimers.h:64:4: error: #error "Unknown chip, please edit me with timer+counter definitions"
       #error "Unknown chip, please edit me with timer+counter definitions"
        ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqCount\FreqCount.cpp: In static member function 'static void FreqCountClass::begin(uint16_t)':
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqCount\FreqCount.cpp:44:15: error: 'counter_init' was not declared in this scope
      counter_init();
                   ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqCount\FreqCount.cpp:45:31: error: 'timer_init' was not declared in this scope
      gate_length = timer_init(msec);
                                   ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqCount\FreqCount.cpp:46:19: error: 'SREG' was not declared in this scope
      uint8_t status = SREG;
                       ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqCount\FreqCount.cpp:48:14: error: 'timer_start' was not declared in this scope
      timer_start();
                  ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqCount\FreqCount.cpp:50:16: error: 'counter_start' was not declared in this scope
      counter_start();
                    ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqCount\FreqCount.cpp: In static member function 'static uint32_t FreqCountClass::read()':
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqCount\FreqCount.cpp:64:11: error: 'SREG' was not declared in this scope
      status = SREG;
               ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqCount\FreqCount.cpp: In static member function 'static void FreqCountClass::end()':
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqCount\FreqCount.cpp:79:17: error: 'timer_shutdown' was not declared in this scope
      timer_shutdown();
                     ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqCount\FreqCount.cpp:80:19: error: 'counter_shutdown' was not declared in this scope
      counter_shutdown();
                       ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqCount\FreqCount.cpp: At global scope:
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FreqCount\FreqCount.cpp:84:4: error: expected constructor, destructor, or type conversion before '(' token
     ISR(TIMER_ISR_VECTOR)
        ^
    Error compiling for board Teensy 4-Beta2.
    Last edited by Wozzy; Today at 08:06 PM.

  3. #3778
    Senior Member Wozzy's Avatar
    Join Date
    Jan 2013
    Location
    Philadelphia, Pennsylvania USA
    Posts
    348

    FrequencyTimer2 fails to compile

    Below are the errors returned by the Arduino IDE when compiling the FrequencyTimer2 test.ino sketch example for Teensy 4-Beta2:
    Code:
    Error compiling for board Teensy 4-BETA2
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp: In static member function 'static void FrequencyTimer2::setPeriod(long unsigned int)':
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:190:13: error: 'F_BUS' was not declared in this scope
      period *= (F_BUS / 1000000);
                 ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:301:2: error: 'SIM_SCGC4' was not declared in this scope
      SIM_SCGC4 |= SIM_SCGC4_CMT;
      ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:301:15: error: 'SIM_SCGC4_CMT' was not declared in this scope
      SIM_SCGC4 |= SIM_SCGC4_CMT;
                   ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:302:2: error: 'CMT_MSC' was not declared in this scope
      CMT_MSC = 0;
      ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:303:2: error: 'CMT_PPS' was not declared in this scope
      CMT_PPS = bdiv;
      ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:304:2: error: 'CMT_CMD1' was not declared in this scope
      CMT_CMD1 = ((period - 1) >> 8) & 255;
      ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:305:2: error: 'CMT_CMD2' was not declared in this scope
      CMT_CMD2 = (period - 1) & 255;
      ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:306:2: error: 'CMT_CMD3' was not declared in this scope
      CMT_CMD3 = (period >> 8) & 255;
      ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:307:2: error: 'CMT_CMD4' was not declared in this scope
      CMT_CMD4 = period & 255;
      ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:308:2: error: 'CMT_OC' was not declared in this scope
      CMT_OC = 0x60;
      ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp: In static member function 'static long unsigned int FrequencyTimer2::getPeriod()':
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:316:12: error: 'CMT_CMD3' was not declared in this scope
      period = (CMT_CMD3 << 8) | CMT_CMD4;
                ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:316:29: error: 'CMT_CMD4' was not declared in this scope
      period = (CMT_CMD3 << 8) | CMT_CMD4;
                                 ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:317:13: error: 'CMT_PPS' was not declared in this scope
      period *= (CMT_PPS + 1);
                 ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:318:15: error: 'CMT_MSC' was not declared in this scope
      period <<= ((CMT_MSC >> 5) & 3) + 4;
                   ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:319:13: error: 'F_BUS' was not declared in this scope
      period /= (F_BUS / 1000000);
                 ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp: In static member function 'static void FrequencyTimer2::enable()':
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:326:35: error: 'PORT_PCR_MUX' was not declared in this scope
      CORE_PIN5_CONFIG = PORT_PCR_MUX(2)|PORT_PCR_DSE|PORT_PCR_SRE;
                                       ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:326:37: error: 'PORT_PCR_DSE' was not declared in this scope
      CORE_PIN5_CONFIG = PORT_PCR_MUX(2)|PORT_PCR_DSE|PORT_PCR_SRE;
                                         ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:326:50: error: 'PORT_PCR_SRE' was not declared in this scope
      CORE_PIN5_CONFIG = PORT_PCR_MUX(2)|PORT_PCR_DSE|PORT_PCR_SRE;
                                                      ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp: In static member function 'static void FrequencyTimer2::disable()':
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:332:35: error: 'PORT_PCR_MUX' was not declared in this scope
      CORE_PIN5_CONFIG = PORT_PCR_MUX(1)|PORT_PCR_DSE|PORT_PCR_SRE;
                                       ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:332:37: error: 'PORT_PCR_DSE' was not declared in this scope
      CORE_PIN5_CONFIG = PORT_PCR_MUX(1)|PORT_PCR_DSE|PORT_PCR_SRE;
                                         ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:332:50: error: 'PORT_PCR_SRE' was not declared in this scope
      CORE_PIN5_CONFIG = PORT_PCR_MUX(1)|PORT_PCR_DSE|PORT_PCR_SRE;
                                                      ^
    In file included from C:\Arduino189_T147B4\hardware\teensy\avr\cores\teensy4/core_pins.h:32:0,
                     from C:\Arduino189_T147B4\hardware\teensy\avr\cores\teensy4/wiring.h:38,
                     from C:\Arduino189_T147B4\hardware\teensy\avr\cores\teensy4/WProgram.h:45,
                     from C:\Users\Rober\AppData\Local\Temp\arduino_build_13904/pch/Arduino.h:6,
                     from C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2/FrequencyTimer2.h:27,
                     from C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:30:
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp: In static member function 'static void FrequencyTimer2::setOnOverflow(void (*)())':
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:340:19: error: 'IRQ_CMT' was not declared in this scope
       NVIC_ENABLE_IRQ(IRQ_CMT);
                       ^
    C:\Arduino189_T147B4\hardware\teensy\avr\cores\teensy4/imxrt.h:8292:52: note: in definition of macro 'NVIC_ENABLE_IRQ'
     #define NVIC_ENABLE_IRQ(n)      (*(&NVIC_ISER0 + ((n) >> 5)) = (1 << ((n) & 31)))
                                                        ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:342:20: error: 'IRQ_CMT' was not declared in this scope
       NVIC_DISABLE_IRQ(IRQ_CMT);
                        ^
    C:\Arduino189_T147B4\hardware\teensy\avr\cores\teensy4/imxrt.h:8293:52: note: in definition of macro 'NVIC_DISABLE_IRQ'
     #define NVIC_DISABLE_IRQ(n)     (*(&NVIC_ICER0 + ((n) >> 5)) = (1 << ((n) & 31)))
                                                        ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp: In function 'void cmt_isr()':
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:351:40: error: 'CMT_MSC' was not declared in this scope
      uint8_t __attribute__((unused)) tmp = CMT_MSC;
                                            ^
    C:\Arduino189_T147B4\hardware\teensy\avr\libraries\FrequencyTimer2\FrequencyTimer2.cpp:352:8: error: 'CMT_CMD2' was not declared in this scope
      tmp = CMT_CMD2;
            ^
    Error compiling for board Teensy 4-Beta2.

  4. #3779
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,662
    @Kurt,

    I'm having problem, getting updateScreenAsync(true) to work, with your ILI9341_t3n library. Is the "master" branch the right one?
    Does it work, or am I doing something wrong? It's not the cache - it just don't work for me (no continous screen-update)
    Can you please post a short example?

    Thank you, Frank.

  5. #3780
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,509
    Quote Originally Posted by manitou View Post
    One possible use of GPT1 is for FreqCount (pin 25 is the external trigger). Here is a proof-of-concept (32-bit counter)
    https://github.com/manitou48/teensy4.../gpt_count.ino
    Jumper PWM pin 11 to 25 for testing.

    GPTn can also do PWM, but NONE of the GPTn output pins are available on T4 (1050).
    Hi @manitou

    Just getting around to play with this now again. Was trying to get it to work on GPT2 using your code as the base - GPT2_clk is on pin 14 as alt8 - unless my eyes are getting crossed it that is right then should be easy enough to convert your sketch - but all I get is 0 as outputs - what am I missing here:
    Code:
    // GPT1 counter like FreqCount
    // external pin is 14 GPIO_AD_B1_02 ALT8  (Frontside - A0)
    // test with  PWM pin 11 jumpered to 14
    
    // FreqCount API
    static inline void counter_init(void)
    {
      CCM_CCGR0 |= CCM_CCGR0_GPT2_BUS(CCM_CCGR_ON) ;  // enable GPT1 module
      //CCM_CCGR0 |= CCM_CCGR0_GPT2_SERIAL(CCM_CCGR_ON) ;
      GPT2_CR = 0;
      GPT2_SR = 0x3F; // clear all prior status
      GPT2_CR =  GPT_CR_CLKSRC(3);// | GPT_CR_FRR ;// 3 external clock
      //*(portConfigRegister(14)) = 8;  // ALT 1
      //CORE_PIN14_CONFIG = 8; 
      IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B1_02 = 8;
    }
    
    static inline void counter_start(void)
    {
      GPT2_CR |= GPT_CR_EN; // enable
    }
    
    static inline void counter_shutdown(void)
    {
      GPT2_CR = 0;
    }
    
    static inline uint32_t counter_read(void)  // was uint16_t in FreqCount?
    {
      return GPT2_CNT;
    }
    
    static inline uint8_t counter_overflow(void)
    {
      return GPT2_SR & GPT_SR_ROV;
    }
    
    static inline void counter_overflow_reset(void)
    {
      GPT2_SR |= GPT_SR_ROV;
    }
    
    volatile uint32_t count_ready, count_output, count_prev;
    void tmr_callback() {
      uint32_t count = counter_read();
    
      //track rollover ?
      count_output = count - count_prev;
      count_prev = count;
      count_ready = 1;
    }
    
    IntervalTimer it1;
    
    void setup() {
      Serial.begin(9600);
      while (!Serial);
      delay(2000);
      analogWriteFrequency(11, 1234);  // test jumper 11 to 25
      analogWrite(11, 128);
    
      counter_init();
      it1.begin(tmr_callback, 1000000);  // us
      counter_start();
    
    }
    
    void loop() {
      if (count_ready) {
        Serial.println(count_output);
        count_ready = 0;
      }
    }

  6. #3781
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,005
    Quote Originally Posted by mjs513 View Post
    Hi @manitou

    Just getting around to play with this now again. Was trying to get it to work on GPT2 using your code as the base - GPT2_clk is on pin 14 as alt8 - unless my eyes are getting crossed it that is right then should be easy enough to convert your sketch - but all I get is 0 as outputs - what am I missing here:
    I never tried it on 1062 cause my breakout board doesn't have pogo pin on pin 25. It should work with pin 25 just like it does with 1050.

    i've not tried GPT2 -- GPT2 CLK pin is not listed in table in post #3? can you pogo pin 25 and try GPT1

    EDIT: i think more pin magic is required, since the ALT8 config is the 2nd choice. there is another config command ... looking ....

    you need to set low bit in IOMUXC_GPT2_IPP_IND_CLKIN_SELECT_INPUT (ref pg 1000)

  7. #3782
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    4,902
    Quote Originally Posted by Frank B View Post
    @Kurt,

    I'm having problem, getting updateScreenAsync(true) to work, with your ILI9341_t3n library. Is the "master" branch the right one?
    Does it work, or am I doing something wrong? It's not the cache - it just don't work for me (no continous screen-update)
    Can you please post a short example?

    Thank you, Frank.
    I will take a look, but I am away from desk, so might be in a while.

  8. #3783
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,509
    Quote Originally Posted by manitou View Post
    I never tried it on 1062 cause my breakout board doesn't have pogo pin on pin 25. It should work with pin 25 just like it does with 1050.

    i've not tried GPT2 -- GPT2 CLK pin is not listed in table in post #3? can you pogo pin 25 and try GPT1
    @manitou - yep it does work on pin 25 gave it a try first - Sermon shows 1234, which is what you set up for analogWriteFreq

    I was curious so I took a look at the 1060 manual and saw what AD_B1_02 shows GPT2_CLK as alt8. So decided to give it a try since it is an edge pin. See page 490 of the RM. EDIT: also page 304

  9. #3784
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,509
    Quote Originally Posted by KurtE View Post
    I will take a look, but I am away from desk, so might be in a while.
    Not sure but you may want t4-beta branch? https://github.com/KurtE/ILI9341_t3/tree/T4_Beta

  10. #3785
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,005
    Quote Originally Posted by mjs513 View Post
    @manitou - yep it does work on pin 25 gave it a try first - Sermon shows 1234, which is what you set up for analogWriteFreq

    I was curious so I took a look at the 1060 manual and saw what AD_B1_02 shows GPT2_CLK as alt8. So decided to give it a try since it is an edge pin. See page 490 of the RM. EDIT: also page 304
    i edited my previous post ....you need to set low bit in IOMUXC_GPT2_IPP_IND_CLKIN_SELECT_INPUT (ref pg 1000)

  11. #3786
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,509
    Quote Originally Posted by manitou View Post
    i edited my previous post ....you need to set low bit in IOMUXC_GPT2_IPP_IND_CLKIN_SELECT_INPUT (ref pg 1000)
    Yep - that got it. Now showing 1234
    Should have know because I had to do that when playing with FLEXCAN. Argh.

  12. #3787
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,005
    Quote Originally Posted by mjs513 View Post
    Yep - that got it. Now showing 1234
    Should have know because I had to do that when playing with FLEXCAN. Argh.
    Right. it is such an intuitive architecture

Posting Permissions

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