Skip to content

Commit

Permalink
TMC9660: Update reg app maps and examples
Browse files Browse the repository at this point in the history
Generated by TMC-XML/tools/tmcpycode.py commit 53539c5
via:

"tools/tmcpycode.py",
    "./descriptions/ic/TMC9660.xml",
    "--outdir", "../PyTrinamic/pytrinamic/ic/TMC9660"

"tools/tmcpycode.py",
    "./descriptions/ic/TMCTR5W_ADC.xml",
    "--outdir", "../PyTrinamic/pytrinamic/ic/TMC9660"

"tools/tmcpycode.py",
    "./descriptions/ic/TMCTR5W_SYS_CTRL.xml",
    "--outdir", "../PyTrinamic/pytrinamic/ic/TMC9660"
  • Loading branch information
trinamic-bp committed Jan 14, 2025
1 parent 9ba2916 commit 97453e2
Show file tree
Hide file tree
Showing 5 changed files with 1,279 additions and 3,447 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@

tmc9660 = TMC9660(my_interface)

tmc9660.write(TMC9660.MCC.MOTOR_CONFIG.TYPE.choice["NONE No motor"])
tmc9660.write(TMC9660.MCC.MOTOR_CONFIG.TYPE.choice.BLDC)
tmc9660.write(TMC9660.MCC.MOTOR_CONFIG.N_POLE_PAIRS, 4)

for _ in range(20):
print(f"I0 = {tmc9660.read(TMC9660.MCC.ADC_I1_I0_SCALED.ADC_SCALED_I0)}")
print(f"I1 = {tmc9660.read(TMC9660.MCC.ADC_I1_I0_SCALED.ADC_SCALED_I1)}")
print(f"I0 = {tmc9660.read(TMC9660.MCC.ADC_I1_I0_SCALED.I0)}")
print(f"I1 = {tmc9660.read(TMC9660.MCC.ADC_I1_I0_SCALED.I1)}")
print(f"I2 = {tmc9660.read(TMC9660.MCC.ADC_I3_I2_SCALED.I2)}")
time.sleep(0.2)
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@

tmc9660_eval = TMC9660_3PH_eval(my_interface)

tmc9660_eval.write(TMC9660.MCC.MOTOR_CONFIG.TYPE.choice["BLDC Three phase BLDC motor"])
tmc9660_eval.write(TMC9660.MCC.MOTOR_CONFIG.TYPE.choice.BLDC)
tmc9660_eval.write(TMC9660.MCC.MOTOR_CONFIG.N_POLE_PAIRS, 4)

for _ in range(20):
print(f"I0 = {tmc9660_eval.read(TMC9660.MCC.ADC_I1_I0_SCALED.ADC_SCALED_I0)}")
print(f"I1 = {tmc9660_eval.read(TMC9660.MCC.ADC_I1_I0_SCALED.ADC_SCALED_I1)}")
print(f"I0 = {tmc9660_eval.read(TMC9660.MCC.ADC_I1_I0_SCALED.I0)}")
print(f"I1 = {tmc9660_eval.read(TMC9660.MCC.ADC_I1_I0_SCALED.I1)}")
print(f"I2 = {tmc9660_eval.read(TMC9660.MCC.ADC_I3_I2_SCALED.I2)}")
time.sleep(0.2)
Loading

0 comments on commit 97453e2

Please sign in to comment.