This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This sketch aims to calculate a proper canbus timing config for the SAME51 Bosch M_CAN Variant. | |
Order of operations: | |
1 Calculate NBRP to keep time quanta within whole divisions of bit time | |
(some odd non integer kbaud timings will be off ~1%) | |
2 Calculate NTSEG1 using requested sample point, to whole integer | |
3 Increment NSJW if NTSEG1 is not a whole number or within limits and try again | |
4 Calculate NTSEG2 once NTSEG1 is done, | |
5 Check limits and try prescaler again |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <TMCStepper.h> | |
#define MAX_SPEED 20 // In timer value | |
#define MIN_SPEED 300 | |
#define STALL_VALUE 100 // [0..255] | |
#define EN_PIN PC1 // Enable | |
#define DIR_PIN PC4 // Direction | |
#define STEP_PIN PE12 // Step |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SPI.h> | |
#include <TMCStepper.h> | |
// Uses hardware Serial for Arduino UNO | |
// Wiring Arduino -> TMC5130-BOB | |
// 11 (MOSI) -> SDI | |
// 12 (MISO) -> SDO | |
// 13 (SCK) -> SCK | |
// 10 -> CSN | |
// 9 -> DRV_EN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*************************************************** | |
This is our GFX example for the Adafruit ILI9341 Breakout and Shield | |
----> http://www.adafruit.com/products/1651 | |
Check out the links above for our tutorials and wiring diagrams | |
These displays use SPI to communicate, 4 or 5 pins are required to | |
interface (RST is optional) | |
Adafruit invests time and resources providing this open source code, | |
please support Adafruit and open-source hardware by purchasing | |
products from Adafruit! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Author Teemu Mäntykallio | |
* Initializes the library and turns the motor in alternating directions. | |
*/ | |
#include <SPI.h> | |
#define EN_PIN PA5 // Nano v3: 16 Mega: 38 //enable (CFG6) | |
#define DIR_PIN PA9 // 19 55 //direction | |
#define STEP_PIN PC9 // 18 54 //step | |
#define CS_PIN PB9 // 17 64 //chip select |