ATMEGA1284P-PU direct upgrade replacement any recommendations   - Page 1
Forum section: electronics / general

author: pcmad
author_rank: Regular Contributor
timestamp: March 20, 2022, 01:44:56 pm
content: I am currently in a project to refer my 3D printer as I was refurb my 3d printer I accidentally blew up the microcontrollerwhich is a ATMEGA1284P-PUI can still buy these this microcontroller and get the open source firmware for the 3d printer however is only 128K of Flash memory I was wondering as got this opportunity to replace the microcontroller is there a drop in replacement like for like pin for pin for like a microcontroller that will fit right in which offers more Flash memory if so what would you recommend thank you into in advanceAs for the 3d printer it's a RepRapPro Huxley open source 3D printer running Marlin, Firmware, on the controller board of Sanguinololu the version 1.3a control board

author: madires
author_rank: Super Contributor
timestamp: March 20, 2022, 02:22:32 pm
content: ATmega1284!ATmega324 and 644 have the same pinout but less flash, eeprom and RAM.

author: RoGeorge
author_rank: Super Contributor
timestamp: March 20, 2022, 02:31:52 pm
content: Might be better to upgrade the 3D printer with a new controller, something with extra features and based on a newer and faster microcontroller, like ARM.AFAIK there is no direct replacement for ATMEGA1284P-PU. Why do you want it to be a cross reference and not the original?

author: Ian.M
author_rank: Super Contributor
timestamp: March 20, 2022, 02:35:50 pm
content: MicrochipMAPSsays that there isn't any ATmega in a 40 (or 44) pin package with more than 128K program memory.Therefore your only upgrade option for your existing board would be to use some sort of adapter to connect the equivalent pins of a 'bigger' ATmega to the Sanguinololu MCU socket. While it would be technically possible to simply use a bunch of DuPont jumpers to hook up an Arduino Mega2560, it would be extremely unreliable, considering the vibration levels it would be exposed to, so the only realistic option would be a custom daughterboard, with a header to fit the MCU socket. However this isn't cost-effective as the Sangulino stepper drivers are all socketed, so the only stuff worth anything left on your Sangulino is the bed and hotend MOSFETs and its USB interface, under $10 of parts all-in.Your best bet would be to get the most fully featured 3D printer controller board you can afford with a Marlin supported MCU*and sockets for stepper drivers that will accept your ones, and either scrap the Sanguinololu, or put it aside till you have a project its suited for. That should also give you a whole bunch of extra I/O, bringing upgrade options like multiple speed controlled fans, auto Z levelling, auto bed levelling, multiple extruders or a filament changer, and even a heated enclosure within reach.Be careful in the future as your new board will almost certainly have a SMD MCU requiring a couple of orders magnitude more skill + specialist equipment to replace if you blow it again!* Probably ATmega2560 based but if your stepper drivers are 3.3V logic level compatible it may be worth looking at 32 bit controller boards.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 20, 2022, 02:50:46 pm
content: What do you need more Flash for? It has to be compiled to use the extra space. If it's not using it, it doesn't matter!The next size up would be, what, 192 or 256, which I don't recall if it's offered in the -4 series (ATMEGA2564?). The -8 series might offer more capacity, and also more peripherals (but it's not drop-in, some changes may be needed in IO calls), and I forget if the pins are also different in that package. Note that, besides the firmware not knowing if it's got more available, methods to access +128k are different, because of architecture limitations. The compiler knows this and generates code to deal with it, but that again means it needs to be recompiled for the target.Or the next step up in speed (if that would help), would be, maybe one of the newer mega0 types?, or XMEGA. Which really isn't much improvement (24-32MHz max F_CPU vs. 20ish for old megas, plus some instructions taking a cycle less or so), and might not be applicable (if timers/peripherals can't run at max clk because of required operating frequencies and limited prescaler/divider options). Let alone porting it over (the peripherals on these chips are notably different).At which point you might as well drop in a low level ARM, which will significantly outperform AVR in every respect. But again, much porting required. Maybe/probably there's a version of codebase for that already, no idea...Anyway, more likely question I'd expect these days is, which one is available, in stock anywhere at all... which, a modest number of AVR at least seem to have, so there's that.Tim

author: Ian.M
author_rank: Super Contributor
timestamp: March 20, 2022, 02:59:52 pm
content: @T3sl4co1l,We seem to be thinking alike. However Marlin 3D printer firmware on an AVR can certainly use >128 Kbytes, as I struggle to 'crunch' it enough to get the features I want to fit in an ATmega1284P.