Custom Printer with Ender3 board and CTC motors
December 29, 2023 03:49PM
Hi all,

hope this is not a misplaced question(s). I have a bunch of ender 3 mother boards, motors and displays from CTC Anet clones and a big pile of extrusion and fittings. I am trudging through the process of assembling some custom printers with unusual bed sizes. I am struggling with getting Marlin onto the board using a non Ender 3 display. I have both arduino IDE and VSC and have tried the sanguino install in Arduino with the perpetual 'Error writing to sanguino' and programmer not responding in VSC. I have gonr through the bootloader process and had a success message.

My question...is it possible to use this motherboard, with Marlin and either of the displays pictured for a custom printer with one very long axis. Assuming that the answer is yes then can anyone suggest a strategy regading the firmware selection and deployment?

Any help at all is muchly appreciated

Thanks

tanc
Attachments:
open | download - IMG_2154.JPEG (2.66 MB)
open | download - IMG_2155.JPEG (3.19 MB)
open | download - IMG_2156.JPEG (2.27 MB)
open | download - IMG_2157.JPEG (2.33 MB)
open | download - IMG_2158.JPEG (3 MB)
open | download - IMG_2159.JPEG (2.88 MB)
Re: Custom Printer with Ender3 board and CTC motors
December 29, 2023 04:30PM
Your controller is a BOARD_MELZI_CREALITY

The 20x4 LCD is a REPRAP_DISCOUNT_SMART_CONTROLLER and requires more than 10 IO pins to work. So you cannot us this display on that motherboard

The second display is a CTC_A10S_A13, this is currently called ANET_FULL_GRAPHICS_LCD_ALT_WIRING, as it was not understood that its a clone from ctc, not a anet board at all ( rename is in the works, [github.com])
This display is designed to work on the anet v1 controller. It has non standard wiring.

It should be possible to get the CTC_A10S_A13 working on the BOARD_MELZI_CREALITY


from a recent commit [github.com]

    /**
     * CTC_A10S_A13 pinout
     *
     *             ------
     *         GND |1  2| 5V
     * BEEPER_PIN  |3  4| BTN_EN2
     * BTN_EN1      5  6| LCD_PINS_D4
     * LCD_PINS_RS |7  8| LCD_PINS_EN
     * SERVO0_PIN  |9 10| BTN_ENC
     *             ------
     *              LCD
     */
      #define SERVO0_PIN             EXP1_02_PIN
      #define BEEPER_PIN             EXP1_08_PIN
      #define LCD_PINS_RS            EXP1_04_PIN
      #define LCD_PINS_EN            EXP1_03_PIN
      #define LCD_PINS_D4            EXP1_05_PIN
      #define BTN_EN1                EXP1_06_PIN
      #define BTN_EN2                EXP1_07_PIN
      #define BTN_ENC                EXP1_01_PIN
      #define BOARD_ST7920_DELAY_1           250
      #define BOARD_ST7920_DELAY_2           250
      #define BOARD_ST7920_DELAY_3           250

Your going to have to make up a custom cable and add similar block for the display to the Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h file
The most important pins are the 5v and gnd, make sure you have these correct
Then wire up LCD_PINS_RS, LCD_PINS_EN and LCD_PINS_D4, that is enough to get a display, but without input
and finally wire up the encoder so it works.
SERVO0_PIN is not required
BEEPER_PIN is not used as the beeper module is not soldered on.

Note when uploading to this board there are multiple build environments

env:melzi_optiboot_optimized
env:melzi_optiboot
env:melzi_optimized
env:melz


You should install the optiboot bootloader (standard one installed by modern arduino ide) as its is much smaller than the original melzi bootloader.
and use build environment melzi_optiboot_optimized under platformio

Edited 6 time(s). Last edit at 01/03/2024 08:39AM by Dust.
Re: Custom Printer with Ender3 board and CTC motors
December 29, 2023 06:27PM
Wow, thanks so very much for that dood! ill follow that through once i have got either of the IDEs talking to the board. currently im getting a stream of stk_500 getsync and recv errors in both arduino ide and vsc which is leading me to think that the bootloader might not be working. any insights?

< ... snipp ... >

reattached as text:

Edited 1 time(s). Last edit at 12/29/2023 06:41PM by VDX.
Attachments:
open | download - Arduino 1.8.13 (Windows 10), Board .txt (10.7 KB)
Re: Custom Printer with Ender3 board and CTC motors
December 29, 2023 07:00PM
Yes that is bootloader not working. beyond that it doesn't provide much useful information.

"Error while burning bootloader."

so bootloader has not been uploaded

check all your wiring again

what are you using as a programmer?

Edited 1 time(s). Last edit at 12/29/2023 07:07PM by Dust.
Re: Custom Printer with Ender3 board and CTC motors
January 02, 2024 03:58PM
Hi Dust,

I have checked all witing at least 3 times, using an arduino Mega, i have always got the uploaded success message when i have clicked the burn bootloader.curiously when i try to upload TH~3d unified firmware it does so no problem so now im back to questioning the sanguino installation in the original arduino ide. i also have some of the anet boards and all behave exactly the same as the creality boards. out of interest do you prefer arduino ide or vsc and why (if you dont mind) thanks again i really appreciate your input!
Re: Custom Printer with Ender3 board and CTC motors
January 02, 2024 04:06PM
If installing a 8bit bootloaders I use arvdude on command line with a old Pololu USB AVR Programmer Or Arduino IDE, which just uses avrdude

For code I use vscode, for two reasons
It gets all the source requirements for your without have to manually install them, No having to hunt down an install libraries
vscode has source filtering, what that does it makes up a list of files that it has to compile and only compiles those files skipping the rest. This makes marlin compiling a lot faster than arduino ide.

Eg Ramps on a arduno ide takes about 10 minutes, it takes 20 seconds on vscode on the same machine.

Edited 6 time(s). Last edit at 01/03/2024 02:20AM by Dust.
Re: Custom Printer with Ender3 board and CTC motors
January 02, 2024 06:43PM
I just re flashed the bootloader on my Creality V1.1.4 and used Arduino IDE (1.8.19) menu tool burn bootloader

log of a susessful bootloader flashing (in ubuntu)

/home/dust/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/home/dust/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -patmega1284p -cstk500 -P/dev/ttyACM0 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xF7:m 

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, [www.bdmicro.com]
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/home/dust/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
         User configuration file is "/home/dust/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : stk500
         AVR Part                      : ATmega1284P
         Chip Erase delay              : 55000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    10   128    0 no       4096    8      0  9000  9000 0xff 0xff
           flash         65    10   256    0 yes    131072  256    512  4500  4500 0xff 0xff
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel STK500
         Programmer Model: STK500
         Hardware Version: 15
         Firmware Version Master : 2.10
         Topcard         : Unknown
         Vtarget         : 4.9 V
         SCK period      : 2.2 us
         Varef           : 0.0 V
         Oscillator      : 3.686 MHz

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9705 (probably m1284p)
avrdude: erasing chip
avrdude: reading input file "0x3F"
avrdude: writing lock (1 bytes):

/home//.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/home/dust/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -patmega1284p -cstk500 -P/dev/ttyACM0 -Uflash:w:/home/dust/.arduino15/packages/Sanguino/hardware/avr/1.0.3/bootloaders/optiboot/optiboot_atmega1284p.hex:i -Ulock:w:0x0F:m 

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, [www.bdmicro.com]
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/home/dust/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
         User configuration file is "/home/dust/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : stk500
Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x3F:
avrdude: load data lock data from input file 0x3F:
avrdude: input file 0x3F contains 1 bytes
avrdude: reading on-chip lock data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of lock verified
avrdude: reading input file "0xFD"
avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0xFD:
avrdude: load data efuse data from input file 0xFD:
avrdude: input file 0xFD contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: reading input file "0xDE"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.01s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xDE:
avrdude: load data hfuse data from input file 0xDE:
avrdude: input file 0xDE contains 1 bytes
avrdude: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0xF7"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.01s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xF7:
avrdude: load data lfuse data from input file 0xF7:
avrdude: input file 0xF7 contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified

avrdude done.  Thank you.

         AVR Part                      : ATmega1284P
         Chip Erase delay              : 55000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    10   128    0 no       4096    8      0  9000  9000 0xff 0xff
           flash         65    10   256    0 yes    131072  256    512  4500  4500 0xff 0xff
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel STK500
         Programmer Model: STK500
         Hardware Version: 15
         Firmware Version Master : 2.10
         Topcard         : Unknown
         Vtarget         : 4.8 V
         SCK period      : 2.2 us
         Varef           : 0.0 V
         Oscillator      : 3.686 MHz

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9705 (probably m1284p)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "/home/dust/.arduino15/packages/Sanguino/hardware/avr/1.0.3/bootloaders/optiboot/optiboot_atmega1284p.hex"
avrdude: writing flash (131072 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 131072 bytes of flash written
avrdude: verifying flash memory against /home/dust/.arduino15/packages/Sanguino/hardware/avr/1.0.3/bootloaders/optiboot/optiboot_atmega1284p.hex:
avrdude: load data flash data from input file /home/dust/.arduino15/packages/Sanguino/hardware/avr/1.0.3/bootloaders/optiboot/optiboot_atmega1284p.hex:
avrdude: input file /home/dust/.arduino15/packages/Sanguino/hardware/avr/1.0.3/bootloaders/optiboot/optiboot_atmega1284p.hex contains 131072 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 131072 bytes of flash verified
avrdude: reading input file "0x0F"
avrdude: writing lock (1 bytes):

Writing | ################################################## | 100% 0.01s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x0F:
avrdude: load data lock data from input file 0x0F:
avrdude: input file 0x0F contains 1 bytes
avrdude: reading on-chip lock data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of lock verified

avrdude done.  Thank you.
Re: Custom Printer with Ender3 board and CTC motors
January 02, 2024 06:54PM
As I asked before what programmer are you using?

My programmer does not provide 5v power to the board. So I also have to have the USB plugged into power (to save serial port confusion I use a usb power bank, not the computer)




Are you getting a the blue power LED on the control board while your trying to flash?

Edited 2 time(s). Last edit at 01/02/2024 07:11PM by Dust.
Re: Custom Printer with Ender3 board and CTC motors
January 02, 2024 07:01PM
I then verified that vscode/platformio can upload, I used environemnt melzi_optiboot_optimized

It uploaded code fine.

Executing task: platformio run --target upload 

Processing melzi_optiboot_optimized (board: sanguino_atmega1284p; platform: atmelavr@~4.0.1; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: [docs.platformio.org]
PLATFORM: Atmel AVR (4.0.1) > Sanguino ATmega1284p (16MHz)
HARDWARE: ATMEGA1284P 16MHz, 16KB RAM, 127KB Flash
DEBUG: Current (simavr) External (simavr)
PACKAGES: 
 - framework-arduino-avr @ 5.1.0 
 - tool-avrdude @ 1.60300.200527 (6.3.0) 
 - toolchain-atmelavr @ 1.70300.191015 (7.3.0)
Converting Marlin.ino
LDF: Library Dependency Finder -> [bit.ly]
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 5 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Wire @ 1.0
|-- SPI @ 1.0
Building in release mode
Compiling .pio/build/melzi_optiboot_optimized/src/src/inc/Warnings.cpp.o
Marlin/src/inc/Warnings.cpp:77:4: warning: #warning "Your Configuration provides no method to acquire user feedback!" [-Wcpp]
   #warning "Your Configuration provides no method to acquire user feedback!"
    ^~~~~~~
Linking .pio/build/melzi_optiboot_optimized/firmware.elf
Checking size .pio/build/melzi_optiboot_optimized/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [==        ]  15.3% (used 2507 bytes from 16384 bytes)
Flash: [====      ]  44.2% (used 57540 bytes from 130048 bytes)
Configuring upload protocol...
AVAILABLE: arduino
CURRENT: upload_protocol = arduino
Looking for upload port...
Auto-detected: /dev/ttyUSB0
Uploading .pio/build/melzi_optiboot_optimized/firmware.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9705 (probably m1284p)
avrdude: reading input file ".pio/build/melzi_optiboot_optimized/firmware.hex"
avrdude: writing flash (57540 bytes):

Writing | ################################################## | 100% 7.29s

avrdude: 57540 bytes of flash written
avrdude: verifying flash memory against .pio/build/melzi_optiboot_optimized/firmware.hex:
avrdude: load data flash data from input file .pio/build/melzi_optiboot_optimized/firmware.hex:
avrdude: input file .pio/build/melzi_optiboot_optimized/firmware.hex contains 57540 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 6.17s

avrdude: verifying ...
avrdude: 57540 bytes of flash verified

avrdude: safemode: Fuses OK (E:00, H:00, L:00)

avrdude done.  Thank you.

=========================================================== [SUCCESS] Took 17.99 seconds ===========================================================

Environment               Status    Duration
------------------------  --------  ------------
melzi_optiboot_optimized  SUCCESS   00:00:17.986
============================================================ 1 succeeded in 00:00:17.986 ============================================================

Edited 1 time(s). Last edit at 01/03/2024 02:21AM by Dust.
Sorry, only registered users may post in this forum.

Click here to login