@dc42
Thanks David, 3.6 beta works, 3.5.3 doesn't. M260.2 only works on beta FW?
Posts made by wayneosdias
-
RE: M118 send hex values
-
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
-
RE: T1LC reset not working as expected
@droftarts I'm not in a position to to check HW versions, but the bootloaders are indeed different, 2.8 vs 2.3. The first LC I got the beginning of the year and the 2nd this past week. Both LC are the same layout, but different versions as I recall the new LC mounting thru holes are enig plated and the older LC mounting thru holes are silk screen. Heres the M122 for both;
M122 B20 Diagnostics for board 20: Duet TOOL1LC rev 1.1 or later firmware version 3.5.3 (2024-09-17 14:35:31) Bootloader ID: SAMC21 bootloader version 2.3 (2021-01-26b1
M122 B21 Diagnostics for board 21: Duet TOOL1LC rev 1.1 or later firmware version 3.5.3 (2024-09-17 14:35:31) Bootloader ID: SAMC21 bootloader version 2.8 (2023-07-25)
-
RE: T1LC reset not working as expected
@oliof M952 has always worked perfectly, but you need the correct 'B'.
@dc42 Ive tried the sequence many more times and I still cannot force a HW reset of the LC ID, CAN disconnected or connected. I can indeed perform HW ID resets on the XDs and HCs, but not the LC as outlined. Im running 3.5.3 system wide.
I never thought to look at the Obj Model for boards, perfect!
Thanks for the input guys.
-
T1LC reset not working as expected
Short story; below doesn't seem to work for resetting 1LC CAN address;
The board will do a factory reset if you power it up with both buttons held down. The CAN address will be reset to the default (121), the CAN bus timing will also be reset to default (1Mbps), and the bootloader will request a firmware update.Long story;
I'm running x3 XDs, x2 LCs, x1 SammyC with a 6HC mobo. The Duet/CAN system has been working really well, but I noticed the LC reset fxn wasn't working. When adding a new LC, I isolated the CAN from the 6HC to new 1LC to update the LC FW from 3.5.1 to 3.5.3. FW update went fine, but I found the new LC wouldn't respond to the new address B21 I assigned it (40s for the XDs, 50s for the HCs and 20s for the LCs). Despite that, CAN between the 6HC and LC was still active, with red LED syncd between the two. I assumed I screwed up the re assignment and attempted to HW reset via holding the 1LCs btns while powering on. I tried this several times and the 1LC Id never reverted back to the default B121. It kept whatever Id I miss programmed and contd to sync w the 6HC.I started iterating thru IDs to try and find it when I remembered I may have accidently ID'd it as one of the 1HCLs I removed. Sure enough it was ID'd as 51. I fixed the issue and everything is running fine. After that I attempted to test the reset the either of the LC IDs via the btn press at power up and it doesnt seem to reset the address...
-
RE: DWC Closed Loop no Autotune
@droftarts Understood, thanks again, prevented me from wasting a day chasing my tail
-
RE: DWC Closed Loop no Autotune
@droftarts Thanks for the help, Any ideas when it may be up and going?
-
RE: DWC Closed Loop no Autotune
@droftarts I uploaded the file at your link and reboot everything, autotune still not there.
-
RE: 1HCL+Magnetic encoder issues
@dc42
Thanks for letting me know I have 4 of these, but cant track one of them down. Of the 3 I have on hand 2/3 are oreinted incorrectly. 03/171 is correct.
-
DWC Closed Loop no Autotune
I cant find the autotune Fx in ClosedLoopTuning-3.5.1
Ive tried installing ClosedLoopTuning-3.6.0-beta.1, but get a false FW error;
Otherwise everything seems to work fine. Id really like to use the autotuning feature.
M115 FIRMWARE_NAME: RepRapFirmware for Duet 3 MB6HC FIRMWARE_VERSION: 3.5.3 ELECTRONICS: Duet 3 MB6HC v1.01 FIRMWARE_DATE: 2024-09-18 11:27:36 M115 B50.0 Duet EXP1HCL rev 1.0a or earlier firmware version 3.5.3 (2024-09-17 14:35:42)
-
RE: 1HCL+Magnetic encoder issues
Success! I wasw able to pry up the header shroud of the Mag board and flip it and Im getting activity. BTW the silkscreen can be seen w the shroud removed, and it was indeed oriented the correct way. Either way something is 180 out.
Now just gotta sort out the movement issues, Thanks for the TIps guys!
-
RE: 1HCL+Magnetic encoder issues
@dc42 said in 1HCL+Magnetic encoder issues:
@wayneosdias are you sure that you don't have one of the connectors reversed? Or could the cable have been made incorrectly,
Looks like the connector is reversed OR the Mag header is 180. There are no silkscreen marking to orient the header. Anyway I just ohmed out the 1HCL to the mag board with the ribbon able connected and;
1HCL GND to Mag N = 0.3R
1HCL 5V to Mag A = 0.3R
1HCL N_INPUT to Mag GND = 0.3R
1HCL A to Mag NC = 0.3RThis is the cable that was supplied with Mag board and here is the mag board
-
RE: 1HCL+Magnetic encoder issues
Looks like the Mag board is no good.
If I pull the ribbon cable between the mag board the 1HCL I get what you'd expect, CS CLK and MOSI all working.
If I plug the mag board in I CS never gets asserted and the MISO line flat.
Am I off about this, anything i can try?
Thanks -
1HCL+Magnetic encoder issues
I cant seem to run the calibration. I keep getting the following error message
Below is the full config.g file. I basically eliminated everything except for the motor config.
M115 FIRMWARE_NAME: RepRapFirmware for Duet 3 MB6HC FIRMWARE_VERSION: 3.5.3 ELECTRONICS: Duet 3 MB6HC v1.01 FIRMWARE_DATE: 2024-09-18 11:27:36
M115 B50 Duet EXP1HCL rev 1.0a or earlier firmware version 3.5.3 (2024-09-17 14:35:42)
M550 P"BBE PNP"; set name G90 ; absolute coordinates G4 S2 ; wait for expansion boards to start M569.1 P50.0 T3 E1:2 R100 I0 D0 ; Configure the Duet 3 Expansion 1HCL board at CAN address 50 with a Duet 3 magnetic encoder, warn if 1 fullstep threshold exceeded, error if 2 full steps threshold exceeded. M569 P50.0 D4 S1 R1; Configure the motor on the Duet 3 Expansion 1HCL controller at can address 50 as being in closed-loop drive mode (D4) and not reversed (S1) M584 X50.0 M350 X16 M92 X40.00 M566 X900.00 M906 X800
Any help is appreciated
-
RE: Reading general-purpose inputs in Duet Mini 5+ returns null?
@jwilo
You should prolly add the config to see what youre working with. -
1HCL + LDO 0.9
I bought some 1HCL and https://www.filastruder.com/products/ldo-stepper-motors-with-encoder-for-closed-loop . I didn't realize these motors are 0.9.
I checked the filastruda listing again; Duet3D has tested these with the E3D Toolchanger on the X/Y axis with a 1HCL control board, and found they worked well.
But recall per the Duet site re 1HCL and 0.9 motors; We advise against using 0.9deg motors because the maximum speed will be reduced. The positioning accuracy in closed-loop mode depends on the resolution of the encoder, not on the degrees/step of the motor.
Is there a verdict on this? The application is for Z- neg head on a pic and place machine. The original application had open loop drivers, but lacked auto tool changing. New application will have tool changing and torque is critical.
thanks for any insights
Wayne -
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.
-
Rating Duet distributers/resalers?
Is this worthwhile to the community? I've been very pleased with one reseller and very disappointed with the another when sourcing Duet products. Before calling out names I want to make sure that it is not bad form. I know I would appreciate a heads up for trusted suppliers and wish I could have avoided one in particular.