Example #1
0
 def __init__(self, connection):
     self.connection = connection
     self.tmc4671_reg = TMC4671_register()
     self.tmc4671_ms = TMC4671_mask_shift()
import time
import PyTrinamic
from PyTrinamic.connections.serial_tmcl_interface import serial_tmcl_interface
from PyTrinamic.evalboards.TMC4671_eval import TMC4671_eval
from PyTrinamic.ic.TMC4671.TMC4671_register import TMC4671_register
from PyTrinamic.ic.TMC4671.TMC4671_mask_shift import TMC4671_mask_shift

PyTrinamic.showInfo()
PyTrinamic.showAvailableComPorts()

myInterface = serial_tmcl_interface('COM5')
tmc4671_eval = TMC4671_eval(myInterface)
tmc4671_eval.showChipInfo()

tmc4671_reg = TMC4671_register()
tmc4671_ms = TMC4671_mask_shift()

" configure TMC4671 for a BLDC motor with ABN-Encoder "

" Motor type &  PWM configuration "
myInterface.writeMC(tmc4671_reg.MOTOR_TYPE_N_POLE_PAIRS, 0x00030004)
myInterface.writeMC(tmc4671_reg.PWM_POLARITIES, 0x00000000)
myInterface.writeMC(tmc4671_reg.PWM_MAXCNT, int(0x00000F9F))
myInterface.writeMC(tmc4671_reg.PWM_BBM_H_BBM_L, 0x00000505)
myInterface.writeMC(tmc4671_reg.PWM_SV_CHOP, 0x00000007)

" ADC configuration "
myInterface.writeMC(tmc4671_reg.ADC_I_SELECT, 0x18000100)
myInterface.writeMC(tmc4671_reg.dsADC_MCFG_B_MCFG_A, 0x00100010)
myInterface.writeMC(tmc4671_reg.dsADC_MCLK_A, 0x20000000)
myInterface.writeMC(tmc4671_reg.dsADC_MCLK_B, 0x00000000)
Example #3
0
 def __init__(self, parent):
     self.parent = parent
     self.tmc4671_reg = TMC4671_register()
     self.tmc4671_var = TMC4671_register_variant()
     self.tmc4671_ms = TMC4671_mask_shift()