joonaskali
New member
Hi,
I'm trying to convert this guys sketch for teensy 4.0. He does say to read the doccumentation of the controllers for proper interrupt flags but I'm not smart enough for that.
I tried changing the interrupt flags to some other flags but I could not get it to work. How can I get this to work with teensys?
Arduino: 1.8.15 (Windows 10), TD: 1.54, Board: "Teensy 4.0, Serial, 600 MHz, Faster, US English"
Here is the compile error I am getting.
Thank you!
View attachment Stepper7_linearSpeedInterruptMultipleMotorsCoordinated.ino
I'm trying to convert this guys sketch for teensy 4.0. He does say to read the doccumentation of the controllers for proper interrupt flags but I'm not smart enough for that.
I tried changing the interrupt flags to some other flags but I could not get it to work. How can I get this to work with teensys?
Arduino: 1.8.15 (Windows 10), TD: 1.54, Board: "Teensy 4.0, Serial, 600 MHz, Faster, US English"
Here is the compile error I am getting.
Code:
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated:297: error: expected constructor, destructor, or type conversion before '(' token
ISR(TIMER1_COMPA_vect)
^
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated: In function 'void xStep()':
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated:26: error: 'PORTF' was not declared in this scope
#define X_STEP_HIGH PORTF |= 0b00000001;
^
C:\Users\Joonas\Desktop\stepperControl_iforce2d\Stepper7_linearSpeedInterruptMultipleMotorsCoordinated\Stepper7_linearSpeedInterruptMultipleMotorsCoordinated.ino:76:3: note: in expansion of macro 'X_STEP_HIGH'
X_STEP_HIGH
^
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated: In function 'void yStep()':
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated:29: error: 'PORTF' was not declared in this scope
#define Y_STEP_HIGH PORTF |= 0b01000000;
^
C:\Users\Joonas\Desktop\stepperControl_iforce2d\Stepper7_linearSpeedInterruptMultipleMotorsCoordinated\Stepper7_linearSpeedInterruptMultipleMotorsCoordinated.ino:84:3: note: in expansion of macro 'Y_STEP_HIGH'
Y_STEP_HIGH
^
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated: In function 'void zStep()':
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated:32: error: 'PORTL' was not declared in this scope
#define Z_STEP_HIGH PORTL |= 0b00001000;
^
C:\Users\Joonas\Desktop\stepperControl_iforce2d\Stepper7_linearSpeedInterruptMultipleMotorsCoordinated\Stepper7_linearSpeedInterruptMultipleMotorsCoordinated.ino:92:3: note: in expansion of macro 'Z_STEP_HIGH'
Z_STEP_HIGH
^
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated: In function 'void aStep()':
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated:35: error: 'PORTA' was not declared in this scope
#define A_STEP_HIGH PORTA |= 0b00010000;
^
C:\Users\Joonas\Desktop\stepperControl_iforce2d\Stepper7_linearSpeedInterruptMultipleMotorsCoordinated\Stepper7_linearSpeedInterruptMultipleMotorsCoordinated.ino:100:3: note: in expansion of macro 'A_STEP_HIGH'
A_STEP_HIGH
^
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated: In function 'void cStep()':
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated:41: error: 'PORTL' was not declared in this scope
#define C_STEP_HIGH PORTL |= 0b00000100;
^
C:\Users\Joonas\Desktop\stepperControl_iforce2d\Stepper7_linearSpeedInterruptMultipleMotorsCoordinated\Stepper7_linearSpeedInterruptMultipleMotorsCoordinated.ino:116:3: note: in expansion of macro 'C_STEP_HIGH'
C_STEP_HIGH
^
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated: In function 'void setup()':
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated:173: error: 'TCCR1A' was not declared in this scope
TCCR1A = 0;
^
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated:174: error: 'TCCR1B' was not declared in this scope
TCCR1B = 0;
^
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated:175: error: 'TCNT1' was not declared in this scope
TCNT1 = 0;
^
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated:177: error: 'OCR1A' was not declared in this scope
OCR1A = 1000; // compare value
^
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated:178: error: 'WGM12' was not declared in this scope
TCCR1B |= (1 << WGM12); // CTC mode
^
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated:179: error: 'CS11' was not declared in this scope
TCCR1B |= ((1 << CS11) | (1 << CS10)); // 64 prescaler
^
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated:179: error: 'CS10' was not declared in this scope
TCCR1B |= ((1 << CS11) | (1 << CS10)); // 64 prescaler
^
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated: In function 'void setNextInterruptInterval()':
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated:45: error: 'TIMSK1' was not declared in this scope
#define TIMER1_INTERRUPTS_OFF TIMSK1 &= ~(1 << OCIE1A);
^
C:\Users\Joonas\Desktop\stepperControl_iforce2d\Stepper7_linearSpeedInterruptMultipleMotorsCoordinated\Stepper7_linearSpeedInterruptMultipleMotorsCoordinated.ino:290:5: note: in expansion of macro 'TIMER1_INTERRUPTS_OFF'
TIMER1_INTERRUPTS_OFF
^
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated:45: error: 'OCIE1A' was not declared in this scope
#define TIMER1_INTERRUPTS_OFF TIMSK1 &= ~(1 << OCIE1A);
^
C:\Users\Joonas\Desktop\stepperControl_iforce2d\Stepper7_linearSpeedInterruptMultipleMotorsCoordinated\Stepper7_linearSpeedInterruptMultipleMotorsCoordinated.ino:290:5: note: in expansion of macro 'TIMER1_INTERRUPTS_OFF'
TIMER1_INTERRUPTS_OFF
^
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated:291: error: 'OCR1A' was not declared in this scope
OCR1A = 65500;
^
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated:294: error: 'OCR1A' was not declared in this scope
OCR1A = mind;
^
C:\Users\Joonas\Desktop\stepperControl_iforce2d\Stepper7_linearSpeedInterruptMultipleMotorsCoordinated\Stepper7_linearSpeedInterruptMultipleMotorsCoordinated.ino: At global scope:
Stepper7_linearSpeedInterruptMultipleMotorsCoordinated:297: error: expected constructor, destructor, or type conversion before '(' token
ISR(TIMER1_COMPA_vect)
^
expected constructor, destructor, or type conversion before '(' token
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Thank you!
View attachment Stepper7_linearSpeedInterruptMultipleMotorsCoordinated.ino