Monday 26 June 2023

Programming a 3D printer ANET board - Take 2

 I have come back to it after I found a guy who has documented it thoroughly. 

https://caggius.wordpress.com/anet-v1-5-1-7-board-on-marlin-2-0-5-3/

He works in Windows 10, so my first step was to install my W10 disc and let it upgrade. 

Step 1 was to back up the existing config using Pronterface, so I installed that, and this was a positive step because after I set the USB speed to 200,000 it connected and I was able to get the configuration, which I saved in a text file.   /Documents/3d-stuff/printer-config.

Step 2. I followed the instructions for getting the marlin code given in this link

Loaded VisualStudio, and added the alien PlatformIO IDE  I had some problem getting the correct VisualStudio until I let the computer choose it somehow. 

In step 5 here I have downloaded the Marlin code to  --? I think it must have disappeared. I can't find it today.   I want it in d:/Marlin2.1.2.1         
That is possibly why I had problems yesterday? 

Step 6 load the marlin project in VSCode. I couldn't get it to Import the project yesterday. I got it somehow else. But had an error when I tried to compile it [Step 7]. The first error is that it did not like the board that I selected - the Atmega 1284p which is the one on the ANET board. 

In the first blog step 6 he instructs to change some marlin files which I didn't do while I was following instructions in the second blog. Let us go back and do that. 
- Can't do it. These files are not in the config folder. 

Have done some tidying and unsynced OneDrive from this computer and moved everything to D: drive.  Now PlatformIO has the filenames but can't find them. 

Also when I try to open a README it opens in PlaformIO and I cannot see how to read it.  Will try tomorrow. 

I think that I will  re-download Marlin.

Followed the instructions about putting in the config files in the marlin directory, and editing the platformIO file, and it build successfully. 
The next step is to download it to the ANET card, but I am pretty sute that this does not have a bootloader so go to step 7c and follow the videos mentioned there. Bet I have been here before. 


July 14/23   Back in linux

Have connected  Arduino UNO to ANET 1.5 as so
MISO to MISO
MOSI to MOSI
GND to GND
SCLK to SCLK

started Arduino IDE 1.8.19
Example sketch Arduino ISP
Arduino UNO board, 
Port: /dev/ttyUSB0

This post https://www.youtube.com/watch?v=RQIizXtf9oo&t=0s used
USBtinyISP

Damn, now back at the point where I have to load the additional boards to select the ANET one , by pasting a certain line into the preferences.   NO. Moved the hardware directory containing the ANET stuff into the /snap/Arduino/current/ directory.

Have to change the Programmer to 'Arduino as ISP' 
Now going to try and flash the ANET Optiboot 
using the 'burn bootloader' command. 

BAck to the error message that I have seen before:
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, 

Leaving it for tonight.

19/7/23  
Order of operations:
 - Plug in Arduino
- start Arduino IDE
- check Board and port details. It hasn't picked up port USB0 yet.
- switch on ANET, shut down Arduino IDE
- start up IDE
-unplug and replug Arduino from USB
- Now IDE selects USB0 port

Error: 
Arduino: 1.8.19 (Linux), Board: "Anet V1.0 (Optiboot)"

Sketch uses 4574 bytes (3%) of program storage space. Maximum is 130048 bytes.
Global variables use 482 bytes of dynamic memory.
avrdude: Expected signature for ATmega1284P is 1E 97 05
         Double check chip, or use -F to override this check.
Wrong microcontroller found. 

Something is strange here because the ANET Board  has an ATmega 1284P chip. 

I am giving up. I have been here before. 

Suggestion from Hugh: 
It might be a good idea to see what the device actually is, and the best way to do this is to use Atmel/Microchip Studio from within windows.

Unfortunately it’s an enormous download, but it does work well, and from the ‘device programming’ dialog, it will prompt you if you select and incorrect device from the drop-down box.

Will try it. 

--------------
board sent to Hugh  26/7/23

--------------
30/7/23

In Here I find a reference to how to define an early ANET board.

https://marlinfw.org/docs/development/boards.html#sanguinololu-and-derivatives-atmega644p,-atmega1284p

BOARD_ANET_10

I'll have to look into this file and see if it gives me any thoughts.

-------------

https://www.youtube.com/watch?v=Ib188-ACa08   - some interesting thoughts on how to program an 8bit card using VSCode. 

From the video tells me how to find the extra files needed to set it up for Marlin 2.