Procházet zdrojové kódy

Get FolgerTech i3-2020 working again with 32-bit platforms (#7944)

Setup FolgerTech i3-2020 Configuration files as a reference platform for
32-Bit work.

Also fix MAX7219 debug lights on 32-bit platforms.
Roxy-3D před 7 roky
rodič
revize
0e260c6c1d

+ 8
- 7
Marlin/src/config/examples/Folger Tech/i3-2020/Configuration.h Zobrazit soubor

@@ -119,12 +119,13 @@
119 119
 // The following define selects which electronics board you have.
120 120
 // Please choose the name from boards.h that matches your setup
121 121
 #ifndef MOTHERBOARD
122
-  #define MOTHERBOARD BOARD_RAMPS_14_EFB
122
+  #define MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB   // For people switching over to the Panucatt Re-ARM board
123
+//#define MOTHERBOARD BOARD_RAMPS_14_EFB          // For unmodified printers using Atmega-2560 and RAMPS boards.
123 124
 #endif
124 125
 
125 126
 // Optional custom name for your RepStrap or other custom machine
126 127
 // Displayed in the LCD "Ready" message
127
-#define CUSTOM_MACHINE_NAME "FT-2020"
128
+#define CUSTOM_MACHINE_NAME "FT-2020 v2"
128 129
 
129 130
 // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines)
130 131
 // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4)
@@ -777,15 +778,15 @@
777 778
 // @section machine
778 779
 
779 780
 // The size of the print bed
780
-#define X_BED_SIZE 207
781
-#define Y_BED_SIZE 182
781
+//#define X_BED_SIZE 207    // For now...  use the old method of X_MIN_POS and X_MAX_POS to set X size
782
+//#define Y_BED_SIZE 182    // For now...  use the old method of Y_MIN_POS and Y_MAX_POS to set Y size
782 783
 
783 784
 // Travel limits (mm) after homing, corresponding to endstop positions.
784 785
 #define X_MIN_POS 6
785 786
 #define Y_MIN_POS 3
786 787
 #define Z_MIN_POS 0
787
-#define X_MAX_POS X_BED_SIZE
788
-#define Y_MAX_POS Y_BED_SIZE
788
+#define X_MAX_POS 207
789
+#define Y_MAX_POS 182
789 790
 #define Z_MAX_POS 175
790 791
 
791 792
 // If enabled, axes won't move below MIN_POS in response to movement commands.
@@ -1037,7 +1038,7 @@
1037 1038
 //
1038 1039
 // M100 Free Memory Watcher
1039 1040
 //
1040
-#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
1041
+//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
1041 1042
 
1042 1043
 //
1043 1044
 // G20/G21 Inch mode support

+ 8
- 4
Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h Zobrazit soubor

@@ -1391,11 +1391,15 @@
1391 1391
  * Fully assembled MAX7219 boards can be found on the internet for under $2(US).
1392 1392
  * For example, see https://www.ebay.com/sch/i.html?_nkw=332349290049
1393 1393
  */
1394
-//#define MAX7219_DEBUG
1394
+#define MAX7219_DEBUG
1395 1395
 #if ENABLED(MAX7219_DEBUG)
1396
-  #define MAX7219_CLK_PIN   64  // 77 on Re-ARM       // Configuration of the 3 pins to control the display
1397
-  #define MAX7219_DIN_PIN   57  // 78 on Re-ARM
1398
-  #define MAX7219_LOAD_PIN  44  // 79 on Re-ARM
1396
+//#define MAX7219_CLK_PIN   64  // on RAMPS       // Configuration of the 3 pins to control the display
1397
+//#define MAX7219_DIN_PIN   57  // on RAMPS
1398
+//#define MAX7219_LOAD_PIN  44  // on RAMPS
1399
+
1400
+  #define MAX7219_CLK_PIN   77 // on Re-ARM       // Configuration of the 3 pins to control the display
1401
+  #define MAX7219_DIN_PIN   78 // on Re-ARM
1402
+  #define MAX7219_LOAD_PIN  79 // on Re-ARM
1399 1403
 
1400 1404
   /**
1401 1405
    * Sample debug features

+ 31
- 6
Marlin/src/feature/Max7219_Debug_LEDs.cpp Zobrazit soubor

@@ -63,18 +63,38 @@ static uint8_t LEDs[8] = { 0 };
63 63
 
64 64
 void Max7219_PutByte(uint8_t data) {
65 65
   for (uint8_t i = 8; i--;) {
66
-    WRITE(MAX7219_CLK_PIN, LOW);       // tick
67
-    WRITE(MAX7219_DIN_PIN, (data & 0x80) ? HIGH : LOW);  // send 1 or 0 based on data bit
68
-    WRITE(MAX7219_CLK_PIN, HIGH);      // tock
66
+    #ifdef CPU_32_BIT                    // The 32-bit processors are so fast, a small delay in the code is needed
67
+                                         // to let the signal wires stabilize.
68
+      WRITE(MAX7219_CLK_PIN, LOW);       // tick
69
+      delayMicroseconds(5);
70
+      WRITE(MAX7219_DIN_PIN, (data & 0x80) ? HIGH : LOW);  // send 1 or 0 based on data bit
71
+      delayMicroseconds(5);
72
+      WRITE(MAX7219_CLK_PIN, HIGH);      // tock
73
+      delayMicroseconds(5);
74
+    #else
75
+      WRITE(MAX7219_CLK_PIN, LOW);       // tick
76
+      WRITE(MAX7219_DIN_PIN, (data & 0x80) ? HIGH : LOW);  // send 1 or 0 based on data bit
77
+      WRITE(MAX7219_CLK_PIN, HIGH);      // tock
78
+    #endif
79
+
69 80
     data <<= 1;
70 81
   }
71 82
 }
72 83
 
73 84
 void Max7219(const uint8_t reg, const uint8_t data) {
74 85
   WRITE(MAX7219_LOAD_PIN, LOW);  // begin
86
+  #ifdef CPU_32_BIT              // The 32-bit processors are so fast, a small delay in the code is needed
87
+    delayMicroseconds(5);        // to let the signal wires stabilize.
88
+  #endif
75 89
   Max7219_PutByte(reg);          // specify register
76 90
   Max7219_PutByte(data);         // put data
91
+  #ifdef CPU_32_BIT
92
+    delayMicroseconds(5);
93
+  #endif
77 94
   WRITE(MAX7219_LOAD_PIN, LOW);  // and tell the chip to load the data
95
+  #ifdef CPU_32_BIT
96
+    delayMicroseconds(5);
97
+  #endif
78 98
   WRITE(MAX7219_LOAD_PIN, HIGH);
79 99
 }
80 100
 
@@ -135,6 +155,7 @@ void Max7219_init() {
135 155
   SET_OUTPUT(MAX7219_CLK_PIN);
136 156
 
137 157
   OUT_WRITE(MAX7219_LOAD_PIN, HIGH);
158
+  delay(1);
138 159
 
139 160
   //initiation of the max 7219
140 161
   Max7219(max7219_reg_scanLimit, 0x07);
@@ -187,9 +208,13 @@ void Max7219_init() {
187 208
 void Max7219_idle_tasks() {
188 209
   #if ENABLED(MAX7219_DEBUG_PRINTER_ALIVE)
189 210
     static int debug_cnt = 0;
190
-    if (debug_cnt++ > 100) {
191
-      Max7219_LED_Toggle(7, 7);
192
-      debug_cnt = 0;
211
+    #ifdef CPU_32_BIT  
212
+      if (debug_cnt++ > 400) {
213
+    #else
214
+      if (debug_cnt++ > 100) {
215
+    #endif
216
+        Max7219_LED_Toggle(7, 7);
217
+        debug_cnt = 0;
193 218
     }
194 219
   #endif
195 220
 

Loading…
Zrušit
Uložit