Skip to content

Introduce endstop interrupts#5184

Merged
thinkyhead merged 1 commit intoMarlinFirmware:RCBugFixfrom
AnHardt:endstop_interrupts
Nov 19, 2016
Merged

Introduce endstop interrupts#5184
thinkyhead merged 1 commit intoMarlinFirmware:RCBugFixfrom
AnHardt:endstop_interrupts

Conversation

@AnHardt
Copy link
Contributor

@AnHardt AnHardt commented Nov 8, 2016

If ENDSTOP_INTERRUPTS_FEATURE is enabled this tries to set up interrupt routines
for all used endstop pins. If this worked without errors, endstops.update() is called
only if one of the endstops changed its state.

The new interrupt routines do not really check the endstops and react upon them. All what they
do, is to set a flag if it makes sense to call the endstop test we are used to.

This can be used on:

  • ARM (DUE) based boards - all pins can raise interrupts,
  • RAMPS - all 6 endstop pins plus some other on EXT-2 can raise interrupts,
  • RAMPS based boards - as long the designers did not change the pins for the endstops or at least left enough,
  • all boards, if there are enough pins that can raise interrupts, and you are willing/able to swap with pins dedicated to other purpose.

Tested only with RAMPS 1.4

#5102

@oysteinkrog
Copy link
Contributor

I tested this on my RAMPS 1.4 last night.
For me it did not seem to work, the endstops did not trigger at all.

@AnHardt AnHardt force-pushed the endstop_interrupts branch from c1282ce to e5cc02e Compare November 9, 2016 18:40
@AnHardt
Copy link
Contributor Author

AnHardt commented Nov 9, 2016

Sorry. Mainly forgot to commit the initialization in Marlin_main.cpp.
Should work now.
Please have an other try.

@oysteinkrog
Copy link
Contributor

Same problem.

@AnHardt
Copy link
Contributor Author

AnHardt commented Nov 10, 2016

How do you compile?
How do you test?

@oysteinkrog
Copy link
Contributor

Compile using Arduino IDE 1.6.11.
Here is my config/branch: https://github.com/oysteinkrog/Marlin/commits/config_kmax
Tested using G28 X.

If ENDSTOP_INTERRUPTS_FEATURE is enabled this tries to set up interrupt routines
for all used endstop pins. If this worked without errors, `endstops.update()` is called
only if one of the endstops changed its state.

The new interrupt routines do not really check the endstops and react upon them. All what they
do, is to set a flag if it makes sense to call the endstop test we are used to.

This can be used on:
* ARM (DUE) based boards - all pins can raise interrupts,
* RAMPS - all 6 endstop pins plus some other on EXT-2 can raise interrupts,
* RAMPS based boards - as long the designers did not change the pins for the endstops or at least left enough,
* all boards, if there are enough pins that can raise interrupts, and you are willing/able to swap with pins dedicated to other purpose.
@AnHardt
Copy link
Contributor Author

AnHardt commented Nov 15, 2016

@oysteinkrog
Sorry, i can't reproduce your problem.
Is your configuration working without ENDSTOP_INTERRUPTS_FEATURE?
Does it make a difference if you are using your verify/upload -scripts or the buttons in the Arduino IDE?

Any other testers?

@oysteinkrog
Copy link
Contributor

I am currently using Arduino IDE to compile/upload.
I tested latest (f3eee02) just now and can confirm it works! (unlike e5cc02e).
Thank you :)

@thinkyhead
Copy link
Member

thinkyhead commented Nov 16, 2016

Great work! I will review this and merge it soon. It's very nice that you included a test .ino.

Any other testers?

More would be good! But then, this is pretty straightforward.

@thinkyhead thinkyhead merged commit 832fe28 into MarlinFirmware:RCBugFix Nov 19, 2016

void setup() {
Serial.begin(9600);
Serial.println("PINs causing interrups are:");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merged too soon. But no biggie.

@brainscan
Copy link

brainscan commented Nov 19, 2016

This seems to only work if the endstops aren't already triggered. Not a pretty sound when all 3 endstops get ignored simultaneously.

@AnHardt
Copy link
Contributor Author

AnHardt commented Nov 19, 2016

Fixed but not merged yet 4h ago (Endstop interrupt refinement #5256)

@thinkyhead
Copy link
Member

Thanks. I really can't test. Please test thoroughly.

@thinkyhead thinkyhead mentioned this pull request Nov 28, 2016
@AnHardt AnHardt deleted the endstop_interrupts branch November 28, 2016 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants