Welcome! Log In Create A New Profile


Help picking MCU

Posted by Mallgan.O 
Help picking MCU
March 01, 2014 03:59PM
I want to try to make an ARM controller board design. Unfortunately I am a bit programming challenged so I wonder if anybody can estimate the effort it would take to port firmware for Arduino due to another atmel ARM MCU? I would like to make a minimalist design with one of the smaller chips and spotted ATSAM3S1A, 48 pin, 64MHz, 64k flash. Do you think this one would be a good canditate and reasonably easy to port to? This family have up to 256k flash if 64k would not do.
Re: Help picking MCU
March 02, 2014 04:58AM
My APrinter firmware already supports SAM3X8E (Arduino Due) and SAM3U4E (4pi board). From looking at the datasheet of the SAM3S1A, it would be an easy port. That wound include serial console over UART or USB and SD card via SPI (but not via HSMCI). However 64k flash will be too little, need at least 128k.

If you're interested I can do the port, but do check the feature list of APrinter first to be sure you want it. It's in heavy development and may be missing some feature that is essential to you.

Then, there's other firmwares, in particular Repetier and R2C2, which run on the Due board, and you can try porting these. There's also 4pi-firmware but many people don't like its quality. Also RepRapFirmware by RepRapPro, but when I last looked it didn't seem easy to port to anything different than their beloved Duet board.

Edited 4 time(s). Last edit at 03/02/2014 05:01AM by ambrop7.
Re: Help picking MCU
March 02, 2014 05:38AM
Thanks for the encouragement smiling smiley. It would be very helpful for me to have some design guidance for making the software implementation as straightforward as possible. I won't finish this in a day or even two so there will be time for firmware to mature. I will need some guidance regarding pin mapping and I guess that mirroring the pin mapping to due as much as possible is a good start? I intend to make a bare minimum design so I will only need basic functionality and delta kinematics wich you already support. I will start some drafting and get back for comments and advice.
Thanks again smiling smiley
Re: Help picking MCU
March 02, 2014 05:59AM
APrinter doesn't need much in terms of hardware. In order to be able to print, only the following HALs are needed: GPIO, ADC, serial port, clock, timer interrupts. I'll probably just change the SAM3U HALs to work on the SAM3S too.

Each heater needs a digital output pin for the FET and and an analog pin for the thermistor. The digital pin doesn't need to be PWM capable or anything (but you can still hook it up to a PWM pin in case some other firmware needs it). Each axis needs three digital output pins (dir, step, enable) and a digital input pin for the endstop (except extruders).

I should also ask you how much hardware you want to drive with this, how many steppers, heaters and fans. The SAM3S has only 9 TC compare units. The firmware needs one unit for some internal event generation, one for each stepper, one for each heater and one for each fan. If you have a regular single extruder machine, that takes 8 units (event+x_stepper+y_stepper+z_stepper+e_stepper+e_heater+bed_heater+e_fan). If you absolutely need more, I have some code lying around that turns one compare unit into two or more "virtual" ones.

Edited 2 time(s). Last edit at 03/02/2014 06:01AM by ambrop7.
Re: Help picking MCU
March 02, 2014 07:45AM
Bare minimum, x,y,z and e motors, three endstops, extruder heater and fan. My design goal is a rock solid HW design as cheap as possible without compromise reliability. Thats why I want to use the smallest, cheapest MCU that I can get away with. There will be provision for bed heater but I would like to have the current path external. Hopefully a gate driver on the board and a mosfet on a piece of strip board would work reliably if I choose a specific part and match gate termination with the inductance of, for instance, 500mm wires or something.
Re: Help picking MCU
March 02, 2014 08:01AM
My design goal is a rock solid HW design as cheap as possible without compromise reliability.

Well, the design goals of APrinter are similar, just in a software sense winking smiley Anyway I cannot help with hardware, but as soon as you put something together it shouldn't take long to get my code running. Just don't forget we need at least 128k flash (and preferably 256 if the price difference is negligible).

Edited 1 time(s). Last edit at 03/02/2014 08:02AM by ambrop7.
Re: Help picking MCU
March 02, 2014 08:06AM
If you limit to 48 pin SAM3S there are:

SAM3S1A: 64k flash, 16k SRAM: Not enough flash for APrinter, SRAM a bit too little for good performance.
SAM3S2A: 128k flash, 32k SRAM: Okay. APrinter needs about 90k flash for a single extruder setup (105k for dual extruder). But flash may be a problem if at one time APrinter gets fancy features like LCD or FAT.
SAM3S4A: 256k flash, 48k SRAM: Definitely enough of both.

Edited 3 time(s). Last edit at 03/02/2014 08:28AM by ambrop7.
Re: Help picking MCU
March 02, 2014 09:58AM
They seem to be interchangeable so it would just be to pick any one of them. I´ll think I am confident enough now to go ahead study the datasheet in depth and start planning. Thanks alot for the help.
Re: Help picking MCU
March 14, 2014 08:09AM
One of the cheapest ARM CPUs is probably the LPC11xx series: EUR 1.80 per chip. A working design exists, too, already: [reprap.org]

Generation 7 Electronics Teacup Firmware RepRap DIY
Re: Help picking MCU
March 19, 2014 04:47PM
That is really cool! Is the code for nxp arm much different to atmel arm? Do you know anything about the difference in performance between cortex M0 vs M3?
Sorry, only registered users may post in this forum.

Click here to login