Welcome! Log In Create A New Profile

Advanced

Melzi 2.3 no support for 44-pin 1284p

Posted by markotime 
Melzi 2.3 no support for 44-pin 1284p
February 19, 2015 10:43AM
Elecfreaks, GEEtlec and others offer boards using the 44-pin version of the 1284p chip. As the pinouts differ between the 40-pin chip (for which there are many file sets) and the 44-pin one, the boards using the latter will not work. For example, the schematic (44 pin) and the hardware both show the heatbed and extruder outputs being on chip pins 13 and 14, but pins.h indicates pin 12 for one of these. Similarly, the fan control hardware connects to pin 44, while pins.h shows pin 4 - which is used for something totally different in the 44-pin chip.
I attempted to create a pins.h file to reflect REAL hardware assignments, but got a compile error for my efforts. I suspect that the bootloader may also be incorrect. Can anyone help? / thanks in advance!
Re: Melzi 2.3 no support for 44-pin 1284p
February 20, 2015 05:28AM
First of all, which firmware are you talking about?

Then, the flavour of bootloader doesn't matter as long as you can upload a firmware. Uploading is the only task the bootloader exists for, nothing else touches it.

Third, if the pin assignment of your firmware doesn't match, then you have to change it. That simple :-) Good firmware developers will happily accept your patches.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Melzi 2.3 no support for 44-pin 1284p
February 20, 2015 10:40AM
Thank you for your response. Marlin firmware. Your answer appears to miss my point. I need to control the extruder, heat bed and fan (and I will guess that the pin assignments to control the steppers are also wrongly declared). The hardware i/o for the chip is defined in the file pins.h.
Everything works just fine on boards that ARE supported, like the mega2560.

The bootloader works - I can load and run stuff. But the pin assignments are wrong on THIS board.
But thatnks for trying.
Re: Melzi 2.3 no support for 44-pin 1284p
February 21, 2015 10:23AM
Board descriptions describe more than just the ATmega type. With the same MCU you can connect signal here or there, requiring a different pin layout each time, despite the same chip at the center. So, having a "pin layout for ATmega2560" doesn't neccessarily mean it fits your controller. Hmm. Earlier you said it's an ATmega1284P. Whatever.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Melzi 2.3 no support for 44-pin 1284p
February 21, 2015 11:34AM
YEah. The 2560 is supported, as is the 40-pin version of the 1284p. The pins.h files generated by some hard working and knowledgeable people match the chip pin numbers to their internal functions. I cannot find any set of pins.h and other header files that match the 44-pin version of the 1284p. Anywhere. Hmmm. Do you know where or how to do this?
Re: Melzi 2.3 no support for 44-pin 1284p
February 22, 2015 07:08AM
Quote
markotime
Do you know where or how to do this?

It's done using a text editor. And descriptions of the board help finding the right pins, of course.

In Marlin you have to find a place in pins.h.

In Teacup you copy one of the templates and modify it until it fits, then send the result to one of the Teacup developers. Teacup experimental branch has even a graphical tool for doing this, it's configtool.py. Brand new.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Melzi 2.3 no support for 44-pin 1284p
February 22, 2015 11:04AM
Well, I thank you for that! Unfortunately, this is all way above my pay grade, having fought my way through Fortran IV in the 60s and a little bit of BASIC along the way.
However, here's the link to the schematic of my board, with proper pinouts from which I attempted to build a pins.h file. I know I missed something else. This is a 40 dollar board which I thought would be an inexpensive and easy-to-mount upgrade an old 3d printer. I have other fish to fry in my advancing years, so I appreciate knowing "about", but have to stop short of learning "how". Here's the link:
[www.geeetech.com]
Re: Melzi 2.3 no support for 44-pin 1284p
March 02, 2015 07:57AM
I'm running that board you have, just double checked to see if it runs the 44pin Atmega1284p MCU, and yes it does.

My board has the latest development version of Marlin on it and it's running fine.
I select GEN7@16Mhz as my Arduino board type in the Arduino IDE, in the configuration.h I picked motherboard type 'board_melzi'. I used I think the 1.05.r2 Arduino IDE initially but I'm now using the 1.0.6 version fine.

I don't recall changing the pin config in pins.h.

I did hit a snag on day one with the clone FTDI USB chip Geeetech used on the board. It got PID bricked by the FTDI driver released back in October (google on FTDIgate) and I then had to reflash the chip (there went a days work bless them at FTDI).

Anyhow, some of that might help...
Re: Melzi 2.3 no support for 44-pin 1284p
June 16, 2015 03:29PM
@markotime, actually the board you have will work with marlin once you declare the correct melzi board in configuration.h. No need to change pins.h at all. I can see why you got confused. You are basically assuming that the marlin firmware is mapping physical pins. This is incorrect. It basically is mapping to arduino defined pins.

Arduino maps ports on the chips to their own defined pin numbering scheme (D0 -> D31 in this case). Thus there is no difference in the arduino pin mappings to ports for the DIP vs TQFP 1284p chip. For example:

DIP: Physical pin 5 is PB4 --maps to arduino--> D4 (Digital pin 4) --connected to geeetech board--> fan pin --defined in pins.h--> pin 4 (just drop the D)
TQFP: Physical pin 44 is PB4 --maps to arduino--> D4 (Digital pin 4) --connected to geeetech board--> fan pin --defined in pins.h--> pin 4 (just drop the D)

You will find that the DIP and TQFP have the same I/Os, thus arduino maps all the I/Os from both to the same pin definition. This is handled by the arduino boot loader.

I've attached a picture with a side-by-side of both the DIP and TQFP and their ports here. You can also find the port to arduino pin map here [reprap.org] (it is for the DIP but just follow the port names and ignore the physical pin and it'll apply to the TQFP).

Make sure you have "#define MOTHERBOARD BOARD_MELZI_1284" in your marlin configuration.h file, then read through the remarks and adjust things based on your board (don't play with pin numberings cause they are basically correct). If you need an example of a working setup, look for my fork of the marlin software on github and download my "Release-samuel" or "Development-samuel" branches. They both work on my melzi board which is basically similar to yours just from a different supplier (the circuit diagrams are exactly the same).

Hope this help! Good luck!

Edited 1 time(s). Last edit at 06/16/2015 03:45PM by silpstream.
Attachments:
open | download - Windows-Live-Writer_C-BlinkenLED-on-the-AVR-and-MikroElektro_B9E5_image_9.png (149.8 KB)
Re: Melzi 2.3 no support for 44-pin 1284p
June 16, 2015 07:10PM
V2 Melzi has MOSFET outputs for FAN and for HEATBED, on pins 44(PB4) and 13(PD4), respectively.
On the non-44-pin version, FAN is on pin4 (PB3), bed is on PD6 for the 644 and something else on the 40-pin version of the 1284p.

Sooooo, the port / pin equivalence doesn't seem to hold up, which explains why my V2 Melzi doesn't energize the fan and doesn't
energize the heatbed. There are other mismaps, which I don't remember offhand, that affect axis enable and other functions,
maybe even step/dir pins.

Sooooo, lacking the appropriate background, I attempted to change pins.h, resulting in compiler barf.
Hence my newbie questions.

Sooooo, if some kind sould could take my hand and guide me through whatever I have to do to make it work, I'd
be very grateful. Now, it's only a 40.00 board, but I'd like to add a smart panel to it, which ain't gonna happen
until I sort out the mismatch or perhaps my misconceptions. THanks to all!
Re: Melzi 2.3 no support for 44-pin 1284p
June 17, 2015 01:22AM
I'm not sure where you are getting your schematic diagram for the 40 pin version. I've attached a side-by side for the 44 pin and 40 pin version here. They are taken from [www.geeetech.com] and [reprap.org] respectively. Although they both show ATMEGA644, the ATMEGA1284 is pin compatible (drop in replacement) so will have no difference. As far as I can see, ports PA0-7, PB0-7, PC0-7, and PD0-7 all map to the same control functions for the 3d printer. The minor difference you would see is on PB4 labeled as "FAN" on the 44 pin and "PB4-PWM" on the 40 pin, as well as PA0 labeled as "SD-SS" and "A0" in the same order.

Port names to Arduino numbering maps as follows:

(0)  PB0 |        | PA0 (31)
(1)  PB1 |        | PA1 (30)
(2)  PB2 |        | PA2 (29)
(3)  PB3 |        | PA3 (28)
(4)  PB4 |        | PA4 (27)
(5)  PB5 |        | PA5 (26)
(6)  PB6 |        | PA6 (25)
(7)  PB7 |        | PA7 (24)

         |        | PC7 (23)
         |        | PC6 (22)
(8)  PD0 |        | PC5 (21)
(9)  PD1 |        | PC4 (20)
(10) PD2 |        | PC3 (19)
(11) PD3 |        | PC2 (18)
(12) PD4 |        | PC1 (17)
(13) PD5 |        | PC0 (16)
(14) PD6 |        | PD7 (15)

The arduino numbers are in brackets, and these bracketed numbers are what you will find in the Marlin configuration/pins files already.

So like I said before, don't mess with the pin numbering in Marlin, it is already correct (provided the geeetech schematic you linked earlier is an accurate representation of your board). This is already what you have by default if you use a Melzi (the numbering is the Arduino numbering NOT physical):

#define X_STEP_PIN         15
#define X_DIR_PIN          21
#define X_STOP_PIN         18

#define Y_STEP_PIN         22
#define Y_DIR_PIN          23
#define Y_STOP_PIN         19

#define Z_STEP_PIN         3
#define Z_DIR_PIN          2
#define Z_STOP_PIN         20

#define E0_STEP_PIN         1
#define E0_DIR_PIN          0

#define LED_PIN            27
#define FAN_PIN             4

#define HEATER_BED_PIN     12
#define X_ENABLE_PIN       14
#define Y_ENABLE_PIN       14
#define Z_ENABLE_PIN       26
#define E0_ENABLE_PIN      14


If you have other diagrams showing different wiring from above, I'd like to see it, as I couldn't find anything that has the differences that you referred to in your previous post.
Attachments:
open | download - TvD1284.png (92.1 KB)
Re: Melzi 2.3 no support for 44-pin 1284p
June 17, 2015 03:01AM
Quote
markotime
Sooooo, if some kind sould could take my hand and guide me through whatever I have to do to make it work, I'd
be very grateful. Now, it's only a 40.00 board, but I'd like to add a smart panel to it, which ain't gonna happen
until I sort out the mismatch or perhaps my misconceptions. THanks to all!
My Melzi V2 board fan and bed worked (or what I believe is a V2 from Geeetech anyway) without Marlin code pin modifications. I've also fitted a graphics smart panel to it and it works fine too.
So it's worth to keep trying to sort out on your board.
[forums.reprap.org]
Martin
Re: Melzi 2.3 no support for 44-pin 1284p
June 17, 2015 09:38AM
OK, for the DIP, start at 0, not 1, face is red, thank you all. I'll try the Marlin version from your branch and report back....
Re: Melzi 2.3 no support for 44-pin 1284p
November 24, 2016 11:11AM
Hello , i have the same problem , could you tell me please mr.sneezy where did you download the board from and how can i install it in arduino?

thanks in advance
Sorry, only registered users may post in this forum.

Click here to login