[Closed] OLED replacement  

  RSS
mat.p
(@mat-p)
Eminent Member

I have a MK2S on pre-order and I'm looking forward to building it. I already have a cheap 3d printer that uses the graphical type display and I'm expecting to be disappointed by the four line character display on the Prusa. Small price to pay for an excellent printer though.

For compatibility and originality reasons, I'd not be looking to replace the screen with a bitmapped one, but LCD character displays are generally rather poor so I'm thinking that an OLED character display may improve the overall unit quite a bit.

The Winstar WEH002004AWPP5N00000 seems to be an option here, but it would need to be physically and electronically compatible. Has anyone swapped the backlit display for an OLED one already, can someone point me to some detail of the supplied screen so I can research this while I wait for delivery?

Thanks.

...
Posted : 30/04/2017 3:06 pm
christophe.p
(@christophe-p)
Member Moderator

Honnestly I do not see what gain you will have by changing the standard LCD by an OLED one.

But if you feel concerned by the look and feel of the printing state and information, maybe going to an OctoPrint box with TouchUI activated on a graphical screen will be a track to follow for you.

I'm like Jon Snow, I know nothing....
Posted : 30/04/2017 4:32 pm
mat.p
(@mat-p)
Eminent Member

Gain? Nothing, it's simply cosmetic, there's not change in function.
The OLED displays simply look better, significantly. I think that a printer as capable as this deserves a nice screen, that's all.

I already use Octoprint to drive the printer I have, and I don't find the TouchUI thing t be a great solution. I'm accustomed to managing the printer through the Octoprint interface and just glancing at the LCD for a little but on real-time data or moving the dial to change flow rate.

Out of all the printers Prusa has sold, I'd be surprised if I was the fist to consider this, but if that's the case I'll just buy a display or two once the printer arrives and see how it goes - posting results here when available.

...
Posted : 30/04/2017 6:51 pm
mat.p
(@mat-p)
Eminent Member

So I picked up a cheap reprap display board, printed an enclosure and bought an OLED panel. Removing the LCD was tricky because I count find any solder-wick but I got it out and replaced it with the new one. Pictures show the results.
It looks great, frankly. The characters seem a bit larger than standard, and much nicer to read.

I may have damaged something in the process though, because when accessing the menu, the display seems to 'lose sync' or something, you can see the menu shifted over to the right in one of the images, and sometime the display just corrupts completely. Could be a timing issue, could be just that this swap-out is not possible. I'll investigate further, and break out the scope if it comes to it!

Overall, I think this is a nice improvement and for the small cost it could be nice if the i3 shipped with these.

...
Posted : 14/05/2017 12:06 pm
mat.p
(@mat-p)
Eminent Member

Well, after a little effort, it's working just fine. I've screwed up the pads on the controller PCB, but that's an easy and cheap part to replace. The screen now works just fine, I think it was a bad connection or electrical noise from the wire routing.
I'll assemble this onto a replacement controller board and order up another screen for the i3 when it arrives. Shame they don't make one in Orange!

...
Posted : 14/05/2017 11:37 pm
bjarke istrup.p
(@bjarke-istrup-p)
Active Member

Just wondering, wouldn't it be a bad idea to use OLED, since it might "burn-in"?

Having the same pixels on all the time will give uneven wear, which would give a burn-in kind of image. (got the same on my phone, with gps graphics having burn-in into the OLED screen) 🙂

...
Posted : 14/05/2017 11:57 pm
mat.p
(@mat-p)
Eminent Member

No idea. Probably.
The spec sheet states 40,000 hours operation to 50% brightness loss, but that's more to the wearing out of the panel than burning in. I know OLED was very susceptible to this when they were new tech, but I'm hoping that refinements have been made. A character display such as this is quite different to a full color display, and I'm hoping that they're designed for this type of use.

That said, let's see what it looks like in a month or three 🙂

...
Posted : 15/05/2017 12:34 am
Knickohr
(@knickohr)
Member Moderator

Hi !

Did you 1:1 replace the LCD withe the OLED ? Is it pin-compatible ?

Thomas

Posted : 15/05/2017 10:12 am
mark.w2
(@mark-w2)
Eminent Member

Looks great,

part numebr of the screen ? was the wiring nthe same, so just a 1:1 replacement ?

...
Posted : 15/05/2017 11:54 pm
mat.p
(@mat-p)
Eminent Member

Part number was in my original post. Yes, it is pin compatible with the LCD.
Pin 3 is not connected on the panel and is not needed as it is the bias voltage for the LCD contrast. Pin 15&16 are not connected as they are the LCD backlight, and of course it is ran in 4bit mode, so you actually need only 8 wires (GND, 5v, 4 Data, Enable and RS) but just connect the whole lot anyway because the pin header is the only structural part.

...
Posted : 16/05/2017 12:28 am
mat.p
(@mat-p)
Eminent Member

Also, with regard to potential damage of the screen due to burn-in, I've been looking at the Marin code, and I may have a simple firmware hack to mitigate it.

By adding these four lines right at the top of ultralcd.cpp it will jump out of the LCD control block early if the status message is "SCREENSAVER", so adding M117 SCREENSAVER to the 'completed' g-code section of the slicer will basically turn off the display when a print finishes, and anything that changes the status message, such as starting a print, will turn it back on.

if (strcmp(lcd_status_message,"SCREENSAVER") == 0) {
lcd.clear();
return;
}

At least, that's the theory. I tested it with if(1==1) and the screen stays off, and if(1==2) and it stays on, so the logic is sound, but when checking for the magic string, it is not matching, so either I'm doing the string compare wrong, or lcd_status_message does not equal what I think it does. C isn't my first language and I'm not yet familiar with the Marlin codebase. I'll solve it in a day or two but if anyone happens to know what I'm doing wrong feel free to point it out 🙂

...
Posted : 16/05/2017 2:05 am
Knickohr
(@knickohr)
Member Moderator

Ahhh, goog to know 🙂

So therefore, this display should also work : REC002004AWPP5N0

Thomas

Posted : 16/05/2017 12:04 pm
mat.p
(@mat-p)
Eminent Member

Amazing how a simple task turns into a nightmare.
So, as it turns out, there are differences at the controller level between the regular HD44780 and the OLED controllers, slight but enough to cause problems.

The screen *can* work, but does spend a lot of its time actually not doing so! This needs a modification to the Marlin firmware to be fully supported. The OLED for now is still on the clone, and I have a better LCD or order for the genuine Prusa. (the white text on black background one someone shown in another thread)

I still plan to get this to work correctly, but it looks like it'll take a lot longer than expected, due to not having a whole lot of time to dedicate to this.

...
Posted : 13/07/2017 3:36 pm
Knickohr
(@knickohr)
Member Moderator

Found some code which shows the difference in initialization for LCD/OLED :


/* myLCD_Char.c

#include "CyLib.h"
#include "myLCD_Char.h"
#include "device.h"

static void LCD_Char_WrDatNib(uint8 nibble) ;
static void LCD_Char_WrCntrlNib(uint8 nibble) ;

/* Stores state of component. Indicates whether component is or not
* in the enable state.
*/
uint8 LCD_Char_enableState = 0u;

uint8 LCD_Char_initVar = 0u;

uint8 LCDOLED=0; // Variable para definir si usamos LCD=0 o OLED=1
//uint8 LCDOLED=1;

/*******************************************************************************
* Function Name: LCD_Char_Init
********************************************************************************
*
* Summary:
* Perform initialization required for the components normal work.
* This function initializes the LCD hardware module as follows:
* Enables a 4-bit interface
* Clears the display
* Enables the auto cursor increment
* Resets the cursor to start position
* Also, it loads a custom character set to the LCD if it was defined in the customizer.
*
* Parameters:
* None.
*
* Return:
* None.
*
* Reentrant:
* No.
*
*******************************************************************************/
void LCD_Char_Init(void)
{
/* INIT CODE */
CyDelay(40u); /* Delay 40 ms */
LCD_Char_WrCntrlNib(LCD_Char_DISPLAY_8_BIT_INIT); /* Selects 8-bit mode */
CyDelay(5u); /* Delay 5 ms */
LCD_Char_WrCntrlNib(LCD_Char_DISPLAY_8_BIT_INIT); /* Selects 8-bit mode */
CyDelay(15u); /* Delay 15 ms */
LCD_Char_WrCntrlNib(LCD_Char_DISPLAY_8_BIT_INIT); /* Selects 8-bit mode */
CyDelay(1u); /* Delay 1 ms */
LCD_Char_WrCntrlNib(LCD_Char_DISPLAY_4_BIT_INIT); /* Selects 4-bit mode */
CyDelay(5u); /* Delay 5 ms */

LCD_Char_WriteControl(LCD_Char_CURSOR_AUTO_INCR_ON); /* Incr Cursor After Writes */
LCD_Char_WriteControl(LCD_Char_DISPLAY_CURSOR_ON); /* Turn Display, Cursor ON */
LCD_Char_WriteControl(LCD_Char_DISPLAY_2_LINES_5x10); /* 2 Lines by 5x10 Characters */
LCD_Char_WriteControl(LCD_Char_DISPLAY_CURSOR_OFF); /* Turn Display, Cursor OFF */
LCD_Char_WriteControl(LCD_Char_CLEAR_DISPLAY); /* Clear LCD Screen */
LCD_Char_WriteControl(LCD_Char_DISPLAY_ON_CURSOR_OFF); /* Turn Display ON, Cursor OFF */
LCD_Char_WriteControl(LCD_Char_RESET_CURSOR_POSITION); /* Set Cursor to 0,0 */
CyDelay(5u);

#if(LCD_Char_CUSTOM_CHAR_SET != LCD_Char_NONE)
LCD_Char_LoadCustomFonts(LCD_Char_customFonts);
#endif // LCD_Char_CUSTOM_CHAR_SET != LCD_Char_NONE */
}

/*******************************************************************************
* Function Name: OLED_Char_Init
********************************************************************************
*
* Summary:
* Perform initialization required for the components normal work.
* This function initializes the OLED as follows:
* Enables a 4-bit interface
* Clears the display
* Enables the auto cursor increment
* Resets the cursor to start position
* Also, it loads a custom character set to the LCD if it was defined in the customizer.
*
* Parameters:
* None.
*
* Return:
* None.
*
* Reentrant:
* No.
*
*******************************************************************************/
void OLED_Char_Init(void)
{
/* INIT CODE */
CyDelay(40u); /* Delay 40 ms */
LCD_Char_WrCntrlNib(0x00); //Reset for 5 times
CyDelay(5u); /* Delay 5 ms */
LCD_Char_WrCntrlNib(0x00);
CyDelay(15u); /* Delay 15 ms */
LCD_Char_WrCntrlNib(0x00);
CyDelay(1u); /* Delay 1 ms */
LCD_Char_WrCntrlNib(0x00);
CyDelay(5u);
LCD_Char_WrCntrlNib(0x00);
CyDelay(5u);
LCD_Char_WrCntrlNib(LCD_Char_DISPLAY_4_BIT_INIT); /* Selects 4-bit mode */
CyDelay(5u); /* Delay 5 ms */

LCD_Char_WriteControl(0x28);
CyDelay(5u);
LCD_Char_WriteControl(LCD_Char_DISPLAY_ON_CURSOR_OFF);
CyDelay(5u);
LCD_Char_WriteControl(LCD_Char_CURSOR_AUTO_INCR_ON); /* Incr Cursor After Writes */
CyDelay(5u);
LCD_Char_WriteControl(LCD_Char_CURSOR_HOME);
CyDelay(5u);
LCD_Char_WriteControl(LCD_Char_CLEAR_DISPLAY); /* Clear LCD Screen */
CyDelay(5u);

}

/*******************************************************************************
* Function Name: LCD_Char_Enable
********************************************************************************
*
* Summary:
* Turns on the display.
*
* Parameters:
* None.
*
* Return:
* None.
*
* Reentrant:
* No.
*
* Theory:
* This function has no effect when it is called the first time as
* LCD_Char_Init() turns on the LCD.
*
*******************************************************************************/
void LCD_Char_Enable(void)
{
LCD_Char_DisplayOn();
LCD_Char_enableState = 1u;
}

/*******************************************************************************
* Function Name: LCD_Char_Start
********************************************************************************
*
* Summary:
* Perform initialization required for the components normal work.
* This function initializes the LCD hardware module as follows:
* Enables 4-bit interface
* Clears the display
* Enables auto cursor increment
* Resets the cursor to start position
* Also, it loads a custom character set to the LCD if it was defined in the customizer.
* If it was not the first call in this project, then it just turns on the
* display
*
*
* Parameters:
* LCD_Char_initVar - global variable.
*
* Return:
* LCD_Char_initVar - global variable.
*
* Reentrant:
* No.
*
*******************************************************************************/
void LCD_Char_Start(void)
{
/* If not initialized, perform initialization */
if(LCD_Char_initVar == 0u)
{
if (LCDOLED==0) LCD_Char_Init(); //Inicializa el LCD
else OLED_Char_Init(); //Inicializar el OLED

LCD_Char_initVar = 1u;
}

/* Turn on the LCD */
LCD_Char_Enable();
}

/*******************************************************************************
* Function Name: LCD_Char_Stop
********************************************************************************
*
* Summary:
* Turns off the display of the LCD screen.
*
* Parameters:
* None.
*
* Return:
* None.
*
* Reentrant:
* No.
*
*******************************************************************************/
void LCD_Char_Stop(void)
{
/* Calls LCD Off Macro */
LCD_Char_DisplayOff();
LCD_Char_enableState = 0u;
}

/*******************************************************************************
* Function Name: LCD_Char_Position
********************************************************************************
*
* Summary:
* Moves the active cursor location to a point specified by the input arguments
*
* Parameters:
* row: Specific row of LCD module to be written
* column: Column of LCD module to be written
*
* Return:
* None.
*
* Note:
* This only applies for LCD displays that use the 2X40 address mode.
* In this case Row 2 starts with 0x28 offset from Row 1.
* When there are more than 2 rows, each row must be fewer than 20 characters.
*
*******************************************************************************/
void LCD_Char_Position(uint8 row, uint8 column)
{
switch (row)
{
case (uint8)0:
LCD_Char_WriteControl(LCD_Char_ROW_0_START + column);
break;
case (uint8) 1:
LCD_Char_WriteControl(LCD_Char_ROW_1_START + column);
break;
case (uint8) 2:
LCD_Char_WriteControl(LCD_Char_ROW_2_START + column);
break;
case (uint8) 3:
LCD_Char_WriteControl(LCD_Char_ROW_3_START + column);
break;
default:
/* if default case is hit, invalid row argument was passed.*/
break;
}
}

/*******************************************************************************
* Function Name: LCD_Char_PrintString
********************************************************************************
*
* Summary:
* Writes a zero terminated string to the LCD.
*
* Parameters:
* string: Pointer to head of char8 array to be written to the LCD module
*
* Return:
* None.
*
*******************************************************************************/
void LCD_Char_PrintString(char8 const string[])
{
uint8 indexU8 = 1u;
char8 current = *string;

/* Until null is reached, print next character */
while((char8) '\0' != current)
{
LCD_Char_WriteData((uint8)current);
current = string[indexU8];
indexU8++;
}
}

/*******************************************************************************
* Function Name: LCD_Char_PutChar
********************************************************************************
*
* Summary:
* Writes a single character to the current cursor position of the LCD module.
* Custom character names (_CUSTOM_0 through
* _CUSTOM_7) are acceptable as inputs.
*
* Parameters:
* character: Character to be written to LCD
*
* Return:
* None.
*
*******************************************************************************/
void LCD_Char_PutChar(char8 character)
{
LCD_Char_WriteData((uint8)character);
}

/*******************************************************************************
* Function Name: LCD_Char_WriteData
********************************************************************************
*
* Summary:
* Writes a data byte to the LCD module's Data Display RAM.
*
* Parameters:
* dByte: Byte to be written to the LCD module
*
* Return:
* None.
*
*******************************************************************************/
void LCD_Char_WriteData(uint8 dByte)
{
uint8 nibble;

nibble = dByte >> LCD_Char_NIBBLE_SHIFT;

/* Write high nibble */
LCD_Char_WrDatNib(nibble);

nibble = dByte & LCD_Char_NIBBLE_MASK;
/* Write low nibble */
LCD_Char_WrDatNib(nibble);
}

/*******************************************************************************
* Function Name: LCD_Char_WriteControl
********************************************************************************
*
* Summary:
* Writes a command byte to the LCD module.
*
* Parameters:
* cByte: The byte to be written to theLCD module
*
* Return:
* None.
*
*******************************************************************************/
void LCD_Char_WriteControl(uint8 cByte)
{
uint8 nibble;

nibble = cByte >> LCD_Char_NIBBLE_SHIFT;

/* WrCntrlNib(High Nibble) */
LCD_Char_WrCntrlNib(nibble);
nibble = cByte & LCD_Char_NIBBLE_MASK;

/* WrCntrlNib(Low Nibble) */
LCD_Char_WrCntrlNib(nibble);
}

/*******************************************************************************
* Function Name: LCD_Char_WrDatNib
********************************************************************************
*
* Summary:
* Writes a data nibble to the LCD module.
*
* Parameters:
* nibble: Byte containing nibble in least significant nibble to be written
* to LCD module.
*
* Return:
* None.
*
*******************************************************************************/
static void LCD_Char_WrDatNib(uint8 nibble)
{
/* RS should be low to select data register */
LCD_RS_Write(1);
LCD_WR_Write(0);
CyDelayUs(0u);
LCD_EN_Write(1);
CyDelayUs(10); //1us
Data_Bus_Write(nibble);
CyDelayUs(10); //1us
LCD_EN_Write(0);
CyDelayUs(10); //1us
}

/*******************************************************************************
* Function Name: LCD_Char_WrCntrlNib
********************************************************************************
*
* Summary:
* Writes a control nibble to the LCD module.
*
* Parameters:
* nibble: The byte containing a nibble in the four least significant bits.????
*
* Return:
* None.
*
*******************************************************************************/
static void LCD_Char_WrCntrlNib(uint8 nibble)
{
/* RS and RW should be low to select instruction register and write operation respectively */
CyDelayUs(10); //10us
LCD_RS_Write(0);
LCD_WR_Write(0);
LCD_EN_Write(1);
Data_Bus_Write(nibble);
//CyDelayUs(1);
//LCD_EN_Write(1);
CyDelayUs(1);
LCD_EN_Write(0);
CyDelayUs(10);
}

#if(LCD_Char_CONVERSION_ROUTINES == 1u)

/*******************************************************************************
* Function Name: LCD_Char_PrintInt8
********************************************************************************
*
* Summary:
* Print a byte as two ASCII characters.
*
* Parameters:
* value: The byte to be printed out as ASCII characters.
*
* Return:
* None.
*
*******************************************************************************/
void LCD_Char_PrintInt8(uint8 value)
{
static char8 const CYCODE LCD_Char_hex[16u] = "0123456789ABCDEF";

LCD_Char_PutChar((char8) LCD_Char_hex[value >> LCD_Char_BYTE_UPPER_NIBBLE_SHIFT]);
LCD_Char_PutChar((char8) LCD_Char_hex[value & LCD_Char_BYTE_LOWER_NIBBLE_MASK]);
}

/*******************************************************************************
* Function Name: LCD_Char_PrintInt16
********************************************************************************
*
* Summary:
* Print a uint16 as four ASCII characters.
*
* Parameters:
* value: The uint16 to be printed out as ASCII characters.
*
* Return:
* None.
*
*******************************************************************************/
void LCD_Char_PrintInt16(uint16 value)
{
LCD_Char_PrintInt8((uint8)(value >> LCD_Char_U16_UPPER_BYTE_SHIFT));
LCD_Char_PrintInt8((uint8)(value & LCD_Char_U16_LOWER_BYTE_MASK));
}

/*******************************************************************************
* Function Name: LCD_Char_PrintInt32
********************************************************************************
*
* Summary:
* Print a uint32 hexadecimal number as eight ASCII characters.
*
* Parameters:
* value: The uint32 to be printed out as ASCII characters.
*
* Return:
* None.
*
*******************************************************************************/
void LCD_Char_PrintInt32(uint32 value)
{
uint8 shift = LCD_Char_32_BIT_SHIFT;

while (shift != 0u)
{
/* "shift" var should be subtracted by 8 prior shifting. This implements
* shifting by 24, 16, 8 and 0u.
*/
shift -= LCD_Char_8_BIT_SHIFT;

/* Print 8 bits of uint32 hex number */
LCD_Char_PrintInt8((uint8) ((uint32) (value >> shift)));
}
}

/*******************************************************************************
* Function Name: LCD_Char_PrintNumber
********************************************************************************
*
* Summary:
* Print an uint16 value as a left-justified decimal value.
*
* Parameters:
* value: A 16-bit value to be printed in ASCII characters as a decimal number
*
* Return:
* None.
*
* Note:
* This function is implemented as a macro.
*
*******************************************************************************/

/*******************************************************************************
* Function Name: LCD_Char_PrintU32Number
********************************************************************************
*
* Summary:
* Print an uint32 value as a left-justified decimal value.
*
* Parameters:
* value: A 32-bit value to be printed in ASCII characters as a decimal number
*
* Return:
* None.
*
*******************************************************************************/
void LCD_Char_PrintU32Number(uint32 value)
{
uint8 tmpDigit;
char8 number[LCD_Char_NUMBER_OF_REMAINDERS_U32 + 1u];
uint8 digIndex = LCD_Char_NUMBER_OF_REMAINDERS_U32;

/* This API will output a decimal number as a string and that string will be
* filled from end to start. Set Null termination character first.
*/
number[digIndex] = (char8) '\0';
digIndex--;

/* Load these in reverse order */
while(value >= LCD_Char_TEN)
{
/* Extract decimal digit, indexed by 'digIndex', from 'value' and
* convert it to ASCII character.
*/
tmpDigit = (uint8) (((uint8) (value % LCD_Char_TEN)) + (uint8) LCD_Char_ZERO_CHAR_ASCII);

/* Temporary variable 'tmpDigit' is used to avoid Violation of MISRA rule
* #10.3.
*/
number[digIndex] = (char8) tmpDigit;
value /= LCD_Char_TEN;
digIndex--;
}

/* Extract last decimal digit 'digIndex', from the 'value' and convert it
* to ASCII character.
*/
tmpDigit = (uint8) (((uint8)(value % LCD_Char_TEN)) + (uint8) LCD_Char_ZERO_CHAR_ASCII);
number[digIndex] = (char8) tmpDigit;

/* Print out number */
LCD_Char_PrintString(&number[digIndex]);
}

#endif /* LCD_Char_CONVERSION_ROUTINES == 1u */

/* [] END OF FILE */


/*myLCD_Char.h

#ifndef myLCD_Char_h
#define myLCD_Char_h
#include <mydevice.h>
#include <device.h>

extern uint8 LCDOLED; // Variable para definir si usamos LCD=0 o OLED=1. Se define en myLCD_Char.c.

/***************************************
* Conditional Compilation Parameters
***************************************/

#define LCD_Char_CONVERSION_ROUTINES (1u)
#define LCD_Char_CUSTOM_CHAR_SET (0u)

/* Custom character set types */
#define LCD_Char_NONE (0u) /* No Custom Fonts */
#define LCD_Char_HORIZONTAL_BG (1u) /* Horizontal Bar Graph */
#define LCD_Char_VERTICAL_BG (2u) /* Vertical Bar Graph */
#define LCD_Char_USER_DEFINED (3u) /* User Defined Fonts */

/***************************************
* Function Prototypes
***************************************/

void LCD_Char_Init(void) ;
void LCD_Char_Enable(void) ;
void LCD_Char_Start(void) ;
void LCD_Char_Stop(void) ;
void LCD_Char_WriteControl(uint8 cByte) ;
void LCD_Char_WriteData(uint8 dByte) ;
void LCD_Char_PrintString(char8 const string[]) ;
void LCD_Char_Position(uint8 row, uint8 column) ;
void LCD_Char_PutChar(char8 character) ;

void OLED_Char_Init(void);

#if((LCD_Char_CUSTOM_CHAR_SET == LCD_Char_VERTICAL_BG) || \
(LCD_Char_CUSTOM_CHAR_SET == LCD_Char_HORIZONTAL_BG))

void LCD_Char_LoadCustomFonts(uint8 const customData[])
;

void LCD_Char_DrawHorizontalBG(uint8 row, uint8 column, uint8 maxCharacters, uint8 value)
;

void LCD_Char_DrawVerticalBG(uint8 row, uint8 column, uint8 maxCharacters, uint8 value)
;

#endif /* ((LCD_Char_CUSTOM_CHAR_SET == LCD_Char_VERTICAL_BG) */

#if(LCD_Char_CUSTOM_CHAR_SET == LCD_Char_USER_DEFINED)

void LCD_Char_LoadCustomFonts(uint8 const customData[])
;

#endif /* ((LCD_Char_CUSTOM_CHAR_SET == LCD_Char_USER_DEFINED) */

#if(LCD_Char_CONVERSION_ROUTINES == 1u)

/* ASCII Conversion Routines */
void LCD_Char_PrintInt8(uint8 value) ;
void LCD_Char_PrintInt16(uint16 value) ;
void LCD_Char_PrintInt32(uint32 value) ;
void LCD_Char_PrintNumber(uint16 value) ;
void LCD_Char_PrintU32Number(uint32 value) ;

#endif /* LCD_Char_CONVERSION_ROUTINES == 1u */

/* Clear Macro */
#define LCD_Char_ClearDisplay() LCD_Char_WriteControl(LCD_Char_CLEAR_DISPLAY)

/* Off Macro */
#define LCD_Char_DisplayOff() LCD_Char_WriteControl(LCD_Char_DISPLAY_CURSOR_OFF)

/* On Macro */
#define LCD_Char_DisplayOn() LCD_Char_WriteControl(LCD_Char_DISPLAY_ON_CURSOR_OFF)

#define LCD_Char_PrintNumber(value) LCD_Char_PrintU32Number((uint16) (value))

/***************************************
* Global Variables
***************************************/

extern uint8 LCD_Char_initVar;
extern uint8 LCD_Char_enableState;
extern uint8 const CYCODE LCD_Char_customFonts[64u];

/***************************************
* API Constants
***************************************/

/* Full Byte Commands Sent as Two Nibbles */
#define LCD_Char_DISPLAY_8_BIT_INIT (0x03u)
#define LCD_Char_DISPLAY_4_BIT_INIT (0x02u)
#define LCD_Char_DISPLAY_CURSOR_OFF (0x08u)
#define LCD_Char_CLEAR_DISPLAY (0x01u)
#define LCD_Char_CURSOR_AUTO_INCR_ON (0x06u)
#define LCD_Char_DISPLAY_CURSOR_ON (0x0Eu)
#define LCD_Char_DISPLAY_2_LINES_5x10 (0x2Cu)
#define LCD_Char_DISPLAY_ON_CURSOR_OFF (0x0Cu)

#define LCD_Char_RESET_CURSOR_POSITION (0x03u)
#define LCD_Char_CURSOR_WINK (0x0Du)
#define LCD_Char_CURSOR_BLINK (0x0Fu)
#define LCD_Char_CURSOR_SH_LEFT (0x10u)
#define LCD_Char_CURSOR_SH_RIGHT (0x14u)
#define LCD_Char_DISPLAY_SCRL_LEFT (0x18u)
#define LCD_Char_DISPLAY_SCRL_RIGHT (0x1Eu)
#define LCD_Char_CURSOR_HOME (0x02u)
#define LCD_Char_CURSOR_LEFT (0x04u)
#define LCD_Char_CURSOR_RIGHT (0x06u)

/* Point to Character Generator Ram 0 */
#define LCD_Char_CGRAM_0 (0x40u)

/* Point to Display Data Ram 0 */
#define LCD_Char_DDRAM_0 (0x80u)

/* LCD Characteristics */
#define LCD_Char_CHARACTER_WIDTH (0x05u)
#define LCD_Char_CHARACTER_HEIGHT (0x08u)

#if(LCD_Char_CONVERSION_ROUTINES == 1u)
#define LCD_Char_NUMBER_OF_REMAINDERS_U32 (0x0Au)
#define LCD_Char_TEN (0x0Au)
#define LCD_Char_8_BIT_SHIFT (8u)
#define LCD_Char_32_BIT_SHIFT (32u)
#define LCD_Char_ZERO_CHAR_ASCII (48u)
#endif /* LCD_Char_CONVERSION_ROUTINES == 1u */

/* Nibble Offset and Mask */
#define LCD_Char_NIBBLE_SHIFT (0x04u)
#define LCD_Char_NIBBLE_MASK (0x0Fu)

/* LCD Module Address Constants */
#define LCD_Char_ROW_0_START (0x80u)
#define LCD_Char_ROW_1_START (0xC0u)
#define LCD_Char_ROW_2_START (0x94u)
#define LCD_Char_ROW_3_START (0xD4u)

/* Custom Character References */
#define LCD_Char_CUSTOM_0 (0x00u)
#define LCD_Char_CUSTOM_1 (0x01u)
#define LCD_Char_CUSTOM_2 (0x02u)
#define LCD_Char_CUSTOM_3 (0x03u)
#define LCD_Char_CUSTOM_4 (0x04u)
#define LCD_Char_CUSTOM_5 (0x05u)
#define LCD_Char_CUSTOM_6 (0x06u)
#define LCD_Char_CUSTOM_7 (0x07u)

/* Other constants */
#define LCD_Char_BYTE_UPPER_NIBBLE_SHIFT (0x04u)
#define LCD_Char_BYTE_LOWER_NIBBLE_MASK (0x0Fu)
#define LCD_Char_U16_UPPER_BYTE_SHIFT (0x08u)
#define LCD_Char_U16_LOWER_BYTE_MASK (0xFFu)
#define LCD_Char_CUSTOM_CHAR_SET_LEN (0x40u)

#endif

/* [] END OF FILE */

But don't know how to implement it 🙁

Thomas

Posted : 06/11/2017 12:36 pm
Knickohr
(@knickohr)
Member Moderator

Antonio Velkov from the Prusa i3 Bear Upgrade facebook group did the job 😎

https://vmod.wordpress.com/…/…/mk2s-oled-screen-replacement/

This is an one to one OLED replayment. Just replace the LCD with an true OLED from Raystar or Winstar (2004), exchange 2 libraries from the firmware and recompile it.

Thomas

Posted : 03/12/2018 1:17 pm
3d-gussner
(@3d-gussner)
Reputable Member

Good morning everyone,

We have managed to get the WEH002004 OLED display to run with firmware 3.8.0 and higher.

If you are interested checkout my Github https://github.com/3d-gussner/Prusa-Firmware/tree/MK3_WEH002004_OLED

Funny thing is that it looks like it also works with the default HD44780 LCD display.

 

Thanks to
- @leptun for helping to get the correct initzialition for the LDO OLED display running on MK3 v.3.8.0 and higher
- Wolfgang from Zaribo for testing countless versions until we think we got it right. - Gerd Jentz for porting it to MK3 Prusa Firmware 3.7.0 - and final for the base of all of this to Antonio Velkov with his MK2S OLED SCREEN REPLACEMENT tutorial - Dave Ross and Svetoslav Sotirov for testing - and everyone we may have forgotten

 

This post was modified 10 months ago by 3d-gussner
Posted : 14/10/2019 8:29 am
Knickohr
(@knickohr)
Member Moderator

Will you continue with the new firmware 3.9.0 ?

Thomas

Posted : 18/02/2020 10:41 am
3d-gussner
(@3d-gussner)
Reputable Member

@knickohr

Sorry for the late answer. My github is updated to FW 3.9.0-RC1 ... so i will continue to support it for a while.
Maybe i will move it to another Repo in the future.

 

Posted : 09/03/2020 6:16 pm
Knickohr liked
Share:

Please Login or Register