Browse Source

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.
pull/1/head
Roxy-3D 7 years ago
committed by GitHub
parent
commit
0e260c6c1d
  1. 15
      Marlin/src/config/examples/Folger Tech/i3-2020/Configuration.h
  2. 12
      Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h
  3. 37
      Marlin/src/feature/Max7219_Debug_LEDs.cpp

15
Marlin/src/config/examples/Folger Tech/i3-2020/Configuration.h

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

12
Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h

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

37
Marlin/src/feature/Max7219_Debug_LEDs.cpp

@ -63,18 +63,38 @@ static uint8_t LEDs[8] = { 0 };
void Max7219_PutByte(uint8_t data) { void Max7219_PutByte(uint8_t data) {
for (uint8_t i = 8; i--;) { for (uint8_t i = 8; i--;) {
WRITE(MAX7219_CLK_PIN, LOW); // tick #ifdef CPU_32_BIT // The 32-bit processors are so fast, a small delay in the code is needed
WRITE(MAX7219_DIN_PIN, (data & 0x80) ? HIGH : LOW); // send 1 or 0 based on data bit // to let the signal wires stabilize.
WRITE(MAX7219_CLK_PIN, HIGH); // tock WRITE(MAX7219_CLK_PIN, LOW); // tick
delayMicroseconds(5);
WRITE(MAX7219_DIN_PIN, (data & 0x80) ? HIGH : LOW); // send 1 or 0 based on data bit
delayMicroseconds(5);
WRITE(MAX7219_CLK_PIN, HIGH); // tock
delayMicroseconds(5);
#else
WRITE(MAX7219_CLK_PIN, LOW); // tick
WRITE(MAX7219_DIN_PIN, (data & 0x80) ? HIGH : LOW); // send 1 or 0 based on data bit
WRITE(MAX7219_CLK_PIN, HIGH); // tock
#endif
data <<= 1; data <<= 1;
} }
} }
void Max7219(const uint8_t reg, const uint8_t data) { void Max7219(const uint8_t reg, const uint8_t data) {
WRITE(MAX7219_LOAD_PIN, LOW); // begin WRITE(MAX7219_LOAD_PIN, LOW); // begin
#ifdef CPU_32_BIT // The 32-bit processors are so fast, a small delay in the code is needed
delayMicroseconds(5); // to let the signal wires stabilize.
#endif
Max7219_PutByte(reg); // specify register Max7219_PutByte(reg); // specify register
Max7219_PutByte(data); // put data Max7219_PutByte(data); // put data
#ifdef CPU_32_BIT
delayMicroseconds(5);
#endif
WRITE(MAX7219_LOAD_PIN, LOW); // and tell the chip to load the data WRITE(MAX7219_LOAD_PIN, LOW); // and tell the chip to load the data
#ifdef CPU_32_BIT
delayMicroseconds(5);
#endif
WRITE(MAX7219_LOAD_PIN, HIGH); WRITE(MAX7219_LOAD_PIN, HIGH);
} }
@ -135,6 +155,7 @@ void Max7219_init() {
SET_OUTPUT(MAX7219_CLK_PIN); SET_OUTPUT(MAX7219_CLK_PIN);
OUT_WRITE(MAX7219_LOAD_PIN, HIGH); OUT_WRITE(MAX7219_LOAD_PIN, HIGH);
delay(1);
//initiation of the max 7219 //initiation of the max 7219
Max7219(max7219_reg_scanLimit, 0x07); Max7219(max7219_reg_scanLimit, 0x07);
@ -187,9 +208,13 @@ void Max7219_init() {
void Max7219_idle_tasks() { void Max7219_idle_tasks() {
#if ENABLED(MAX7219_DEBUG_PRINTER_ALIVE) #if ENABLED(MAX7219_DEBUG_PRINTER_ALIVE)
static int debug_cnt = 0; static int debug_cnt = 0;
if (debug_cnt++ > 100) { #ifdef CPU_32_BIT
Max7219_LED_Toggle(7, 7); if (debug_cnt++ > 400) {
debug_cnt = 0; #else
if (debug_cnt++ > 100) {
#endif
Max7219_LED_Toggle(7, 7);
debug_cnt = 0;
} }
#endif #endif

Loading…
Cancel
Save