diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-08-24 09:34:31 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-08-26 18:27:20 -0400 |
commit | 9d75c3b0cace034ef8d51be1b38b705db33ac793 (patch) | |
tree | 2e748e7868c8a10d3e60a49a248b8766c388b3a9 /config | |
parent | 6ab8567d51d9f1b536d0adef276e31c3a986c1f2 (diff) | |
download | kutter-9d75c3b0cace034ef8d51be1b38b705db33ac793.tar.gz kutter-9d75c3b0cace034ef8d51be1b38b705db33ac793.tar.xz kutter-9d75c3b0cace034ef8d51be1b38b705db33ac793.zip |
chipmisc: Add support for statically configured output pins
Allow digital and PWM output pins to be setup via new config
sections. This makes it easier to setup pin configurations.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'config')
-rw-r--r-- | config/example-extras.cfg | 83 | ||||
-rw-r--r-- | config/example.cfg | 38 | ||||
-rw-r--r-- | config/generic-rambo.cfg | 25 | ||||
-rw-r--r-- | config/makergear-m2-2012.cfg | 22 |
4 files changed, 108 insertions, 60 deletions
diff --git a/config/example-extras.cfg b/config/example-extras.cfg new file mode 100644 index 00000000..ec9de90b --- /dev/null +++ b/config/example-extras.cfg @@ -0,0 +1,83 @@ +# This file serves as documentation for config parameters of +# additional devices that may be configured on a printer. The snippets +# in this file may be copied into the main printer.cfg file. See the +# "example.cfg" file for description of common config parameters. + + +# In a multi-extruder printer add an additional extruder section for +# each additional extruder. The additional extruder sections should be +# named "extruder1", "extruder2", "extruder3", and so on. See the +# "extruder" section in example.cfg for a description of available +# parameters. +#[extruder1] +#step_pin: ar36 +#dir_pin: ar34 +#... +#deactivate_gcode: +# A list of G-Code commands (one per line) to execute on a G-Code +# tool change command (eg, "T1") that deactivates this extruder and +# activates some other extruder. It only makes sense to define this +# section on multi-extruder printers. The default is to not run any +# special G-Code commands on deactivation. +#activate_gcode: +# A list of G-Code commands (one per line) to execute on a G-Code +# tool change command (eg, "T0") that activates this extruder. It +# only makes sense to define this section on multi-extruder +# printers. The default is to not run any special G-Code commands on +# activation. + + +# Heater cooling fans (one may define any number of sections with a +# "heater_fan" prefix). A "heater fan" is a fan that will be enabled +# whenever its associated heater is active. +#[heater_fan my_nozzle_fan] +# See the "fan" section for fan configuration parameters. +#pin: ar4 +# The remaining variables are specific to heater_fan. +#heater: extruder +# Name of the config section defining the heater that this fan is +# associated with. The default is "extruder". +#heater_temp: 50.0 +# A temperature (in Celsius) that the heater must drop below before +# the fan is disabled. The default is 50 Celsius. + + +# Statically configured digital output pins (one may define any number +# of sections with a "static_digital_output" prefix). Pins configured +# here will be setup as a GPIO output during MCU configuration. +#[static_digital_output my_output_pins] +#pins: +# A comma separated list of pins to be set as GPIO output pins. The +# pin will be set to a high level unless the pin name is prefaced +# with "!". This parameter must be provided. + + +# Statically configured PWM output pins (one may define any number of +# sections with a "static_pwm_output" prefix). Pins configured here +# will be setup as PWM outputs during MCU configuration. +#[static_pwm_output my_output_pwm] +#pin: +# The pin to configure as PWM output. This parameter must be +# provided. +#value: +# The value to statically set the PWM output to. This is typically +# set to a number between 0.0 and 1.0 with 1.0 being full on and 0.0 +# being full off. However, the range may be changed with the 'scale' +# parameter (see below). This parameter must be provided. +#hard_pwm: +# Set this value to force hardware PWM instead of software PWM. Set +# to 1 to force a hardware PWM at the fastest rate; set to a higher +# number to force hardware PWM with the given cycle time in clock +# ticks. The default is to use software PWM. +#cycle_time: 0.100 +# The amount of time (in seconds) per PWM cycle when using software +# based PWM. The default is 0.100 seconds. +#scale: +# This parameter can be used to alter how the 'value' parameter is +# interpreted. If provided, then the 'value' parameter should be +# between 0.0 and 'scale'. This may be useful when configuring a PWM +# pin that controls a stepper voltage reference. The 'scale' can be +# set to the equivalent stepper amperage if the PWM were fully +# enabled, and then the 'value' parameter can be specified using the +# desired amperage for the stepper. The default is to not scale the +# 'value' parameter. diff --git a/config/example.cfg b/config/example.cfg index 4bb805db..32ece835 100644 --- a/config/example.cfg +++ b/config/example.cfg @@ -2,7 +2,8 @@ # copy and edit this file to configure a new cartesian style # printer. For delta style printers, see the "example-delta.cfg" # file. For corexy/h-bot style printers, see the "example-corexy.cfg" -# file. +# file. Only common config sections are described here - see the +# "example-extras.cfg" file for configuring less common devices. # DO NOT COPY THIS FILE WITHOUT CAREFULLY READING AND UPDATING IT # FIRST. Incorrectly configured parameters may cause damage. @@ -150,18 +151,6 @@ filament_diameter: 3.500 # otherwise cause retraction followed immediately by pressure # buildup. This setting only applies if pressure_advance is # non-zero. The default is 0.010 (10 milliseconds). -#deactivate_gcode: -# A list of G-Code commands (one per line) to execute on a G-Code -# tool change command (eg, "T1") that deactivates this extruder and -# activates some other extruder. It only makes sense to define this -# section on multi-extruder printers. The default is to not run any -# special G-Code commands on deactivation. -#activate_gcode: -# A list of G-Code commands (one per line) to execute on a G-Code -# tool change command (eg, "T0") that activates this extruder. It -# only makes sense to define this section on multi-extruder -# printers. The default is to not run any special G-Code commands on -# activation. # # The remaining variables describe the extruder heater. heater_pin: ar10 @@ -217,15 +206,6 @@ max_temp: 210 # Maximum temperature (mcu will shutdown if temperature is above # this value). This parameter must be provided. -# In a multi-extruder printer add an additional extruder section for -# each additional extruder. The additional extruder sections should be -# named "extruder1", "extruder2", "extruder3", and so on. See the -# "extruder" section above for a description of available parameters. -#[extruder1] -#step_pin: ar36 -#dir_pin: ar34 -#... - # The heater_bed section describes a heated bed (if present - omit # section if not present). [heater_bed] @@ -323,17 +303,3 @@ max_z_accel: 30 # centripetal velocity cornering algorithm. A larger number will # permit higher "cornering speeds" at the junction of two moves. The # default is 0.02mm. - -# Heater cooling fans (one may define any number of sections with a -# "heater_fan" prefix). A "heater fan" is a fan that will be enabled -# whenever its associated heater is active. -#[heater_fan my_nozzle_fan] -# See the "fan" section for fan configuration parameters. -#pin: ar4 -# The remaining variables are specific to heater_fan. -#heater: extruder -# Name of the config section defining the heater that this fan is -# associated with. The default is "extruder". -#heater_temp: 50.0 -# A temperature (in Celsius) that the heater must drop below before -# the fan is disabled. The default is 50 Celsius. diff --git a/config/generic-rambo.cfg b/config/generic-rambo.cfg index f1cc0389..f01eb82f 100644 --- a/config/generic-rambo.cfg +++ b/config/generic-rambo.cfg @@ -77,19 +77,6 @@ pin: PH5 [mcu] serial: /dev/ttyACM0 custom: - # Turn off yellow led - set_digital_out pin=PB7 value=0 - # Stepper micro-step pins - set_digital_out pin=PG1 value=1 - set_digital_out pin=PG0 value=1 - set_digital_out pin=PK7 value=1 - set_digital_out pin=PG2 value=1 - set_digital_out pin=PK6 value=1 - set_digital_out pin=PK5 value=1 - set_digital_out pin=PK3 value=1 - set_digital_out pin=PK4 value=1 - #set_digital_out pin=PK2 value=1 - #set_digital_out pin=PK1 value=1 # Initialize digipot send_spi_message pin=PD7 msg=0487 # X = ~0.75A send_spi_message pin=PD7 msg=0587 # Y = ~0.75A @@ -103,3 +90,15 @@ max_velocity: 300 max_accel: 3000 max_z_velocity: 5 max_z_accel: 100 + +# Enable 16 micro-steps on steppers X, Y, Z, E0, E1 +[static_digital_output stepper_config] +pins: + PG1, PG0, + PK7, PG2, + PK6, PK5, + PK3, PK4, + PK2, PK1 + +[static_digital_output yellow_led] +pins: !PB7 diff --git a/config/makergear-m2-2012.cfg b/config/makergear-m2-2012.cfg index a2b0e89d..1bf72a54 100644 --- a/config/makergear-m2-2012.cfg +++ b/config/makergear-m2-2012.cfg @@ -77,17 +77,6 @@ hard_pwm: 1 [mcu] serial: /dev/ttyACM0 custom: - # Turn off yellow led - set_digital_out pin=PB7 value=0 - # Stepper micro-step pins - set_digital_out pin=PG1 value=1 - set_digital_out pin=PG0 value=1 - set_digital_out pin=PK7 value=1 - set_digital_out pin=PG2 value=1 - set_digital_out pin=PK6 value=1 - set_digital_out pin=PK5 value=1 - set_digital_out pin=PK3 value=1 - set_digital_out pin=PK4 value=1 # Initialize digipot send_spi_message pin=PD7 msg=0487 # X = ~0.75A send_spi_message pin=PD7 msg=0587 # Y = ~0.75A @@ -101,3 +90,14 @@ max_velocity: 500 max_accel: 3000 max_z_velocity: 25 max_z_accel: 30 + +# Enable 8 micro-steps on steppers X, Y, Z, E0 +[static_digital_output stepper_config] +pins: + PG1, PG0, + PK7, PG2, + PK6, PK5, + PK3, PK4 + +[static_digital_output yellow_led] +pins: !PB7 |