资源简介
Atom-TMC2208Pilot.zip,在Arduino上运行的应用程序,通过UART设置和监视TMC2208。设计为使用SmoothIware固件。小精灵,atom是一个用web技术构建的开源文本编辑器。
代码片段和文件信息
#include “main.h“
uint16_t getMicrostep (uint8_t mres){
switch(mres) {
case 0: return 256;
case 1: return 128;
case 2: return 64;
case 3: return 32;
case 4: return 16;
case 5: return 8;
case 6: return 4;
case 7: return 2;
case 8: return 0;
}
return 0;
}
void applySettings() {
Serial.println(“applySettings“);
// before call driver wait they are not busy
while (DriversBusy) {}
DriversBusy = true;
for (int i = 0; i <= 4; i++) {
//if driver disables go to next
if (!use_tmc[i]) continue;
// enable serial RX before call
tmc_sw[i]->listen();
// Initiate the SoftwareSerial
TMC2208Stepper *tmc = driver[i];
// Setup de driver
tmc->toff(0x0); // Disable driver
tmc->pdn_disable(1); // Use PDN/UART pin for communication
tmc->I_scale_analog(0); // Adjust current from the registers
tmc->rms_current(defaults_amps[i]); // Set driver current
tmc->microsteps(defaults_microsteps[i]); // Set the defaults_microsteps
tmc->intpol(defaults_256_step_interpol[i]); // enable or disable 256 microsteps interpolation
tmc->mstep_reg_select(true); // enable the microsteps settings by register
tmc->en_spreadCycle(defaults_en_spreadCycle[i]); // Set the spreadCycle
tmc->toff(defaults_toff[i]); // Enable driver or setup the spreadCycle value
}
DriversBusy = false;
}
bool checkConfig() {
Serial.println(“checkConfig“);
// before call driver wait they are not busy
while (DriversBusy) {}
DriversBusy = true;
for (int i = 0; i <= 4; i++) {
//if driver disables go to next
if (!use_tmc[i]) continue;
// enable serial RX before call
tmc_sw[i]->listen();
// Initiate the SoftwareSerial
TMC2208Stepper *tmc = driver[i];
conf_checked[i] =
tmc->pdn_disable() == 1 &&
tmc->I_scale_analog() == 0 &&
tmc->microsteps() == defaults_microsteps[i] &&
tmc->intpol() == defaults_256_step_interpol[i] &&
tmc->mstep_reg_select() == 1 &&
tmc->en_spreadCycle() == defaults_en_spreadCycle[i] &&
tmc->toff() == defaults_toff[i];
Serial.print(“driver “);Serial.print(i+1);Serial.print(“ check control is : “);
Serial.println(conf_checked[i]==1?“true“:“false“);
}
DriversBusy = false;
for (int i = 0; i <= 4; i++) {
if (!use_tmc[i]) continue;
if (!conf_checked[i]) return false;
}
return true;
}
void readData() {
DriversBusy = true;
for (int i = 0; i <= 4; i++) {
//if driver disables go to next
if (!use_tmc[i]) continue;
// enable reception on this serial else no read value
tmc_sw[i]->listen();
// read the registers for the driver
uint32_t tempValue;
TMC2208Stepper *tmc = driver[i];
delay(50);
tmc->DRV_STATUS(&tempValue);
if (tempValue !=0 ) reg_drv_status[i] = tempValue;
delay(50);
tmc->CHOPCONF(&tempValue);
if (tempValue !=0 ) reg_chop_conf[i] = tempValue;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-08-30 20:59 TMC2208Pilot-master\
文件 399 2018-08-30 20:59 TMC2208Pilot-master\.gitignore
文件 1357 2018-08-30 20:59 TMC2208Pilot-master\.travis.yml
文件 35147 2018-08-30 20:59 TMC2208Pilot-master\LICENSE
文件 1645 2018-08-30 20:59 TMC2208Pilot-master\README.md
文件 26 2018-08-30 20:59 TMC2208Pilot-master\_config.yml
目录 0 2018-08-30 20:59 TMC2208Pilot-master\docs\
文件 1227 2018-08-30 20:59 TMC2208Pilot-master\docs\SmoothieWare Switch Code.txt
文件 895819 2018-08-30 20:59 TMC2208Pilot-master\docs\TUTO TMC2208Pilot Arduino EN.pdf
文件 930878 2018-08-30 20:59 TMC2208Pilot-master\docs\TUTO TMC2208Pilot Arduino FR.pdf
文件 951613 2018-08-30 20:59 TMC2208Pilot-master\docs\TUTO TMC2208Pilot NodeMCU EN.pdf
文件 950890 2018-08-30 20:59 TMC2208Pilot-master\docs\TUTO TMC2208Pilot NodeMCU FR.pdf
文件 560104 2018-08-30 20:59 TMC2208Pilot-master\docs\WIRING.pdf
目录 0 2018-08-30 20:59 TMC2208Pilot-master\lib\
文件 868 2018-08-30 20:59 TMC2208Pilot-master\lib\readme.txt
目录 0 2018-08-30 20:59 TMC2208Pilot-master\media\
文件 56335 2018-08-30 20:59 TMC2208Pilot-master\media\Basic_Wiring.JPG
文件 66700 2018-08-30 20:59 TMC2208Pilot-master\media\Capture3.JPG
目录 0 2018-08-30 20:59 TMC2208Pilot-master\media\Tips\
文件 66700 2018-08-30 20:59 TMC2208Pilot-master\media\Tips\Arduino Mount.JPG
文件 99992 2018-08-30 20:59 TMC2208Pilot-master\media\Tips\Node MCU Mount.jpg
文件 173984 2018-08-30 20:59 TMC2208Pilot-master\media\Wiring Arduino Nano.JPG
文件 188772 2018-08-30 20:59 TMC2208Pilot-master\media\Wiring NodeMCU.JPG
文件 251687 2018-08-30 20:59 TMC2208Pilot-master\media\Wiring Shema.JPG
文件 9810 2018-08-30 20:59 TMC2208Pilot-master\media\basic_wiring.png
文件 568402 2018-08-30 20:59 TMC2208Pilot-master\media\photo_drv.JPG
文件 2441191 2018-08-30 20:59 TMC2208Pilot-master\media\photo_nodemcu.png
文件 822 2018-08-30 20:59 TMC2208Pilot-master\platformio.ini
目录 0 2018-08-30 20:59 TMC2208Pilot-master\src\
文件 1697 2018-08-30 20:59 TMC2208Pilot-master\src\conf.h
文件 9037 2018-08-30 20:59 TMC2208Pilot-master\src\main.cpp
............此处省略1个文件信息
相关资源
- source insight 4.0 仿atom暗色主题
- CE Moore Atomic Energy Levels Vol 1
- AtomicAlpha.zip
- atomvpn.rar
- EBSD分析工具-atom
- AtomicBrowser(AVI).exe
- atom-x64-windows.zip
- atom编译器Windows版本
- SpringBoot+Atomikos分布式事务及多数据源
- activate-power-mode 插件
- 基于STM8定制轻量操作系统Aatomthreads官
- atom的linter-gcc插件集合
- source insight 4.0 主题 仿Atom
- 原子分解算法Atomizer
-
Atomic-la
yer and Crystal-Orientation Resolv -
Size Effects for the Adsorption of Alkali me
- activate-power-mode
- mp4格式分析工具集合包
- Source Insight 4.0 暗色主题,仿Atom
- vtkAtomic.h 正确版
- atom插件linter和linter-gcc
评论
共有 条评论