Notifications
Clear all

DOGLCD Implementation issue  

  RSS
damian.m
(@damian-m)
Active Member
DOGLCD Implementation issue

Hi, I am trying to compile the firmware version 3.0.10 for use with the lcd display: http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller ,
but I get compilation errors. In Marlin versions this works correctly,
but in firmware 3.0.10, when setting up in the same way that in Marlin the file dogm_lcd_implementation.h is incomplete.

Configuration firmware 3.0.10 for Prusa i3 MK2

***************************************************************
//#define ULTRA_LCD //general LCD support, also 16x2
#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
#define SDSUPPORT // Enable SD Card Support in Hardware Console

//#define REPRAP_DISCOUNT_SMART_CONTROLLER

#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER

***************************************************************

When using REPRAP DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER option the process defines DOGLED using the file dogm_lcd_implementation.h
#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
#define DOGLCD
#define U8GLIB_ST7920
#define REPRAP_DISCOUNT_SMART_CONTROLLER
#endif

The following logic is in the ultralcd.cpp file
#ifdef DOGLCD
#include "dogm_lcd_implementation.h"
#else
#include "ultralcd_implementation_hitachi_HD44780.h"
#endif

When using the library dogm_lcd_implementation.h the compilation process fails because several functions are missing, such as:

lcd_implementation_init_noclear
lcd_set_custom_characters
#define lcd_implementation_drawmenu_back_RAM_selected(row, str, data) lcd_implementation_drawmenu_generic_RAM(row, str, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0])
#define lcd_implementation_drawmenu_back_RAM(row, str, data) lcd_implementation_drawmenu_generic_RAM(row, str, ' ', LCD_STR_UPLEVEL[0])

#define lcd_implementation_drawmenu_setlang_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, '>', ' ')
#define lcd_implementation_drawmenu_setlang(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', ' ')

All functions are defined in the library ultralcd_implementation_hitachi_HD44780.h

If I comment the line "#define DOGLCD" the compilation process uses the library ultralcd_implementation_hitachi_HD44780.h,
The process compiles correctly, but nothing appears on the display.

I wanted to know if there are any options that I am missing comment or uncomment.

Thanks and Regards.

Posted : 04/04/2017 2:58 pm
patrick.s13
(@patrick-s13)
Eminent Member
Re: DOGLCD Implementation issue

Do you have the dependant Arduino libraries installed ??? If not that can cause your issue.

Posted : 05/04/2017 12:54 pm
damian.m
(@damian-m)
Active Member
Topic starter answered:
Re: DOGLCD Implementation issue

Hi patrick.s13,
Yes, I have alll libraries installed. When I copy all missing functions from ultralcd_implementation_hitachi_HD44780.h to dogm_lcd_implementation.h the firmware compile succesfully.

Posted : 05/04/2017 2:43 pm
patrick.s13
(@patrick-s13)
Eminent Member
Re: DOGLCD Implementation issue

You have this library installed and updated ? U8GLIB

I know you said you have all libraries updated ...Just double checking as this one got me first time I set one of these up .

Posted : 05/04/2017 5:53 pm
damian.m
(@damian-m)
Active Member
Topic starter answered:
Re: DOGLCD Implementation issue

Yes, the U8GLIB library is up to date. The problem is that the functions that I mentioned are used by ultralcd.cpp program but only were declared in ultralcd_implementation_hitachi_HD44780.h but not in dogm_lcd_implementation.h.

The following are the missing functions

lcd_implementation_init_noclear
lcd_implementation_drawmenu_generic_RAM
lcd_implementation_drawmenu_back_RAM_selected
lcd_implementation_drawmenu_back_RAM
lcd_implementation_drawedit_2
lcd_set_custom_characters()
lcd_set_custom_characters_arrows()
lcd_set_custom_characters_nextpage()
lcd_implementation_drawmenu_setlang_selected
lcd_implementation_drawmenu_setlang
lcd_set_custom_characters_arrows()
lcd_set_custom_characters_degree()
lcd_implementation_print_at(unsigned char, unsigned char, int)
lcd_print_at_PGM(unsigned char, unsigned char, char const*)
lcd_implementation_write(char)

I think that the library dogm_lcd_implementation.h is incomplete because the Original Prusa MK2 don't use the lcd REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER.

Regards

Posted : 05/04/2017 6:39 pm
patrick.s13
(@patrick-s13)
Eminent Member
Re: DOGLCD Implementation issue

Do we know which version of Marlin the firmware is based off of ? Maybe you could grab the latest version of Marlin and see if the code is complete in that version ?

Posted : 05/04/2017 9:29 pm
damian.m
(@damian-m)
Active Member
Topic starter answered:
Re: DOGLCD Implementation issue

The original Marlin firmware don't have this functions because were added in the Original Prusa MK2 firmware to add new functionalities to LDC menu.

Posted : 05/04/2017 10:33 pm
patrick.s13
(@patrick-s13)
Eminent Member
Re: DOGLCD Implementation issue

Marlin does indeed have support for both of those LCDs built in ...I have run both on two different machines.

Posted : 06/04/2017 3:45 am
damian.m
(@damian-m)
Active Member
Topic starter answered:
Re: DOGLCD Implementation issue

Yes, with Marlin my LCD works succesfully, the problem is with the Original Prusa MK2 firmware that has new menu items and functions in ultralcd.cpp.

Posted : 06/04/2017 8:19 pm
solomon.c
(@solomon-c)
Eminent Member
Re: DOGLCD Implementation issue

Any new information on this problem? I've run into the same issue. I was never able to compile after changing the #define that enables the full graphic smart controller. I can compile the default mk2 firmware and the marlin firmware just fine.

Can we copy from the marlin source and update the mk2 source? I'm too new both of these firmwares (been using a smoothieboard).

I'm happy to work on code, I'm just still trying to understand the problem.

Posted : 07/07/2017 1:01 am
solomon.c
(@solomon-c)
Eminent Member
Re: DOGLCD Implementation issue

After a good bit of hacking on the code, I've managed to get nothing working. The lcd the firmware expects to find is inexpensive and I think that's the way to go...

Posted : 08/07/2017 6:53 am
metacollin
(@metacollin)
Eminent Member
Re: DOGLCD Implementation issue

Hi, sorry about bumping an older thread. There isn't any problem per se. The ultralcd code is one of the main areas of the Marlin firmware that was changed specifically for the Prusa i3 printers, and it is pretty clear to me that they never intended to ever use anything besides your standard HD44780 character LCD. There is no code to port from Marlin, all the Marlin code is already there. It just won't work with the Prusa-specific changes.

I also noticed that someone had made an aborted attempt to abstract out the LCD code using common lcd_implementation_....() functions, but seemed to have said "screw it" half way through and just hard coded calls to the arduino lcd library instead. All of those calls would need to be abstracted out.

Fortunately, they only use hard coded calls in the code a few hundred times 😛 . (Not joking, 385 times to be exact).

Anyway I went ahead and finished abstracting out the calls and finished writing the dogm lcd implementation.

It compiles, but as to whether it works.... I don't actually have any suitable display handy to test it with, and I'll be completely honest: I was too lazy to actually read up on the graphics controller so I pretty much just guessed at how the coordinates worked. So even if it works, it might not draw text in the right spots, or might draw over things rendering them unreadable. Any issue along those lines should be very simple to fix at least.

Just anyone who decides to try this, be prepared to and comfortable with reflashing the stock firmware and restoring the old character LCD if there are problems. I make no guarantees. The code changes are limited to the display code, so while it might not work or work well, it should be relatively safe to test otherwise.

Anyway, you can build it straight from the Arduino IDE v1.8.x. You can get the code from my fork at https://github.com/metacollin/Prusa-Firmware (changes are only in the MK2 branch, which it should default to).

Or if you're a sensible person and hate git, here is a good old fashioned patch file attached. Just apply from the top most level of the stock prusa firmware code from the .zip or .tar.gz downloadable from the Prusa website with

patch -p1 < path/to/lcd.patch

I assume there is something for windows that can deal with patch files, but I wouldn't know. The above will work from the command line on macOS or your favorite flavor of linux.

If anyone tries it, photos of what doesn't work would be extremely helpful, and if by dumb luck it actually works correctly untested, a photo or two of it in action would also be appreciated :).

Posted : 23/02/2018 8:49 pm
jan.i11
(@jan-i11)
New Member
Re: DOGLCD Implementation issue

Hello Metacollin

I tried your change and we have some problem with patch. Some lines are on different line number. Something about 8 merge conflicts.

After merge I successfully make a build and update firmware.

When I start printer nothing happen. Even motors didn’t start.

Thank you for try.

Jan

Posted : 12/06/2018 3:37 pm
jan.i11
(@jan-i11)
New Member
Re: DOGLCD Implementation issue

Hello meacollin,

which version of U8glib are you using for compilation? I use 1.19.1.
I get an error when I upload the firmware to printer. See below.
Everywhere is written that is problem with memory.

avrdude: verification error, first mismatch at byte 0x3c000
0x00 != 0xff
avrdude: verification error; content mismatch
avrdude: verification error; content mismatch

My printer is i3 mk2 with RAMBo 13a

Thank you

EDIT: Problem was with big size of hex. So I remove all translations and leave only CZ and EN. After that is fine.
In attachment you can see picture and on link below you can download video.
https://drive.google.com/file/d/1DGK0VS1pe-cTBbFemBDJey2dK_OVjVy_/view?usp=sharing

Posted : 19/06/2018 2:04 pm
Bo Herrmannsen
(@bo-herrmannsen)
Active Member
Re: DOGLCD Implementation issue

any news on this?

i would love to use the prusa firmware on my Mendel90

i guess that me using a Ramps board is not the biggest issue here

is dual Z stepper and Dual Z endstops will in the code or has that been ripped out?

Posted : 03/08/2018 10:43 pm
Share: