Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
reprap:anet:anet_mainboard_overclocking [2018/01/04 05:30] – [Anet Motherboard Overclocking] gmarsh23 | reprap:anet:anet_mainboard_overclocking [2018/12/02 02:27] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 33: | Line 33: | ||
I overclocked my printer for fun, and to learn more about the guts of Marlin. | I overclocked my printer for fun, and to learn more about the guts of Marlin. | ||
- | Additionally, | + | Additionally, |
The 12864 LCD that I have on the printer doesn' | The 12864 LCD that I have on the printer doesn' | ||
+ | |||
+ | I could just buy a proper 32 bit board, that would fix this problem entirely, but that's no fun :) | ||
=== Is this reliable/ | === Is this reliable/ | ||
Line 41: | Line 43: | ||
According to its datasheet, the ATMega1284P processor used on the Anet V1.0 motherboard is rated for 20MHz operation at the operating point of 125 degrees C and +4.5V. If you run the processor at a higher voltage (like the regulated +5.0V that the Anet motherboard provides) and a more reasonable operating temperature, | According to its datasheet, the ATMega1284P processor used on the Anet V1.0 motherboard is rated for 20MHz operation at the operating point of 125 degrees C and +4.5V. If you run the processor at a higher voltage (like the regulated +5.0V that the Anet motherboard provides) and a more reasonable operating temperature, | ||
- | //If you're mounting your printer in an enclosure for printing ABS or whatever, this means you'll be running the processor much hotter. Overclocking the processor beyond 20MHz probably isn't a good idea.// | + | //If you're mounting your printer in an enclosure for printing ABS or whatever, this means you'll be running the processor |
- | As far as safety goes, 3D printers by nature aren't safe, especially cheap printers like the A8. There's a chance your printer could malfunction and cause damage or injury, and doing this modification does not make the printer any safer. If the processor running on the printer crashes outright, Marlin uses the watchdog timer in the processor and should reboot. But it's possible that silent corruption of the processor' | + | As far as safety goes, 3D printers by nature aren't safe, especially cheap printers like the A8. Even without this modification, |
=== Tools required === | === Tools required === | ||
Line 49: | Line 51: | ||
To change the crystal, you will need soldering iron, solder (lead or lead free is fine), solder wick, and a suitable place to work. Desoldering HC49S packages is a pain in the ass, having two irons or a hot air rework station greatly helps with getting the old crystal off. | To change the crystal, you will need soldering iron, solder (lead or lead free is fine), solder wick, and a suitable place to work. Desoldering HC49S packages is a pain in the ass, having two irons or a hot air rework station greatly helps with getting the old crystal off. | ||
- | Having a power supply to power the control board outside of the printer during reflashing | + | Having a power supply to power the control board outside of the printer during reflashing |
Doing this modification requires updating the bootloader on the ATMega1284P chip, so you'll need an ISP capable programmer to do this. I suggest getting a USB ISP programmer which is supported by the " | Doing this modification requires updating the bootloader on the ATMega1284P chip, so you'll need an ISP capable programmer to do this. I suggest getting a USB ISP programmer which is supported by the " | ||
Line 57: | Line 59: | ||
=== Choosing a new crystal === | === Choosing a new crystal === | ||
- | The Anet V1.0 board requires a " | + | The Anet V1.0 board requires a " |
Here are some suitable crystal frequencies to choose from: | Here are some suitable crystal frequencies to choose from: | ||
Line 68: | Line 70: | ||
| 27MHz | +68.8% | +35% | May be unstable.\\ significant baud rate error (see below)\\ Can be salvaged from video equipment (DVD players, etc) | | | 27MHz | +68.8% | +35% | May be unstable.\\ significant baud rate error (see below)\\ Can be salvaged from video equipment (DVD players, etc) | | ||
- | If you're using the USB interface of the printer, using Octoprint for example, the crystal you choose affects how accurate the baud rate of the Mega1284P' | + | Note: If you're using the USB interface of the printer, using Octoprint for example, the crystal you choose affects how accurate the baud rate of the Mega1284P' |
- | ^ MHz (below), baud (right) ^ 115200 ^ 230400 ^ 250000 ^ 460800 ^ 500000 ^ 921600 ^ 1000000 ^ 1500000 ^ | + | ^ Crystal freq (below), baud (right) ^ 115200 ^ 230400 ^ 250000 ^ 460800 ^ 500000 ^ 921600 ^ 1000000 ^ 1500000 ^ |
- | | 16 | 2.1% | -3.5% | 0% | 8.5% | 0% | 8.5% | 0% | 33% | | + | | 16MHz | 2.1% | -3.5% | 0% | //8.5%// | 0% | //8.5%// | 0% | //33%// | |
- | | 20 | -1.4% | -1.4% | 0% | 8.5% | 0% | -9.6% | -16.7% | -16.7% | | + | | 20MHz | -1.4% | -1.4% | 0% | //8.5%// | 0% | //-9.6%// | //-16.7%// | //-16.7%// | |
- | | 24 | 0.16% | 0.16% | 0% | -7.0% | **0%** | 8.5% | 0% | 0% | | + | | 24MHz | 0.16% | 0.16% | 0% | //-7.0%// | **0%** | //8.5%// | 0% | 0% | |
- | | 25 | 0.5% | -3.1% | -3.8% | -3.1% | 4.2% | 13% | 4.2% | 4.2% | | + | | 25MHz | 0.5% | -3.1% | -3.8% | -3.1% | 4.2% | //13%// | 4.2% | 4.2% | |
- | | 27 | 1% | -2.3% | -3.6% | 4.6% | -3.6% | 8.4% | 12.5% | 12.5% | | + | | 27MHz | 1% | -2.3% | -3.6% | 4.6% | -3.6% | //8.4%// | //12.5%// | //12.5%// | |
To calculate for different clock frequencies and baud rates, use the following math: | To calculate for different clock frequencies and baud rates, use the following math: | ||
- | * UART divisor = (Processor clock) | + | * UART divisor = crystal frequency |
- | * Actual baud rate = (Processor clock) | + | * Actual baud rate = crystal frequency |
* Actual baud rate and desired baud rate should be +-5%, preferably +-2.5% | * Actual baud rate and desired baud rate should be +-5%, preferably +-2.5% | ||
Line 98: | Line 100: | ||
=== Downloading and compiling Optiboot === | === Downloading and compiling Optiboot === | ||
+ | |||
+ | **If you're using a 24MHz crystal, just copy this paste and save it as a .hex file:** https:// | ||
You'll need to download and compile Optiboot first. More information can be found on the Optiboot github page: https:// | You'll need to download and compile Optiboot first. More information can be found on the Optiboot github page: https:// | ||
Line 103: | Line 107: | ||
Use the following options to compile it for the Anet V1.0 board. Change the " | Use the following options to compile it for the Anet V1.0 board. Change the " | ||
- | make AVR_FREQ=24000000L BAUD_RATE=57600 LED=A4 | + | make AVR_FREQ=24000000L BAUD_RATE=57600 LED=A4 UART=0 |
Save the .hex file for later. | Save the .hex file for later. | ||
Line 115: | Line 119: | ||
=== Flashing new firmware === | === Flashing new firmware === | ||
- | Use AVRDUDE: | + | Use AVRDUDE |
+ | |||
+ | avrdude -p atmega1284p -c <your programmer> | ||
+ | avrdude -p atmega1284p -c <your programmer> | ||
- | avrdude -p atmega1284p -c <your programer> | + | The fuse values given move the bootloader start address to 0xFE00/ |
Once the board is programmed, connect the board to your PC via its USB connection, and attempt to " | Once the board is programmed, connect the board to your PC via its USB connection, and attempt to " | ||
Line 176: | Line 183: | ||
#define DELAY_9_NOP DELAY_1_NOP; | #define DELAY_9_NOP DELAY_1_NOP; | ||
- | Lastly, | + | Next find the following section: |
#if CYCLES_PER_MICROSECOND == 16 | #if CYCLES_PER_MICROSECOND == 16 | ||
Line 184: | Line 191: | ||
#endif | #endif | ||
- | Add the two middle | + | Add the two additional |
#if CYCLES_PER_MICROSECOND == 16 | #if CYCLES_PER_MICROSECOND == 16 | ||
Line 194: | Line 201: | ||
#endif | #endif | ||
- | === pins_ANET_10.h === | + | === Marlin/pins_ANET_10.h === |
If you're using the stock A8 display, you can ignore this section. If you're using the full graphics display from the A6, this is required or else the display on the printer will be garbled. | If you're using the stock A8 display, you can ignore this section. If you're using the full graphics display from the A6, this is required or else the display on the printer will be garbled. | ||
Line 209: | Line 216: | ||
#define ST7920_DELAY_2 DELAY_3_NOP | #define ST7920_DELAY_2 DELAY_3_NOP | ||
#define ST7920_DELAY_3 DELAY_7_NOP | #define ST7920_DELAY_3 DELAY_7_NOP | ||
+ | |||
+ | === Marlin/ | ||
+ | |||
+ | Marlin only comes with two lookup tables provided in this file, for operation at 16MHz and 20MHz. For other clock frequencies, | ||
+ | |||
+ | Here is a replacement for the file which has the 24MHz table added: https:// | ||
+ | |||
+ | To generate a table for a different frequency, Marlin provides a Python script in the buildroot/ | ||
+ | |||
+ | python createSpeedLookupTable.py --cpu-freq 25 > new_table.h | ||
+ | |||
+ | If you're using a crystal frequency which isn't a multiple of 1MHz, you'll need to edit the script to remove the "* 1000000", | ||
==== Compiling and installing new firmware ==== | ==== Compiling and installing new firmware ==== | ||
There are many guides online describing how to compile and install Marlin on an Anet A8. Find one and link it here :) | There are many guides online describing how to compile and install Marlin on an Anet A8. Find one and link it here :) |