Skip to content

Commit 261efdd

Browse files
WulfstaKevinOConnor
authored andcommitted
config: Add 1LC example configuration and docs
Signed-off-by: Luke Vuksta <wulfstawulfsta@gmail.com>
1 parent 4292136 commit 261efdd

File tree

2 files changed

+125
-0
lines changed

2 files changed

+125
-0
lines changed

config/sample-duet3-1lc.cfg

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# This file contains common pin mappings for the Duet3 1LC. To use
2+
# this config, the firmware should be compiled for the SAMC21G18 with:
3+
# Bootloader offset of "No Bootloader"
4+
# Clock Reference of "25 Mhz crystal" if the board version is v1.1 or later
5+
# Clock Reference of "12 Mhz crystal" if the board version is v1.0 or earlier
6+
# Communication interface of "CAN bus (on PA25/PA24)"
7+
8+
# To flash the board use a debugger, or use a raspberry pi and follow
9+
# the instructions at docs/Bootloaders.md fot the SAMC21. You may
10+
# supply power to the 1LC by connecting the 3.3v rail on the Pi to the
11+
# 5v input of the SWD header on the 1LC.
12+
13+
# See docs/Config_Reference.md for a description of parameters.
14+
15+
16+
# Pins for reference, v1.3 board:
17+
# Driver Step Pin - PA27
18+
# Driver Dir Pin - PA28
19+
# Driver Enable - !PB2
20+
# Thermistor Pins - TEMP0:PB9 TEMP1:PA2
21+
# Pullup Resistor - 2200
22+
# Vssa Sense:PA6 | Vref Sense:PA7
23+
# Current Sense resistor for drivers - 0.091ohm
24+
# CAN Pins - CAN0_TX:PA24 CAN0_RX:PA25
25+
# Heaters - OUT_0:PA11
26+
# Fan outputs - OUT_1:PA10 OUT_2:PB11
27+
# Tach Pins for Fans - OUT_1_TACHO:PA13 OUT_2_TACHO:PB10
28+
# GPIO_out - IO0:PA12
29+
# GPIO_in - IO0:PA9 IO1:PA21 IO2:PA18
30+
# Driver Diag - 0:PB3
31+
32+
[adc_scaled toolboard_vref_scaled]
33+
vref_pin: toolboard:PA7
34+
vssa_pin: toolboard:PA6
35+
36+
[extruder]
37+
step_pin: toolboard:PA27
38+
dir_pin: toolboard:PA28
39+
enable_pin: !toolboard:PB2
40+
rotation_distance: 23.1336867485061
41+
gear_ratio: 50:10
42+
microsteps: 64
43+
full_steps_per_rotation: 200
44+
nozzle_diameter: 0.400
45+
filament_diameter: 1.75
46+
heater_pin: toolboard:PA11
47+
sensor_type: PT1000
48+
sensor_pin: toolboard_vref_scaled:PB9
49+
pullup_resistor: 2200
50+
min_temp: 0
51+
max_temp: 280
52+
max_power: 1.0
53+
control: pid
54+
pwm_cycle_time: 0.01666
55+
pid_Kp: 26.454
56+
pid_Ki: 1.357
57+
pid_Kd: 128.955
58+
59+
[tmc2209 extruder]
60+
uart_pin: toolboard:PA20
61+
tx_pin: toolboard:PA22
62+
interpolate: False
63+
run_current: 0.35
64+
sense_resistor: 0.091
65+
66+
[fan]
67+
pin: toolboard:PA10
68+
tachometer_pin: toolboard:PA13
69+
70+
[heater_fan hotend_fan]
71+
pin: toolboard:PB11
72+
tachometer_pin: toolboard:PB10
73+
heater: extruder
74+
heater_temp: 50.0
75+
76+
[probe]
77+
pin: toolboard:PA9
78+
z_offset: 20
79+
80+
[mcu toolboard]
81+
canbus_uuid: 4b194673554e

docs/Bootloaders.md

+44
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,50 @@ To flash an application use something like:
185185
bossac --port=/dev/ttyACM0 -b -U -e -w -v -R out/klipper.bin
186186
```
187187

188+
## SAMDC21 micro-controllers (Duet3D Toolboard 1LC)
189+
190+
The SAMC21 is flashed via the ARM Serial Wire Debug (SWD) interface.
191+
This is commonly done with a dedicated SWD hardware dongle.
192+
Alternatively, one can use a
193+
[Raspberry Pi with OpenOCD](#running-openocd-on-the-raspberry-pi).
194+
195+
When using OpenOCD with the SAMC21, extra steps must be taken to first
196+
put the chip into Cold Plugging mode if the board makes use of the
197+
SWD pins for other purposes. If using OpenOCD on a Rasberry Pi, this
198+
can be done by running the following commands before invoking OpenOCD.
199+
```
200+
SWCLK=25
201+
SWDIO=24
202+
SRST=18
203+
204+
echo "Exporting SWCLK and SRST pins."
205+
echo $SWCLK > /sys/class/gpio/export
206+
echo $SRST > /sys/class/gpio/export
207+
echo "out" > /sys/class/gpio/gpio$SWCLK/direction
208+
echo "out" > /sys/class/gpio/gpio$SRST/direction
209+
210+
echo "Setting SWCLK low and pulsing SRST."
211+
echo "0" > /sys/class/gpio/gpio$SWCLK/value
212+
echo "0" > /sys/class/gpio/gpio$SRST/value
213+
echo "1" > /sys/class/gpio/gpio$SRST/value
214+
215+
echo "Unexporting SWCLK and SRST pins."
216+
echo $SWCLK > /sys/class/gpio/unexport
217+
echo $SRST > /sys/class/gpio/unexport
218+
```
219+
220+
To flash a program with OpenOCD use the following chip config:
221+
```
222+
source [find target/at91samdXX.cfg]
223+
```
224+
Obtain a program; for instance, klipper can be built for this chip.
225+
Flash with OpenOCD commands similar to:
226+
```
227+
at91samd chip-erase
228+
at91samd bootloader 0
229+
program out/klipper.elf verify
230+
```
231+
188232
## SAMD21 micro-controllers (Arduino Zero)
189233

190234
The SAMD21 bootloader is flashed via the ARM Serial Wire Debug (SWD)

0 commit comments

Comments
 (0)