Browse Source

Fix SPI comments, clean up U20 pins (#14700)

Tanguy Pruvot 6 years ago
parent
commit
dca0c3d02a

+ 2
- 2
Marlin/src/HAL/HAL_STM32F1/HAL_spi_STM32F1.cpp View File

@@ -80,8 +80,8 @@ void spiBegin() {
80 80
  */
81 81
 void spiInit(uint8_t spiRate) {
82 82
   /**
83
-   * STM32F1 APB1 = 36MHz, APB2 = 72MHz, max SPI speed of this MCU if 18Mhz
84
-   * STM32F1 has 3 SPI ports, SPI1 in APB1, SPI2/SPI3 in APB2
83
+   * STM32F1 APB2 = 72MHz, APB1 = 36MHz, max SPI speed of this MCU if 18Mhz
84
+   * STM32F1 has 3 SPI ports, SPI1 in APB2, SPI2/SPI3 in APB1
85 85
    * so the minimum prescale of SPI1 is DIV4, SPI2/SPI3 is DIV2
86 86
    */
87 87
   #if SPI_DEVICE == 1

+ 28
- 30
Marlin/src/pins/stm32/pins_LONGER3D_LK.h View File

@@ -16,34 +16,42 @@
16 16
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 17
  *
18 18
  */
19
+#pragma once
19 20
 
20 21
 /**
21
- * ALFAWISE U30 (STM32F103VET6) board pin assignments
22
+ * Longer3D LK1/LK2 & Alfawise U20/U30 (STM32F103VET6) board pin assignments
22 23
  */
23 24
 
24 25
 #if !defined(__STM32F1__) && !defined(STM32F1xx)
25 26
   #error "Oops! Select a STM32F1 board in 'Tools > Board.'"
26 27
 #elif HOTENDS > 1 || E_STEPPERS > 1
27
-  #error "LONGER3D only supports 1 hotend / E-stepper. Comment out this line to continue."
28
+  #error "Longer3D board only supports 1 hotend / E-stepper. Comment out this line to continue."
28 29
 #endif
29 30
 
30 31
 #define BOARD_NAME "Longer3D"
31
-#define ALFAWISE_UX0             // Common to all Alfawise STM32F1 boards
32
+#define ALFAWISE_UX0             // Common to all Longer3D STM32F1 boards (used for Open drain mosfets)
32 33
 
34
+//#define DISABLE_DEBUG          //  We still want to debug with STLINK...
35
+#define DISABLE_JTAG             //  We free the jtag pins (PA15) but keep STLINK
33 36
                                  //  Release PB4 (STEP_X_PIN) from JTAG NRST role.
34
-//#define DISABLE_DEBUG          //  > Hobi : We still want to debug with STLINK...
35
-#define DISABLE_JTAG             //  we free the jtag pins (PA15) but keep STLINK
36
-
37 37
 //
38 38
 // Limit Switches
39 39
 //
40
-#define X_STOP_PIN         PC1   // pin 16
41
-//#define X_MAX_PIN        PC0   // pin 15 Used as filament sensor on Alfawise setup
40
+#define X_MIN_PIN          PC1   // pin 16
41
+#define X_MAX_PIN          PC0   // pin 15 (Filament sensor on Alfawise setup)
42 42
 #define Y_MIN_PIN          PC15  // pin 9
43
-//#define Y_MAX_PIN        PC14  // pin 8 Unused in stock Alfawise setup
43
+#define Y_MAX_PIN          PC14  // pin 8 (Unused in stock Alfawise setup)
44 44
 #define Z_MIN_PIN          PE6   // pin 5 Standard Endstop or Z_Probe endstop function
45
-//#define Z_MAX_PIN        PE5   // pin 4 Unused in stock Alfawise setup
45
+#define Z_MAX_PIN          PE5   // pin 4 (Unused in stock Alfawise setup)
46 46
                                  // May be used for BLTouch Servo function on older variants (<= V08)
47
+
48
+//
49
+// Filament Sensor
50
+//
51
+#ifndef FIL_RUNOUT_PIN
52
+  #define FIL_RUNOUT_PIN   PC0   // XMAX plug on PCB used as filament runout sensor on Alfawise boards (inverting true)
53
+#endif
54
+
47 55
 //
48 56
 // Steppers
49 57
 //
@@ -78,12 +86,7 @@
78 86
 #define FAN_PIN            PA15  // pin 77 (4cm Fan)
79 87
 #define FAN_SOFT_PWM             // Required to avoid issues with heating or STLink
80 88
 #define FAN_MIN_PWM        35    // Fan will not start in 1-30 range
81
-#define FAN_MAX_PWM       255
82
-
83
-// Filament Sensor
84
-#ifndef FIL_RUNOUT_PIN
85
-  #define FIL_RUNOUT_PIN   PC0   // XMAX plug on PCB used as filament runout sensor on Alfawise boards (inverting true)
86
-#endif
89
+#define FAN_MAX_PWM        255
87 90
 
88 91
 //#define BEEPER_PIN       PD13  // pin 60 (Servo PWM output 5V/GND on Board V0G+) made for BL-Touch sensor
89 92
                                  // Can drive a PC Buzzer, if connected between PWM and 5V pins
@@ -93,17 +96,14 @@
93 96
 //
94 97
 // PWM
95 98
 //
96
-//#define NUM_SERVOS        1
97
-//#define SERVO0_TIMER_NUM  1 // General or Adv. timer to use for the servo PWM (2 & 5 are reserved)
98
-
99
-#define SERVO0_PWM_OD
100 99
 #define SERVO0_PIN         PD13  // Open drain PWM pin on the V0G (GND or floating 5V)
100
+#define SERVO0_PWM_OD            // Comment this if using PE5
101 101
 
102
-//#define SERVO0_PIN         PE5   // Pulled up PWM pin on the V08 (3.3V or 0)
102
+//#define SERVO0_PIN       PE5   // Pulled up PWM pin on the V08 (3.3V or 0)
103 103
 
104 104
 /**
105 105
  * Note: Alfawise screens use various TFT controllers. Supported screens
106
- * are based on the ILI9342, ILI9328 and ST7798V. Define init sequences for
106
+ * are based on the ILI9341, ILI9328 and ST7798V. Define init sequences for
107 107
  * other screens in u8g_dev_tft_320x240_upscale_from_128x64.cpp
108 108
  *
109 109
  * If the screen stays white, disable 'LCD_RESET_PIN' to let the bootloader
@@ -112,7 +112,6 @@
112 112
  * Setting an 'LCD_RESET_PIN' may cause a flicker when entering the LCD menu
113 113
  * because Marlin uses the reset as a failsafe to revive a glitchy LCD.
114 114
  */
115
-#pragma once
116 115
 
117 116
 #define LCD_RESET_PIN      PC4   // pin 33
118 117
 #define LCD_BACKLIGHT_PIN  PD12  // pin 59
@@ -123,8 +122,8 @@
123 122
 #define FSMC_DMA_DEV       DMA2
124 123
 #define FSMC_DMA_CHANNEL   DMA_CH5
125 124
 
126
-#define DOGLCD_MOSI -1  // Prevent auto-define by Conditionals_post.h
127
-#define DOGLCD_SCK  -1
125
+#define DOGLCD_MOSI        -1  // Prevent auto-define by Conditionals_post.h
126
+#define DOGLCD_SCK         -1
128 127
 
129 128
 /**
130 129
  * Note: Alfawise U20/U30 boards DON'T use SPI2, as the hardware designer
@@ -146,13 +145,12 @@
146 145
 //
147 146
 // SPI1 (EEPROM W25Q64 + DAC OUT)
148 147
 //
149
-
150 148
 #undef E2END
151
-#define E2END             0x7FF // EEPROM end address (reserve 2kB on sd/sram, real spi one is 8MB/64Mbits)
149
+#define E2END              0x7FF // EEPROM end address (reserve 2kB on sd/sram, real spi one is 8MB/64Mbits)
152 150
 /*
153
-#define SPI_EEPROM        1   // If commented this will create a file on the SD card as a replacement
154
-#define SPI_CHAN_EEPROM1  1
155
-#define SPI_EEPROM1_CS       PC5 // pin 34
151
+#define SPI_EEPROM         1   // If commented this will create a file on the SD card as a replacement
152
+#define SPI_CHAN_EEPROM1   1
153
+#define SPI_EEPROM1_CS     PC5 // pin 34
156 154
 
157 155
 //#define EEPROM_SCK  BOARD_SPI1_SCK_PIN   // PA5 pin 30
158 156
 //#define EEPROM_MISO BOARD_SPI1_MISO_PIN  // PA6 pin 31

+ 2
- 2
config/examples/Alfawise/U20/Configuration_adv.h View File

@@ -1335,7 +1335,7 @@
1335 1335
 // The number of linear motions that can be in the plan at any give time.
1336 1336
 // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (e.g. 8, 16, 32) because shifts and ors are used to do the ring-buffering.
1337 1337
 #if ENABLED(SDSUPPORT)
1338
-  #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller
1338
+  #define BLOCK_BUFFER_SIZE 32 // SD,LCD,Buttons take more memory, block buffer needs to be smaller
1339 1339
 #else
1340 1340
   #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
1341 1341
 #endif
@@ -1344,7 +1344,7 @@
1344 1344
 
1345 1345
 // The ASCII buffer for serial input
1346 1346
 #define MAX_CMD_SIZE 96
1347
-#define BUFSIZE 4
1347
+#define BUFSIZE 8
1348 1348
 
1349 1349
 // Transmission to Host Buffer Size
1350 1350
 // To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.

Loading…
Cancel
Save