Ive started an Openpnp/Duet config/gcode page for the Openpnp group. Please help keep the page accurate and up to date. The current example is based off my current machine a CHMT36V using a 6HC and x2 1XD's.
Thanks Wayne
Best posts made by wayneosdias
-
Duet Openpnp
-
RE: Duet Mini 5 BTT MAX31865 Issue
@dc42
Ok got comms sorted. I got this initially
Looks like the MISO line isnt pulled up locally on the the BTT board. I guess this makes sense as the board is meant to plug into 'step stick port' on a BTT driver board. In all the literature I read from BTT/Biqu makes no mention of pullups or active line jumpering. Any way pulled the MISO line up to 3V via 10k and now I get the following;
DWC is also reporting semi resonable values so now just some tuning and firmer wiring to get the ball rolling. I have a Duet PT100 dtr board coming from filastruda and I dont think ill have it for a week. I also ordered an Adafruit MAX31865 bob that should be here tomorrow so Ill follow up this thread on how that gos.Huge thanks for this Forum and support, the best
-
RE: SBC loses network connection, alot!
@Phaedrux "You MIGHT be able to get away with longer length if you used a shielded twisted pair cable instead of a flat ribbon, but even so, SPI isn't meant for long runs."
I dont think shielding will help. The issue is increased capacitance and resistance with long wire runs and screws up the spi signal timing. The quickest check would be what others have suggested. Simply move the SBC closer to the 6HC using the original cable. If that fixes your issue no amount of shielding is going solve your problem. You will need to relocate the SBC next to the 6HC.
-
RE: Read Output pin state
@owend
Will do, I need to get the mechanicals back together first.
If you dont know what this is, it's the aftermath drag pin machine crash. The pin with the bent tip slides up and down within the blue coil of the selenoid with the bent frame.I hope to get fixed tonight and put some of my new and improved RRF commands to work
Thanks again.
-
RE: 6HC power selection
@fcwilt THANK YOU! The schem answers all questions.
For my app I will drive an off board FET driver board via V_OUT's set to 12V. -
RE: Rating Duet distributers/resalers?
@infiniteloop
Thanks. The issue I've had has been in regard to reseller sales/shipping itself and not Duet itself or 2ndary integration. Duet is without peer, and I have 7 different production machines using Duet controllers. I'm located in USA CA and have attempted to use a CA based vendor twice for Duet and each time the order has been filled incorrectly. This is extremely frustrating. Conversely, I started using Filastruda located on the opposite side of the country in GA. Ive had 6 different Duet orders with Filastruda with no issues and have received the orders much quicker than the CA base vendor.This is just my experience and I don't know if posting this is of any help to anyone else.
...end of rant.
Latest posts made by wayneosdias
-
LIS3D using SPI issues
Im reconfiguring 1HCL 3.5FW for a custom board. I want to use the LIS3D on the SPI PA(15-19) of SAME5x , no other peripherals on the SPI bus. Heres part of my .h config;
#define SUPPORT_SPI_SENSORS 1 //**REMAPP**//# define SUPPORT_I2C_SENSORS 1 /**REMAPPED**/# define SUPPORT_I2C_SENSORS 0 # define SUPPORT_LIS3DH #if SUPPORT_LIS3DH # define ACCELEROMETER_USES_SPI (1) // accelerometer is connected via SPI constexpr Pin Lis3dhCsPin = PortAPin(18); // same as encoder CS pin constexpr Pin Lis3dhInt1Pin = PortAPin(12); // same as io1.in # endif // Shared SPI (used for interface to encoders, not for temperature sensors) constexpr uint8_t SspiSercomNumber = 1; constexpr uint32_t SspiDataInPad = 3; constexpr Pin SSPIMosiPin = PortAPin(16); constexpr GpioPinFunction SSPIMosiPinPeriphMode = GpioPinFunction::C; constexpr Pin SSPISclkPin = PortAPin(17); constexpr GpioPinFunction SSPISclkPinPeriphMode = GpioPinFunction::C; constexpr Pin SSPIMisoPin = PortAPin(19); constexpr GpioPinFunction SSPIMisoPinPeriphMode = GpioPinFunction::C;
Im getting a bunch of errors
Any help on clearing this up? Thanks!
-
RE: PinTable descriptors
@dc42 @jay_s_uk
Thank you and understood re EXINT.Is there any considerations for reassigning the '.ate' pins?
Lastly, I thought I read somewhere the io0.in/out UART wasn't available on the Expansion boards yet. I see in 3.5 1HCL
// PB02 IO0 out, UART available // PB03 IO0 in, UART available
and the io looks to be wired to sercom5d. Is the Duet Aux UART available on the expansion board?
Thanks for the help
-
PinTable descriptors
I'm creating a custom board based off the 1HCL and remapping some of the io.
In the PinTable what is the 'Exint'? Im guessing the IRQ priority?TC TCC ADC SERCOM in SERCOM out Exint PinName // Port A { TcOutput::none, TccOutput::none, AdcInput::none, SercomIo::none, SercomIo::none, 0, "spi.cs1"
Also what is 'ate.'? Im unfamiliar with this prefix.
"ate.v12" }, // PA06 12v monitor
Thanks for any help
-
RE: Unable to build Duet3Exp FW3.5
Updating my previous toolchain from 10.1 to 13.2 fixed the problem and is compiling,
Thanks Guys -
Unable to build Duet3Exp FW3.5
Trying and failing to compile unmodified 3.5 EXP3HC fw per https://github.com/Duet3D/Duet3Expansion
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: unrecognized option '--no-warn-rwx-segment' c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: use the --help option for usage information collect2.exe: error: ld returned 1 exit status make[1]: *** [makefile:96: Duet3Firmware_EXP3HC.elf] Error 1 make: *** [makefile:81: all] Error 2 "make -j12 all" terminated with exit code 2. Build might be incomplete. 16:41:52 Build Failed. 4 errors, 0 warnings. (took 9s.61ms)
Thank you for any help
-
RE: M118 send hex values
@dc42
Thanks David, 3.6 beta works, 3.5.3 doesn't. M260.2 only works on beta FW? -
M118 send hex values
Im trying to send a hex values. Using rrf3.5.3
M575 P1 B57600 S7 ; AUX Serial port Ive tried S0-7
And the following M118 commands
M118 P2 S{0xE0}
Yeilds
AndM118 P2 S"0xE0"
Yeilds
Anyway to send a serial string of hex values that is not LF appended?
Thanks for any help
-
RE: SAMMYC21 Configuring
@dc42
I haven't connected any drivers yet, just probing via logic analyzer on the bench. The first HW pass will be using the Mini2+. Changing the SINGLE_DRIVER to 0 has got me the step pulses I'm after. Both Drives step io pulsing.Problem now is I had to disable TMC22xx support to actually compile. I assume I lose the ability to set the Mini2+ TMC2209 motor parameters, most importantly the current setting?
Heres just a couple of the 100's of errors I had with #define SUPPORT_TMC22xx 1
31 | #if TMC22xx_VARIABLE_NUM_DRIVERS | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ../src/Movement/StepperDrivers/TMC22xx.cpp:8: ../src/Movement/StepperDrivers/TMC22xx.h:31:5: warning: "TMC22xx_VARIABLE_NUM_DRIVERS" is not defined, evaluates to 0 [-Wundef] 31 | #if TMC22xx_VARIABLE_NUM_DRIVERS | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../src/Movement/StepperDrivers/TMC22xx.cpp:13:3: error: #error TMC22xx_HAS_ENABLE_PINS not defined 13 | # error TMC22xx_HAS_ENABLE_PINS not defined | ^~~~~ ../src/Movement/StepperDrivers/TMC22xx.cpp:17:3: error: #error TMC22xx_SINGLE_DRIVER not defined 17 | # error TMC22xx_SINGLE_DRIVER not defined | ^~~~~ ../src/Movement/StepperDrivers/TMC22xx.cpp:21:3: error: #error TMC22xx_HAS_MUX not defined 21 | # error TMC22xx_HAS_MUX not defined | ^~~~~ ../src/Movement/StepperDrivers/TMC22xx.cpp:25:3: error: #error TMC22xx_VARIABLE_NUM_DRIVERS not defined 25 | # error TMC22xx_VARIABLE_NUM_DRIVERS not defined | ^~~~~ ../src/Movement/StepperDrivers/TMC22xx.cpp:29:3: error: #error TMC22xx_USE_SLAVEADDR not defined 29 | # error TMC22xx_USE_SLAVEADDR not defined | ^~~~~
Heres the latest SAMMYC21.h
/* * SAMMYC21.h * * Created on: 23 May 2020 * Author: David */ #ifndef SRC_CONFIG_SAMMYC21_H_ #define SRC_CONFIG_SAMMYC21_H_ #include <Hardware/PinDescription.h> #define BOARD_TYPE_NAME "SAMMYC21" #define BOOTLOADER_NAME "SAMMYC21" // General features #define HAS_VREF_MONITOR 0 #define HAS_VOLTAGE_MONITOR 0 #define HAS_12V_MONITOR 0 #define HAS_CPU_TEMP_SENSOR 1 #define HAS_ADDRESS_SWITCHES 0 #define HAS_BUTTONS 1 #define USE_SERIAL_DEBUG 1 // Drivers configuration #define SUPPORT_DRIVERS 1 #define HAS_SMART_DRIVERS 0 #define HAS_STALL_DETECT 0 #define SINGLE_DRIVER 0 #define SUPPORT_SLOW_DRIVERS 0 #define SUPPORT_DELTA_MOVEMENT 0 #define DEDICATED_STEP_TIMER 1 #define SUPPORT_TMC51xx 0 #define SUPPORT_TMC2160 0 #define SUPPORT_TMC2660 0 #define SUPPORT_TMC22xx 0 constexpr size_t NumDrivers = 2; // #define USE_CCL 0 // USE_CCL also requires DIFFERENTIAL_STEPPER_OUTPUTS // #if USE_CCL // PortGroup * const StepPio = &(PORT->Group[1]); // the PIO that all the step pins are on // constexpr Pin EnablePins[NumDrivers] = { PortAPin(9) }; // constexpr Pin StepPins[NumDrivers] = { PortBPin(10) }; // constexpr Pin InvertedStepPins[NumDrivers] = { PortAPin(11) }; // constexpr Pin DirectionPins[NumDrivers] = { PortAPin(10) }; // // The SAMC21 can sink more current than it can source, therefore we use active low signals to drive external drivers // #define ACTIVE_HIGH_STEP 1 // 1 = active high, 0 = active low // #define ACTIVE_HIGH_DIR 0 // 1 = active high, 0 = active low // #define ACTIVE_HIGH_ENABLE 0 // 1 = active high, 0 = active low // #else PortGroup * const StepPio = &(PORT->Group[0]); // the PIO that all the step pins are on constexpr Pin EnablePins[NumDrivers] = { PortAPin(9), PortAPin(8) }; constexpr Pin StepPins[NumDrivers] = { PortAPin(11),PortAPin(6) }; constexpr Pin DirectionPins[NumDrivers] = { PortAPin(10), PortAPin(7) }; // PortGroup * const StepPio = &(PORT->Group[0]); // the PIO that all the step pins are on // constexpr Pin StepPins[NumDrivers] = { PortAPin(9), PortAPin(6) }; // constexpr Pin DirectionPins[NumDrivers] = { PortAPin(11), PortAPin(8) }; // constexpr Pin DriverDiagPins[NumDrivers] = { PortAPin(10), PortAPin(7) }; // The SAMC21 can sink more current than it can source, therefore we use active low signals to drive external drivers #define ACTIVE_HIGH_STEP 0 // 1 = active high, 0 = active low #define ACTIVE_HIGH_DIR 0 // 1 = active high, 0 = active low #define ACTIVE_HIGH_ENABLE 0 // 1 = active high, 0 = active low // #endif #define SUPPORT_THERMISTORS 1 #define SUPPORT_SPI_SENSORS 1 #define SUPPORT_I2C_SENSORS 1 #define SUPPORT_LIS3DH 1 #define SUPPORT_LDC1612 1 #define SUPPORT_DHT_SENSOR 0 #define SUPPORT_SDADC 0 #define USE_MPU 0 #define USE_CACHE 0 #define DIAG_SERCOM_NUMBER 5 // which SERCOM device we use for debugging output constexpr bool UseAlternateCanPins = true; constexpr size_t MaxPortsPerHeater = 1; constexpr size_t NumThermistorInputs = 2; constexpr float DefaultThermistorSeriesR = 2200.0; constexpr Pin TempSensePins[NumThermistorInputs] = { PortAPin(2), PortAPin(3) }; constexpr Pin CanStandbyPin = PortAPin(27); constexpr Pin ButtonPins[] = { PortBPin(9) }; // Diagnostic LEDs constexpr Pin LedPins[] = { PortAPin(28) }; constexpr bool LedActiveHigh = true; #if SUPPORT_SPI_SENSORS // Shared SPI using pins PA16,17,18. If changing this, also change the available pins in the pin table. constexpr uint8_t SspiSercomNumber = 1; constexpr uint32_t SspiDataInPad = 2; constexpr Pin SSPIMosiPin = PortAPin(16); constexpr GpioPinFunction SSPIMosiPinPeriphMode = GpioPinFunction::C; constexpr Pin SSPISclkPin = PortAPin(17); constexpr GpioPinFunction SSPISclkPinPeriphMode = GpioPinFunction::C; constexpr Pin SSPIMisoPin = PortAPin(18); constexpr GpioPinFunction SSPIMisoPinPeriphMode = GpioPinFunction::C; #endif #if SUPPORT_I2C_SENSORS // I2C using pins PA22,23. If changing this, also change the available pins in the pin table. constexpr uint8_t I2CSercomNumber = 3; constexpr Pin I2CSDAPin = PortAPin(22); constexpr GpioPinFunction I2CSDAPinPeriphMode = GpioPinFunction::C; constexpr Pin I2CSCLPin = PortAPin(23); constexpr GpioPinFunction I2CSCLPinPeriphMode = GpioPinFunction::C; #define I2C_HANDLER SERCOM3_Handler #endif #if SUPPORT_LIS3DH # define ACCELEROMETER_USES_SPI (0) // 0 if the accelerometer is connected via I2C, 1 if via SPI constexpr Pin Lis3dhInt1Pin = PortAPin(13); #endif #if SUPPORT_LDC1612 constexpr uint16_t LDC1612_I2CAddress = 0x2B; // pin 4 is tied high on the Grove board constexpr Pin LDC1612InterruptPin = PortAPin(21); #endif // Table of pin functions that we are allowed to use constexpr PinDescription PinTable[] = { // TC TCC ADC SDADC SERCOM in SERCOM out Exint PinName // Port A { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA00 not on board { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA01 not on board { TcOutput::none, TccOutput::none, AdcInput::adc0_0, AdcInput::none, SercomIo::none, SercomIo::none, Nx, "temp0" }, // PA02 thermistor { TcOutput::none, TccOutput::none, AdcInput::adc0_1, AdcInput::none, SercomIo::none, SercomIo::none, Nx, "temp1" }, // PA03 thermistor { TcOutput::none, TccOutput::tcc0_0E, AdcInput::adc0_4, AdcInput::none, SercomIo::none, SercomIo::none, 4, "pa04" }, // PA04 { TcOutput::none, TccOutput::none, AdcInput::adc0_5, AdcInput::none, SercomIo::none, SercomIo::none, 5, "pa05" }, // PA05 { TcOutput::none, TccOutput::tcc1_0E, AdcInput::adc0_6, AdcInput::none, SercomIo::none, SercomIo::none, 6, nullptr }, // PA06 driver STEP // PA06 { TcOutput::none, TccOutput::none, AdcInput::adc0_7, AdcInput::none, SercomIo::none, SercomIo::none, 7, nullptr }, // PA07 driver DIR// PA07 { TcOutput::none, TccOutput::none, AdcInput::adc0_8, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA08 driver EN // PA08 { TcOutput::none, TccOutput::none, AdcInput::adc0_9, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA09 driver EN { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA10 driver DIR { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA11 driver STEP { TcOutput::none, TccOutput::tcc2_0E, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, 12, "pa12" }, // PA12 #if SUPPORT_LIS3DH { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, 13, nullptr }, // PA13 accelerometer INT1 #else { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, 13, "pa13" }, // PA13 #endif { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA14 crystal { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA15 crystal #if SUPPORT_SPI_SENSORS { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::sercom1c, Nx, nullptr }, // PA16 SPI { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::sercom1c, SercomIo::none, Nx, nullptr }, // PA17 SPI { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA18 SPI #else { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::sercom1c, 0, "pa16" }, // PA16 { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::sercom1c, SercomIo::none, 1, "pa17" }, // PA17 { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, 2, "pa18" }, // PA18 #endif { TcOutput::tc4_1, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, 3, "pa19" }, // PA19 { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, "pa20" }, // PA20 { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, "pa21" }, // PA21 LDC1612 INT #if SUPPORT_I2C_SENSORS { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA22 I2C { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA23 I2C #else { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, "pa22" }, // PA22 (has TC0.0 on that pin but can't control the frequency well) { TcOutput::tc0_1, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, "pa23" }, // PA23 #endif { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, "pa24" }, // PA24 { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, "pa25" }, // PA25 { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA26 not on chip { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA27 CAN transceiver standby { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA28 LED 0 { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA29 not on chip { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA30 swclk { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA31 swdio // Port B { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PB00 not on chip { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PB01 not on chip { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PB02 USB interface (SERCOM5 pad 0) { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PB03 USB interface (SERCOM5 pad 1) { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PB04 not on chip { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PB05 not on chip { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PB06 not on chip { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PB07 not on chip { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, 8, "pb08" }, // PB08 { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, 9, "!^button0" }, // PB09 button recognised by bootloader // PB22/23 are used for CAN0, PB10/11 for CAN1 // Virtual pins #if SUPPORT_LIS3DH { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, "i2c.lis3dh" }, // LIS3DH sensor connected via I2C #endif #if SUPPORT_LDC1612 { TcOutput::none, TccOutput::none, AdcInput::ldc1612, AdcInput::none, SercomIo::none, SercomIo::none, Nx, "i2c.ldc1612" }, // LDC1612 sensor connected via I2C #endif }; constexpr size_t NumPins = ARRAY_SIZE(PinTable); constexpr size_t NumRealPins = 32 + 10; // 32 pins on port A (some missing), only PB08 and PB09 are brought out on this board constexpr size_t NumVirtualPins = SUPPORT_LIS3DH + SUPPORT_LDC1612; static_assert(NumPins == NumRealPins + NumVirtualPins); // Timer/counter used to generate step pulses and other sub-millisecond timings TcCount32 * const StepTc = &(TC2->COUNT32); constexpr IRQn StepTcIRQn = TC2_IRQn; constexpr unsigned int StepTcClockId = TC2_GCLK_ID; constexpr unsigned int StepTcNumber = 2; #define STEP_TC_HANDLER TC2_Handler // Available UART ports #define NUM_SERIAL_PORTS 1 constexpr IRQn Serial0_IRQn = SERCOM5_IRQn; // DMA channel assignments constexpr DmaChannel DmacChanTmcTx = 0; constexpr DmaChannel DmacChanTmcRx = 1; constexpr DmaChannel DmacChanAdc0Rx = 2; constexpr unsigned int NumDmaChannelsUsed = 4; // must be at least the number of channels used, may be larger. Max 12 on the SAMC21. // DMA priorities, higher is better. 0 to 3 are available. constexpr DmaPriority DmacPrioTmcTx = 0; constexpr DmaPriority DmacPrioTmcRx = 3; constexpr DmaPriority DmacPrioAdcRx = 2; // Interrupt priorities, lower means higher priority. 0 can't make RTOS calls. Only 0 to 3 are available. const NvicPriority NvicPriorityStep = 1; // step interrupt is next highest, it can preempt most other interrupts const NvicPriority NvicPriorityUart = 2; // serial driver makes RTOS calls const NvicPriority NvicPriorityPins = 2; // priority for GPIO pin interrupts const NvicPriority NvicPriorityI2C = 2; const NvicPriority NvicPriorityCan = 3; const NvicPriority NvicPriorityDmac = 3; // priority for DMA complete interrupts #endif /* SRC_CONFIG_SAMMYC21_H_ */
Can you help me get the TMC2209_support back?
Thanks for help guys
-
SAMMYC21 Configuring
My end goal is to leverage a single SAMMYC21 for x2 low current motor drivers and x2 analog inputs. These will be used to control two nozzle rotational axis and two pressure sensors on a pick and place head. This will replace the x2 Duet 1Tool boards I'm currently using for a more compact design.
Im currently trying to get the dual drivers working. So far Ive only modified the SAMMYC21.h
/* * SAMMYC21.h * * Created on: 23 May 2020 * Author: David */ #ifndef SRC_CONFIG_SAMMYC21_H_ #define SRC_CONFIG_SAMMYC21_H_ #include <Hardware/PinDescription.h> #define BOARD_TYPE_NAME "SAMMYC21" #define BOOTLOADER_NAME "SAMMYC21" // General features #define HAS_VREF_MONITOR 0 #define HAS_VOLTAGE_MONITOR 0 #define HAS_12V_MONITOR 0 #define HAS_CPU_TEMP_SENSOR 1 #define HAS_ADDRESS_SWITCHES 0 #define HAS_BUTTONS 1 #define USE_SERIAL_DEBUG 1 // Drivers configuration #define SUPPORT_DRIVERS 1 #define HAS_SMART_DRIVERS 0 #define HAS_STALL_DETECT 0 #define SINGLE_DRIVER 1 #define SUPPORT_SLOW_DRIVERS 1 #define SUPPORT_DELTA_MOVEMENT 0 #define DEDICATED_STEP_TIMER 1 #define SUPPORT_TMC51xx 0 #define SUPPORT_TMC2160 0 #define SUPPORT_TMC2660 0 #define SUPPORT_TMC22xx 0 constexpr size_t NumDrivers = 2; // #define USE_CCL 0 // USE_CCL also requires DIFFERENTIAL_STEPPER_OUTPUTS // #if USE_CCL // PortGroup * const StepPio = &(PORT->Group[1]); // the PIO that all the step pins are on // constexpr Pin EnablePins[NumDrivers] = { PortAPin(9) }; // constexpr Pin StepPins[NumDrivers] = { PortBPin(10) }; // constexpr Pin InvertedStepPins[NumDrivers] = { PortAPin(11) }; // constexpr Pin DirectionPins[NumDrivers] = { PortAPin(10) }; // // The SAMC21 can sink more current than it can source, therefore we use active low signals to drive external drivers // #define ACTIVE_HIGH_STEP 1 // 1 = active high, 0 = active low // #define ACTIVE_HIGH_DIR 0 // 1 = active high, 0 = active low // #define ACTIVE_HIGH_ENABLE 0 // 1 = active high, 0 = active low // #else PortGroup * const StepPio = &(PORT->Group[0]); // the PIO that all the step pins are on constexpr Pin EnablePins[NumDrivers] = { PortAPin(9), PortAPin(8) }; constexpr Pin StepPins[NumDrivers] = { PortAPin(11),PortAPin(6) }; constexpr Pin DirectionPins[NumDrivers] = { PortAPin(10), PortAPin(7) }; // PortGroup * const StepPio = &(PORT->Group[0]); // the PIO that all the step pins are on // constexpr Pin StepPins[NumDrivers] = { PortAPin(9), PortAPin(6) }; // constexpr Pin DirectionPins[NumDrivers] = { PortAPin(11), PortAPin(8) }; // constexpr Pin DriverDiagPins[NumDrivers] = { PortAPin(10), PortAPin(7) }; // The SAMC21 can sink more current than it can source, therefore we use active low signals to drive external drivers #define ACTIVE_HIGH_STEP 0 // 1 = active high, 0 = active low #define ACTIVE_HIGH_DIR 0 // 1 = active high, 0 = active low #define ACTIVE_HIGH_ENABLE 0 // 1 = active high, 0 = active low // #endif #define SUPPORT_THERMISTORS 1 #define SUPPORT_SPI_SENSORS 1 #define SUPPORT_I2C_SENSORS 1 #define SUPPORT_LIS3DH 1 #define SUPPORT_LDC1612 1 #define SUPPORT_DHT_SENSOR 0 #define SUPPORT_SDADC 0 #define USE_MPU 0 #define USE_CACHE 0 #define DIAG_SERCOM_NUMBER 5 // which SERCOM device we use for debugging output constexpr bool UseAlternateCanPins = true; constexpr size_t MaxPortsPerHeater = 1; constexpr size_t NumThermistorInputs = 2; constexpr float DefaultThermistorSeriesR = 2200.0; constexpr Pin TempSensePins[NumThermistorInputs] = { PortAPin(2), PortAPin(3) }; constexpr Pin CanStandbyPin = PortAPin(27); constexpr Pin ButtonPins[] = { PortBPin(9) }; // Diagnostic LEDs constexpr Pin LedPins[] = { PortAPin(28) }; constexpr bool LedActiveHigh = true; #if SUPPORT_SPI_SENSORS // Shared SPI using pins PA16,17,18. If changing this, also change the available pins in the pin table. constexpr uint8_t SspiSercomNumber = 1; constexpr uint32_t SspiDataInPad = 2; constexpr Pin SSPIMosiPin = PortAPin(16); constexpr GpioPinFunction SSPIMosiPinPeriphMode = GpioPinFunction::C; constexpr Pin SSPISclkPin = PortAPin(17); constexpr GpioPinFunction SSPISclkPinPeriphMode = GpioPinFunction::C; constexpr Pin SSPIMisoPin = PortAPin(18); constexpr GpioPinFunction SSPIMisoPinPeriphMode = GpioPinFunction::C; #endif #if SUPPORT_I2C_SENSORS // I2C using pins PA22,23. If changing this, also change the available pins in the pin table. constexpr uint8_t I2CSercomNumber = 3; constexpr Pin I2CSDAPin = PortAPin(22); constexpr GpioPinFunction I2CSDAPinPeriphMode = GpioPinFunction::C; constexpr Pin I2CSCLPin = PortAPin(23); constexpr GpioPinFunction I2CSCLPinPeriphMode = GpioPinFunction::C; #define I2C_HANDLER SERCOM3_Handler #endif #if SUPPORT_LIS3DH # define ACCELEROMETER_USES_SPI (0) // 0 if the accelerometer is connected via I2C, 1 if via SPI constexpr Pin Lis3dhInt1Pin = PortAPin(13); #endif #if SUPPORT_LDC1612 constexpr uint16_t LDC1612_I2CAddress = 0x2B; // pin 4 is tied high on the Grove board constexpr Pin LDC1612InterruptPin = PortAPin(21); #endif // Table of pin functions that we are allowed to use constexpr PinDescription PinTable[] = { // TC TCC ADC SDADC SERCOM in SERCOM out Exint PinName // Port A { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA00 not on board { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA01 not on board { TcOutput::none, TccOutput::none, AdcInput::adc0_0, AdcInput::none, SercomIo::none, SercomIo::none, Nx, "temp0" }, // PA02 thermistor { TcOutput::none, TccOutput::none, AdcInput::adc0_1, AdcInput::none, SercomIo::none, SercomIo::none, Nx, "temp1" }, // PA03 thermistor { TcOutput::none, TccOutput::tcc0_0E, AdcInput::adc0_4, AdcInput::none, SercomIo::none, SercomIo::none, 4, "pa04" }, // PA04 { TcOutput::none, TccOutput::none, AdcInput::adc0_5, AdcInput::none, SercomIo::none, SercomIo::none, 5, "pa05" }, // PA05 { TcOutput::none, TccOutput::tcc1_0E, AdcInput::adc0_6, AdcInput::none, SercomIo::none, SercomIo::none, 6, nullptr }, // PA06 driver STEP // PA06 { TcOutput::none, TccOutput::none, AdcInput::adc0_7, AdcInput::none, SercomIo::none, SercomIo::none, 7, nullptr }, // PA07 driver DIR// PA07 { TcOutput::none, TccOutput::none, AdcInput::adc0_8, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA08 driver EN // PA08 { TcOutput::none, TccOutput::none, AdcInput::adc0_9, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA09 driver EN { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA10 driver DIR { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA11 driver STEP { TcOutput::none, TccOutput::tcc2_0E, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, 12, "pa12" }, // PA12 #if SUPPORT_LIS3DH { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, 13, nullptr }, // PA13 accelerometer INT1 #else { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, 13, "pa13" }, // PA13 #endif { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA14 crystal { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA15 crystal #if SUPPORT_SPI_SENSORS { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::sercom1c, Nx, nullptr }, // PA16 SPI { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::sercom1c, SercomIo::none, Nx, nullptr }, // PA17 SPI { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA18 SPI #else { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::sercom1c, 0, "pa16" }, // PA16 { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::sercom1c, SercomIo::none, 1, "pa17" }, // PA17 { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, 2, "pa18" }, // PA18 #endif { TcOutput::tc4_1, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, 3, "pa19" }, // PA19 { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, "pa20" }, // PA20 { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, "pa21" }, // PA21 LDC1612 INT #if SUPPORT_I2C_SENSORS { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA22 I2C { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA23 I2C #else { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, "pa22" }, // PA22 (has TC0.0 on that pin but can't control the frequency well) { TcOutput::tc0_1, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, "pa23" }, // PA23 #endif { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, "pa24" }, // PA24 { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, "pa25" }, // PA25 { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA26 not on chip { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA27 CAN transceiver standby { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA28 LED 0 { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA29 not on chip { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA30 swclk { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PA31 swdio // Port B { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PB00 not on chip { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PB01 not on chip { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PB02 USB interface (SERCOM5 pad 0) { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PB03 USB interface (SERCOM5 pad 1) { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PB04 not on chip { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PB05 not on chip { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PB06 not on chip { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, nullptr }, // PB07 not on chip { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, 8, "pb08" }, // PB08 { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, 9, "!^button0" }, // PB09 button recognised by bootloader // PB22/23 are used for CAN0, PB10/11 for CAN1 // Virtual pins #if SUPPORT_LIS3DH { TcOutput::none, TccOutput::none, AdcInput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, "i2c.lis3dh" }, // LIS3DH sensor connected via I2C #endif #if SUPPORT_LDC1612 { TcOutput::none, TccOutput::none, AdcInput::ldc1612, AdcInput::none, SercomIo::none, SercomIo::none, Nx, "i2c.ldc1612" }, // LDC1612 sensor connected via I2C #endif }; constexpr size_t NumPins = ARRAY_SIZE(PinTable); constexpr size_t NumRealPins = 32 + 10; // 32 pins on port A (some missing), only PB08 and PB09 are brought out on this board constexpr size_t NumVirtualPins = SUPPORT_LIS3DH + SUPPORT_LDC1612; static_assert(NumPins == NumRealPins + NumVirtualPins); // Timer/counter used to generate step pulses and other sub-millisecond timings TcCount32 * const StepTc = &(TC2->COUNT32); constexpr IRQn StepTcIRQn = TC2_IRQn; constexpr unsigned int StepTcClockId = TC2_GCLK_ID; constexpr unsigned int StepTcNumber = 2; #define STEP_TC_HANDLER TC2_Handler // Available UART ports #define NUM_SERIAL_PORTS 1 constexpr IRQn Serial0_IRQn = SERCOM5_IRQn; // DMA channel assignments constexpr DmaChannel DmacChanTmcTx = 0; constexpr DmaChannel DmacChanTmcRx = 1; constexpr DmaChannel DmacChanAdc0Rx = 2; constexpr unsigned int NumDmaChannelsUsed = 4; // must be at least the number of channels used, may be larger. Max 12 on the SAMC21. // DMA priorities, higher is better. 0 to 3 are available. constexpr DmaPriority DmacPrioTmcTx = 0; constexpr DmaPriority DmacPrioTmcRx = 3; constexpr DmaPriority DmacPrioAdcRx = 2; // Interrupt priorities, lower means higher priority. 0 can't make RTOS calls. Only 0 to 3 are available. const NvicPriority NvicPriorityStep = 1; // step interrupt is next highest, it can preempt most other interrupts const NvicPriority NvicPriorityUart = 2; // serial driver makes RTOS calls const NvicPriority NvicPriorityPins = 2; // priority for GPIO pin interrupts const NvicPriority NvicPriorityI2C = 2; const NvicPriority NvicPriorityCan = 3; const NvicPriority NvicPriorityDmac = 3; // priority for DMA complete interrupts #endif /* SRC_CONFIG_SAMMYC21_H_ */
Having done that and nothing else, DWC shows x2 drivers for the SAMMYC21
That all seems good, but when I attempt to actually drive the new 1 Drive there is not step activity. The 0 Drive pulses the step as expected.
Is there any other modifications to make to the SAMMYC21. h file or any other file in the project?
Thanks for any input