-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mks_robin_nano_v3.0 board map wrong AUXINPUT0_PORT selected #213
Comments
I'm trying to summarize board alignment from MKS documents and board mapping. |
This is better? I do not have a board to verify with. |
Thank you! it's looks much better. #ifdef M3_AVAILABLE #ifdef M4_AVAILABLE #ifdef M3_AVAILABLE #ifdef M4_AVAILABLE I'll also propose different port and button allocation It will use more protected inputs for buttons, allow more free inputs :
power outputs: - move spindle PWM to most powerful output to allow connecting DC motors directly and logical output for the same port, direct connection of coolant DC motor or relay, reserve fan port for fan/vacuum etc. control
It's also lots of ports still free on the board, but I'm only few days playing with board and cannot explore it yet. |
I'll commit the version I now have with the CS/UART pins fixed. Note that limit inputs for M3 and M4 motors has to be interrupt capable, this puts a restraint on how you assign other pins that requires interrupt capability, this is due to how STM32 interrupts are "wired". There are only 16 GPIO IRQs and a given pin number can only be assigned to one IRQ regardless of which port it belongs to. So e.g. the M3_LIMIT_PIN (PC4) and MT_DET1 (PA4) cannot both be assigned to an interrupt. When you are happy with a board map please create a PR with your changes. |
If I'm understand correctly, we can freely assign interrupt to to any port, but pins with the same ID on different ports should be served by the same IRQ - Like PA0 and PB0 will trigger IRQ PinChange0. |
Not so, only one of them can be "wired" to the IRQ line. See Figure 31 in the PRM.
Limit and control inputs (reset, feed hold, cycle start etc). Probe is optional since it is polled, but best to have on an IRQ line since that triggers a SR latch. Some plugins requires interrupt capable auxiliary inputs as well. Encoder signals can be fed to a encoder peripheral if available (STM32 timers can also be used) - this way it is possible to avoid "using" up" the available GPIO IRQ lines. |
Unfortunately trying to build firmware with WebBuilder causing error Src/driver.c:83:2: error: #error Interrupt enabled input pins must have unique pin numbers!
#error Interrupt enabled input pins must have unique pin numbers!
^~~~~
*** [.pio/build/test/src/driver.o] Error 1 Cannot decide what exactly overrides - minimal setup for 3 axis, no probe etc. giving the same results
It's will be helpful if WebBuilder allows to download generated config files no matter successful build or not |
I'll remove support for SD detect - it is not that important and is causing the compilation failure.
Sure, I'll try to add it. |
But what about AUXINPUT0 ? it's mapped to SAFETY_DOOR and MOTOR_FAULT
The idea is to move Door and Probe inputs to PW_DET and MT_DET2 because this connectors are 3-pin and contains +5V power, copacitor - better much for external connectors. Regarding analog inputs TB, TH1, TH2 - it's isn't divider - it's filtered - 10u capacitor in parallel, 4k pool-up to 3v3, protective diodes from GND and 3v3, 100 Ohm resistor toward controller PIN. So it's not the keys for digital inputs/outputs until capacitors are removed. |
I'm just realized, analog inputs TB, TH1,TH2 on this boards should fit button connection - 10u capacitor not best, but not the problem for mechanical buttons.
I'm didn't setup my build environment yet, so it's not tested. Going to prepare map.h @terjeio is it Ok for WebBuilder to allocate PROBE_PIN and SAFETY_DOOR_PIN directly without reference to AUXINPUT0_PIN AUXINPUT1_PIN ? I'm want to free AUX for different tasks from plugins. |
You have to verify that these inputs can actually be used first. There are no values for the resistors in my schematic so impossible to calculate if the input low voltage is below the min. required.
No, add additional aux inputs instead. |
Hi Terge,
Started to play with MKS robin nano v3.1 board found AUXINPUT0_PORT are configured to use GPIOG, which are not exists on this CPU.
As result, created by WebBuilder firmware mapping Safety door and Motor fault inputs to nowhere.
Most probable it's some copy-past error from different board map
mks_robin_nano_v3.0_map.h
It's also mapping the same pin for AUXOUTPUT1 and AUXOUTPUT4 and some other overlapping definitions
MOOR_UARTZ and MOTOR_UART3 are mapped to the same pin, MOTOR_UART5 are configured but board only supports 5 drivers in total
mks_robin_nano_v3.0_map
The text was updated successfully, but these errors were encountered: