Help on making a new *_map.h file #742
-
I'm trying to understand the flexibility (or limits of flexibility) of pin assignment when compiling for a custom board. I've seen that in some versions of the map file the pin definitions are offset from other values. Does this mean that it is not possible to select any pin for any function? For example in RP2040/boards/generic_map_8axis.h there is several examples of code like: #define M3_STEP_PIN (STEP_PINS_BASE + 3) One pin is set to another pin plus an offset. Why is it like this? What is the significance of the offset? Is it not possible to just pick a pin and put a literal number in the #define? And change the number according to the board layout? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
No.
Mainly to not exhaust PIO state machines. A single state machine can handle one or many pins - but only if they are consecutive.
It is possible, as long as you do not exhaust PIO state machines for controlling the stepper pins. The RP2040 has eight, one is used for the main stepper timer. Depending on the configuration others might be used for no-stepper related stuff. See the RP2040 datasheet, Chapter 3 (3.5.6), for more. |
Beta Was this translation helpful? Give feedback.
No.
Mainly to not exhaust PIO state machines. A single state machine can handle one or many pins - but only if they are consecutive.
It is possible, as long as you do not exhaust PIO state machines for controlling the stepper pins. The RP2040 has eight, one is used for the main stepper timer. Depending on the configuration others might be used for no-stepper related stuff.
See the RP2040 datasheet, Chapter 3 (3.5.…