Day 22 - nikkiverre/Teacup_Firmware GitHub Wiki

Yesterday, I finally figured out what was going on with the endstops.

Here are the issues I had with the endstops and how I solved them:

  1. The biggest issue I was having that I talked about in the last blog was that the endstops' mechanical change weren't being registered in the software. I finally figured out what was going on... I wanted to make sure that the input pins were being read properly by the software. Since our X_min pin is an input, we wanna read from the PDIR register: https://github.com/PaulStoffregen/cores/blob/master/teensy3/core_pins.h#L318. I noticed that GPIOB_PDIR is defined as CORE_PIN1_PINREG. But in Teacup_Firmware/arduino_teensy3.h at teensy3 · Traumflug/Teacup_Firmware · GitHub, DIO1_RPORT was defined as CORE_PIN1_PORTREG. It should have been defined as CORE_PIN1_PINREG instead. Once I fixed that in the code, I could see the endststops being triggered when I ran the M119 command!! I made the changes and updated it on GitHub.

  2. The axes were moving in the opposite directions of the endstops. I inverted the logic in the software. In the config file, you should see a {X,Y,Z}_INVERT_MIN. Make sure to enable that AND the {X,Y,Z}_MIN_PIN if you want to invert the logic. You have to define your MIN_PIN and then you can choose to invert them or not based on how you wired your switches (active low or active high). In my case I wired them active high, so I had to invert that logic.

Next week, I'll be participating in a summer camp program and I am not sure how much time I'll have to work but I'll do as time permits. On to the thermistor calibration!

Until next time...