Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
reprap:anet:anet_mainboard_overclocking [2018/01/04 05:45] – [Marlin changes] gmarsh23 | reprap:anet:anet_mainboard_overclocking [2018/01/04 15:41] – [Crystal selection and replacement] gmarsh23 | ||
---|---|---|---|
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 70: | Line 72: | ||
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' | 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 176: | Line 178: | ||
#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 186: | ||
#endif | #endif | ||
- | Add the two middle | + | Add the two additional |
#if CYCLES_PER_MICROSECOND == 16 | #if CYCLES_PER_MICROSECOND == 16 | ||
Line 218: | Line 220: | ||
To generate a table for a different frequency, Marlin provides a Python script in the buildroot/ | 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", | ||
- | 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 :) |