Browse Source

Default DAC values for RigidBoard V2

jaysonkelly 8 years ago
parent
commit
713931338a
2 changed files with 7 additions and 1 deletions
  1. 1
    0
      Marlin/pins_RIGIDBOARD_V2.h
  2. 6
    1
      Marlin/stepper_dac.cpp

+ 1
- 0
Marlin/pins_RIGIDBOARD_V2.h View File

@@ -44,3 +44,4 @@
44 44
 #define DAC_STEPPER_GAIN     1 // value of 1 here sets gain of 2
45 45
 #define DAC_DISABLE_PIN     42 // set low to enable DAC
46 46
 #define DAC_OR_ADDRESS    0x01
47
+#define DAC_STEPPER_DFLT { 70, 80, 90, 80 } // Default values for drive strength percent

+ 6
- 1
Marlin/stepper_dac.cpp View File

@@ -49,7 +49,7 @@
49 49
 
50 50
   bool dac_present = false;
51 51
   const uint8_t dac_order[NUM_AXIS] = DAC_STEPPER_ORDER;
52
-  uint16_t dac_channel_pct[XYZE];
52
+  uint16_t dac_channel_pct[XYZE] = DAC_STEPPER_DFLT;
53 53
 
54 54
   int dac_init() {
55 55
     #if PIN_EXISTS(DAC_DISABLE)
@@ -64,6 +64,11 @@
64 64
 
65 65
     mcp4728_setVref_all(DAC_STEPPER_VREF);
66 66
     mcp4728_setGain_all(DAC_STEPPER_GAIN);
67
+    
68
+    if (mcp4728_getDrvPct(0) < 1 || mcp4728_getDrvPct(1) < 1 || mcp4728_getDrvPct(2) < 1 || mcp4728_getDrvPct(3) < 1 ) {
69
+      mcp4728_setDrvPct(dac_channel_pct);
70
+      mcp4728_eepromWrite();
71
+    }
67 72
 
68 73
     return 0;
69 74
   }

Loading…
Cancel
Save