-
Notifications
You must be signed in to change notification settings - Fork 90
Added ESP32 pin mapping for ESPDUINO-32 Wemos D1 R32 #159
Conversation
c2af6a9
to
d8d7386
Compare
Coolant output is not going to work as pin 34 is input only. |
... and coolant output defined as pin 34 stops at least spindle on pin working as well. Possibly all outputs? I have added a check for input only pins used as outputs but that fails when I use the GPIO definition. A compiler bug? Check fail to trap:
but traps:
|
Weird. The compilation went well for me. I will test all the individual pins with logic analyzer to see if the imputs are working as expected. I am aware of the input-only pins. that is common issue with esp32 designs. |
With idf.py? Pin definitions in components\driver\include\driver\gpio.h looks like this in my installation:
Inputs were working for me, not sure if I tested the probe input though. A bit strange that the spindle enable output did not work when coolant output was routed to pin 34. When routed to pin 15 it worked. I did not test the other outputs. Here is the test I have added (to driver.h):
|
Great. I was also planing to add this.
It does weird thing. It seems to activate safety door (S) instead of probe (P). |
I have it commented out, maybe that's not good solution... Is there different way of disabling safety door pin mapping entirely? Also i have mist cooling commented. //#define COOLANT_MIST_PIN GPIO_NUM_36
//#define SAFETY_DOOR_PIN GPIO_NUM_39
#define CYCLE_START_PIN GPIO_NUM_36
#define PROBE_PIN GPIO_NUM_39 |
To be honest, it even kind of feels like ucommenting the |
That depends on which branch you are compiling for. For the master branch always |
I have just updated the test branch, this includes your PR and has an updated CMakeList.txt for selecting the board. |
Just found my espduino board is mislabeled on silkscreen (two pins were both marked as 36) and cycle start should actualy be 35: Can you please fix it to look like this? |
Also it feels that inputs are broken on grblHAL side. I've used following arduino sketch to check that all input pin numbers are correctly marked on the board and it works like supposed in the arduino code (except for the mentioned cycle start pin which is actualy 35), but grblHAL inputs do not seem to work properly: // the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(115200);
// make the pushbutton's pin an input:
}
// the loop routine runs over and over again forever:
void loop() {
// read the input pin:
for(int i = 0; i < 50; i++) {
if(i == 6) continue;
pinMode(i, INPUT);
if(digitalRead(i)) {
Serial.print(i);
Serial.print(" ");
}
}
// print out the state of the button:
Serial.println("");
delay(1000); // delay in between reads for stability
} |
It is something weird going on when using the
What makes it really weird is that the pin assignments for my CNC Boosterpack works, but perhaps due to all beeing > 31?:
Compiler error or expected behaviour? I do not know... |
I tried to remove |
I've checked with logic analyzer that STEP/DIR signals for XYZ axes are generated properly... But these are pins <30... |
Works for me. Another mislabeled pin? I had to add edit: |
I've checked all pin numbers using arduino sketch and there was only one mislabeled. Is there anything that i need to configure to get list of active pins in status report (eg. |
No, I have tested with my sender and all shows up in the "LED" display as they should.
A parsing problem due to additional elements? If you check with a terminal are they missing from the status report? If so did you forget to add pullup resistors for the input only pins? I have now checked masks from enums with a different compiler - same issue. A switch to numbers only is required or the masks has to go in driver.c. Silly of Espressif of using enums for pin definitions and a mask for configuring them when this is not working properly in all combinations. |
Actualy i had to set |
Oops - I have forgotten about that setting. BTW the |
It seems that only problem now are the missing internal pullups. input-only pins (cycle start 35, probe 39) probably don't have that and will need external bias. and pin 2 (reset) seems to have pullup, but it is rendered unusable by onboard LED, which i will try to remove in order to recover the functionality. |
I decided to keep the prefix and added an array of pins to configure as outputs. Just commited to the test branch, note that I have only tested this lightly. |
This map is for relatively common ESP32 boards replicating the form factor of Arduino UNO.
This map allows use of such uno-compatible board with very popular
"Protoneer Arduino CNC shield" and is based on its pinout.
This makes perfect match for retrofiting older Arduino+GRBL based machines
with 32b microcontroler capable of running grblHAL and providing few extra IO pins (eg. for modbus #68 ).
These boards are sold under several names, for instance: