Welcome! Log In Create A New Profile

Advanced

MARLIN - generic LCD 16x2 (Megatronics 2 board)

Posted by [email protected] 
MARLIN - generic LCD 16x2 (Megatronics 2 board)
March 03, 2013 07:54AM
I'm just finishing my Prusa with a relatively new megatronics 2 board and Marlin firmware.

It's my first 3D printer, so I'm fighting against a high learning curve.

But I think I almost got it, It moves allright (not calibrated yet), but I'm missing some pieces to finish it, so I'm awaiting delivery.

In the meanwhile, I was trying to hook up a 16x2 LCD display I had lying around in my arduino stuff. It should display "usefull data".
I'm pretty sure I connected it like they say on the Wiki page, but It only displays one row of 16 black squares (after some turning the pot onboard).

I only found this in advanced settings, toyed around a little, but alas:

#ifdef ULTIPANEL
// #define NEWPANEL //enable this if you have a click-encoder panel
// #define SDSUPPORT
// #define ULTRA_LCD
// #define LCD_WIDTH 20
// #define LCD_HEIGHT 4

#else //no panel but just lcd
#ifdef ULTRA_LCD
#define LCD_WIDTH 16
#define LCD_HEIGHT 2
#endif
#endif

What other settings matter in Marlin?

thanks
Re: MARLIN - generic LCD 16x2 (Megatronics 2 board)
March 03, 2013 09:46AM
Look for this section in configuration.h. Un-comment your setup.

//LCD and SD support
//#define ULTRA_LCD //general lcd support, also 16x2
//#define SDSUPPORT // Enable SD Card Support in Hardware Console

//#define ULTIMAKERCONTROLLER //as available from the ultimaker online store.
//#define ULTIPANEL //the ultipanel as on thingiverse

// The RepRapDiscount Smart Controller (white PCcool smiley
// [reprap.org]
//#define REPRAP_DISCOUNT_SMART_CONTROLLER

// The GADGETS3D G3D LCD/SD Controller (blue PCcool smiley
// [reprap.org]
#define G3D_PANEL
Re: MARLIN - generic LCD 16x2 (Megatronics 2 board)
March 03, 2013 11:38AM
ok,

got that,

then I got some errors while compiling;

'SHIFT_CLK' was not declared in this scope. and other similar.

I read about similar error codes, and tried to fill in what I found by googling

when I put this at the beginning of the scope:

#define SHIFT_CLK 38
#define SHIFT_LD 42
#define SHIFT_OUT 40
#define SHIFT_EN 17
int8_t encoderDiff;

it will compile, but I think the variables are wrong. what are these declared variables? do they have anything to do with the pinouts?
Re: MARLIN - generic LCD 16x2 (Megatronics 2 board)
March 03, 2013 12:03PM
something is getting clearer to me.

I think the ULTRA_LCD is not the same as a generic 16x2 lcd without buttons.

I bet the variables above have something to do with those buttons, haven't they?

those are my settings now, but the problem remains

//LCD and SD support
#define ULTRA_LCD //general lcd support, also 16x2
//#define SDSUPPORT // Enable SD Card Support in Hardware Console

...

//#if defined(ULTIMAKERCONTROLLER) || defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
// #define ULTIPANEL
// #define NEWPANEL
//#endif

...

#ifdef ULTIPANEL
#define NEWPANEL //enable this if you have a click-encoder panel
#define SDSUPPORT
#define ULTRA_LCD
#define LCD_WIDTH 20
#define LCD_HEIGHT 4

#else //no panel but just lcd
#ifdef ULTRA_LCD
#define LCD_WIDTH 16
#define LCD_HEIGHT 2
#endif
#endif
Re: MARLIN - generic LCD 16x2 (Megatronics 2 board)
March 05, 2013 03:26AM
does someone know where the pinouts for the LCD are declared in Marlin?

thx
Re: MARLIN - generic LCD 16x2 (Megatronics 2 board)
March 05, 2013 08:53AM
pins.h...
Re: MARLIN - generic LCD 16x2 (Megatronics 2 board)
March 06, 2013 02:13AM
yeah stupid me smiling smiley

big thanks, we're getting there..

as I suspected, the declarations were commented out //

still something not right with the pin numbers I guess, but that's not a firmware problem :-)
Re: MARLIN - generic LCD 16x2 (Megatronics 2 board)
March 06, 2013 03:36AM
SOLVED:

I took a close look at the schematics of the board and compared Marlin to it.

what it is now in Marlin:

/*
#define SHIFT_CLK 38
#define SHIFT_LD 42
#define SHIFT_OUT 40
#define SHIFT_EN 17

#define LCD_PINS_RS 16
#define LCD_PINS_ENABLE 17
#define LCD_PINS_D4 23
#define LCD_PINS_D5 25
#define LCD_PINS_D6 27
#define LCD_PINS_D7 29
*/

what it should be:

#define SHIFT_CLK 63
#define SHIFT_LD 42
#define SHIFT_OUT 17
#define SHIFT_EN 7

#define LCD_PINS_RS 14
#define LCD_PINS_ENABLE 15
#define LCD_PINS_D4 30
#define LCD_PINS_D5 31
#define LCD_PINS_D6 32
#define LCD_PINS_D7 33

I'm glad I found it, and I hope it will help others.
Sorry, only registered users may post in this forum.

Click here to login