2

This is my board MKS Melzi v2.0 cloned

MKS Melzi v2.0 cloned

I replaced the MCU (the actual IC) with new ATmega1284P 16 MHz, because the old MCU was damaged - the reason was that the fan got dusty and the power line became unstable. I replaced the MCU with the exact same model.

I have tried to flash it many times using usbasp. It works but same issue system menus boot splash are still so slow it's painful. It takes minutes on an old Marlin version 1.1.6, hours on a new Marlin 2.x

I think it's something related to MCU (crystal oscillator frequencies). Maybe the system uses an internal crystal so the MCU got stuck.

  1. How can I switch to an external crystal?
  2. If it's not, then what can cause the problem?

Firmware links:

Greenonline
  • 6,748
  • 8
  • 40
  • 68
ioen jid
  • 43
  • 5

1 Answers1

1

Either:

  • You have a clock prescaler set, or;
  • You are not using the external oscillator on the board.

There are some internal fuses that set the clock frequency divider and the clock source and maybe your new IC has the incorrect fuses set.

That is to say, they may be factory default, but they are not the same as the controller board comes shipped with.

You probably want to check both settings as the factory defaults of your replacement IC are probably not what you expect, or desire.

Check the ATmega1284P datasheet for details.


Prescaler

Section 7.12.2 CLKPR - Clock Prescale Register, page 38. That is for the general clock frequency, and shows the register CLKPR in particular Bits 3:0.

7.12.2 CLKPR - Clock Prescale Register

Or section 7.11 System Clock Prescaler

7.11 System Clock Prescaler

External clock

Section 7.2 Clock Sources, shows that CKSEL Bits 3:0 set which clock is used, internal or external. You presumably want to use the external clock so set all four bits to zero

7.2 Clock Sources


To set, or examine, any of the registers, you have to use usbasp. I can't remember what the commands are. If you look on SE.Arduino or SE.Electronics I am sure that there is a question with the answer. I vaguely remember having the same problem with an ATtiny.

Greenonline
  • 6,748
  • 8
  • 40
  • 68