Welcome! Log In Create A New Profile

Advanced

Sprinter Firmware for Generation 7 Electronics

Posted by FouadAtmeh 
Sprinter Firmware for Generation 7 Electronics
February 16, 2012 05:34PM
Hi All,

I am finalizing my reprap and had some problems with Teacup firmware on Gen 7, so I thought of giving sprinter a shot.
Long story short, I did some modifications and it works!!!! I haven't printed anything yet, so It would be nice if others could try it and report their experiences, and hopefully update it to mainstream..
The changes I made are as follows (I have attached a file named steps.txt that contains the full steps which even include installing arduino with gen 7 support):
1- copy the following files from "arduino-1.0/hardware/arduino/cores/arduino" to "arduino-1.0/hardware/Gen7/cores/arduino":
arduino.h
WCharacter.h
WString.h

2- comment the following lines from "arduino.h" since they are repeated in "wiring.h":
extern const uint16_t PROGMEM port_to_mode_PGM[];
extern const uint16_t PROGMEM port_to_input_PGM[];
extern const uint16_t PROGMEM port_to_output_PGM[];

unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L);

3- for the firmware changes:
3a- Do the following to "configuration.h"
add this to the list of supported boards for the sake of clarity:
// Gen 7 Board = 7
Change the board type:
#define MOTHERBOARD 7
Comment the following lines as SD and fan aren't supported in Gen 7:
#define SDSUPPORT
#define CONTROLLERFAN_SEC 60 //How many seconds, after all motors were disabled, the fan should run

3b- Add the following to the file "pins.h":
/****************************************************************************************
* Gen 7 Motherboard  
*
*                   ATMega644/ATMega644P
*
*                        +---\/---+
*            (D 0) PB0  1|        |40  PA0 (AI 0 / D31)
*            (D 1) PB1  2|        |39  PA1 (AI 1 / D30)
*       INT2 (D 2) PB2  3|        |38  PA2 (AI 2 / D29)
*        PWM (D 3) PB3  4|        |37  PA3 (AI 3 / D28)
*        PWM (D 4) PB4  5|        |36  PA4 (AI 4 / D27)
*       MOSI (D 5) PB5  6|        |35  PA5 (AI 5 / D26)
*       MISO (D 6) PB6  7|        |34  PA6 (AI 6 / D25)
*        SCK (D 7) PB7  8|        |33  PA7 (AI 7 / D24)
*                  RST  9|        |32  AREF
*                  VCC 10|        |31  GND 
*                  GND 11|        |30  AVCC
*                XTAL2 12|        |29  PC7 (D 23)
*                XTAL1 13|        |28  PC6 (D 22)
*       RX0 (D 8)  PD0 14|        |27  PC5 (D 21) TDI
*       TX0 (D 9)  PD1 15|        |26  PC4 (D 20) TDO
*  INT0 RX1 (D 10) PD2 16|        |25  PC3 (D 19) TMS
*  INT1 TX1 (D 11) PD3 17|        |24  PC2 (D 18) TCK
*       PWM (D 12) PD4 18|        |23  PC1 (D 17) SDA
*       PWM (D 13) PD5 19|        |22  PC0 (D 16) SCL
*       PWM (D 14) PD6 20|        |21  PD7 (D 15) PWM
*                        +--------+
*
****************************************************************************************/
#if MOTHERBOARD == 7
#define KNOWN_BOARD 1

#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega1284P__) && !defined(__AVR_ATmega644__) 
#error Oops!  Make sure you have 'Gen 7' selected from the 'Tools -> Boards' menu.
#endif

#define	X_STEP_PIN			19
#define	X_DIR_PIN			18	
#define	X_MIN_PIN			7
#define	X_MAX_PIN			6
#define	X_ENABLE_PIN			24

#define	Y_STEP_PIN			23
#define	Y_DIR_PIN			22
#define	Y_MIN_PIN			5
#define	Y_MAX_PIN			2
#define	Y_ENABLE_PIN			24

#define	Z_STEP_PIN			26
#define	Z_DIR_PIN			25
#define	Z_MIN_PIN			1
#define	Z_MAX_PIN			0
#define	Z_ENABLE_PIN			24

#define	E_STEP_PIN			28
#define	E_DIR_PIN			27
#define E_ENABLE_PIN			24

#define	PS_ON_PIN			15
#define STEPPER_ENABLE_PIN		24

#define SDPOWER				-1
#define SDSS				-1
#define LED_PIN				-1
#define FAN_PIN				-1
#define KILL_PIN			-1
#define ALARM_PIN			-1

#define HEATER_0_PIN       		4
#define TEMP_0_PIN          		1//D30 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!

#define HEATER_1_PIN       		3
#define TEMP_1_PIN          		2//D29 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!

/*  Unused (0) (1) (2) (3) (4) (5) (6) (7) 8 9 10 11 12 13 14 (15) 16 17 (18) (19) 20 21 (22) (23) (24) (25) (26) (27) (28) (29) (30) 31  */



#endif

** It has been tested on an Ubuntu 11.10 64 bit machine with Arduino 1.0, with ATMega644 (no P) and clock rate of 20Mhz
Attachments:
open | download - steps.txt (4.1 KB)
open | download - Arduino.h (5.5 KB)
open | download - wiring.h (3.3 KB)
open | download - Configuration.h (9.5 KB)
open | download - pins.h (24.2 KB)
Re: Sprinter Firmware for Generation 7 Electronics
February 17, 2012 04:47AM
Sorry for not replying to your precise questions, but what are the problems you had with Teacup on Gen 7 ? I have it working like a charm here.


Most of my technical comments should be correct, but is THIS one ?
Anyway, as a rule of thumb, always double check what people write.
Re: Sprinter Firmware for Generation 7 Electronics
February 17, 2012 06:23AM
The firmware kept crashing after receiving a few commands during printing.. My guess is that it is a hardware problem that I have ( [forums.reprap.org] ) specially that I am using some salvaged old capacitors, and am too lazy/busy to go and buy some new ones..
Also, when I saw this post (http://blog.reprap.org/2011/09/tipping-point-of-print-quality-open.html) I really wanted to try sprinter smiling smiley
Re: Sprinter Firmware for Generation 7 Electronics
February 17, 2012 06:54AM
Well, if this is really an hardware problem, you might have the same problem with another firmware.

I'm going to read your post about that anyway, I got freezes with gen7 and Teacup after some random printing time, I blame it on EMI for now.


Edit : Also I tend to believe that Teacup will do anything sprinter can do.

Edited 1 time(s). Last edit at 02/17/2012 06:56AM by DeuxVis.


Most of my technical comments should be correct, but is THIS one ?
Anyway, as a rule of thumb, always double check what people write.
Re: Sprinter Firmware for Generation 7 Electronics
February 17, 2012 09:24AM
Well, am not the expert here since I haven't printed anything yet!!!!!! am building my reprap slowly as I have many other things to attend to sad smiley
I guess Teacup is very good since when I looked at a comparison of firmwares compatible with Gen 7, it was the definite choice for me.. when I start printing I might need to try several firmwares to see where I will be comfortable.

And during my next visit to an electronics shop, I will make sure to buy 22pF capacitors so I can give teacup another shot as u r right, if it gives problems with teacup, then it's probably a matter of time until it gives problems with anything else..
Re: Sprinter Firmware for Generation 7 Electronics
December 24, 2012 02:29PM
Hello. I am also wondering how can i uploud firmware (sprinter or even marlin) on my gen7 1284p 20MHz ?

Can it be done without programmer?

Edited 2 time(s). Last edit at 12/24/2012 03:11PM by len24.
Re: Sprinter Firmware for Generation 7 Electronics
December 25, 2012 05:06AM
len24 Wrote:
-------------------------------------------------------
> Can it be done without programmer?
Yes if the processor already has a bootloader on it (as in a Gen7 kit), no if it's completely blank (as bought from a general electronics supplier).

Instructions for both methods are here.
Sorry, only registered users may post in this forum.

Click here to login