[PL] [ENG]
logo
- Sterownik s1d110605 -

introduction

Recently I was given few parts from broken Miele's dishwasher. I found using graphic LCD in one of my project to be very interesting. After small research I was almost sure that this LCD had s1d10605 driver . I decided to use Nokia LCD Lib (written by Sylvain Bissonnette) as my start point. In next sections you can find hardware and software description as well as a few photos.

[img]

hardware

In general s1d10605 driver has serial and parallel interfaces. My LCD has only serial pins available outside. I've put pinout of my LCD below:


[img]

Fig.1 LCD pinout

There are 5 digital pins (for communication), 11 for external capacitors, ground and Vcc. Schematic diagram of connection can be found below:


[img]

Fig.2 LCD connection


software

Because it is impossible to read data from LCD's memory I decided to implement LCD buffer inside microcontroller. Unfortunelty it has to be as huge as 792 bytes. This is the reason Yours AVR should have at least 1K SRAM. If You don't want to use "advanced" features as lines or "xor drawing" you may rewrite lib to write directly to LCD's memory. In present shape library doesn't use any special microcontroller's peripherals (like SPI). If You want to speed up refreshing screen (and You have SPI pins available in Yours design) you may rewrite LcdSend procedure to use SPI interface.

Small documentation (the most recent doc is always in header file):


Enumerations

enum  LcdCmdData { LCD_CMD = 0, LCD_DATA = 1 }
enum  LcdPixelMode { PIXEL_OFF = 0, PIXEL_ON = 1, PIXEL_XOR = 2 }
enum  LcdFontSize { FONT_1X = 1, FONT_2X = 2 }

Functions

void LcdInit (void)
void LcdSend (u08 data, LcdCmdData cd)
void LcdContrast (u08 contrast)
void LcdClear (void)
void LcdUpdate (void)
void LcdGotoXY (u08 x, u08 y)
void LcdChr (LcdFontSize size, u08 ch)
void LcdStr (LcdFontSize size, u08 *dataPtr)
void LcdPixel (u08 x, u08 y, LcdPixelMode mode)
void LcdLine (u08 x1, u08 y1, u08 x2, u08 y2, LcdPixelMode mode)
void LcdHLine (u08 x1, u08 y1, u08 x2, LcdPixelMode mode)
void LcdVLine (u08 x1, u08 y1, u08 y2, LcdPixelMode mode)
void LcdRectangle (u08 x1, u08 y1, u08 x2, u08 y2, LcdPixelMode mode)
void LcdBox (u08 x1, u08 y1, u08 x2, u08 y2, LcdPixelMode mode)

Enumeration Type Documentation

enum LcdCmdData

Determine data or command to be sent

Enumerator:
LCD_CMD  Send command
LCD_DATA  Send data

Font size

Enumerator:
FONT_1X  Normal size (8 pixels)
FONT_2X  Double size (16 pixels)

Pixel drawing mode

Enumerator:
PIXEL_OFF  Switch off pixel
PIXEL_ON  Switch on pixel
PIXEL_XOR  Xor pixel


Function Documentation

void LcdBox ( u08  x1,
u08  y1,
u08  x2,
u08  y2,
LcdPixelMode  mode 
)

Draws a field rectangle with the given top left corner, and right bottom corner.

Parameters:
x1,y1 Absolute pixel coordinates for line origin.
x2,y2 Absolute pixel coordinates for line end.
mode Off, On or Xor.
See also:
LcdPixelMode LcdRectangle

void LcdChr ( LcdFontSize  size,
u08  ch 
)

Displays a character at current cursor location and increment cursor location.

Parameters:
size Font size. See enum.
ch Character to write.
See also:
LcdFontSize LcdStr

void LcdClear ( void   ) 

Clears the display's buffor. LcdUpdate must be called next.

void LcdContrast ( u08  contrast  ) 

Set Lcd display contrast.

Parameters:
contrast Contrast value from 0x00 to 0x2F.

void LcdGotoXY ( u08  x,
u08  y 
)

Sets cursor location to xy location corresponding to basic font size.

Parameters:
x Coordinate for new cursor position. Range: [0,LCD_X_RES-1]
y Coordinate for new cursor position. Range: [0,LCD_Y_RES-1]

void LcdHLine ( u08  x1,
u08  y1,
u08  x2,
LcdPixelMode  mode 
)

Draws a horizontal line between two points on the display.

Parameters:
x1,y1 Absolute pixel coordinates for line origin.
x2 Absolute pixel coordinates for line end. (y2=y1)
mode Off, On or Xor.
See also:
LcdPixelMode LcdLine LcdVLine

void LcdInit ( void   ) 

Performs MCU pins & LCD controller initialization.

void LcdLine ( u08  x1,
u08  y1,
u08  x2,
u08  y2,
LcdPixelMode  mode 
)

Draws a line between two points on the display.

Parameters:
x1,y1 Absolute pixel coordinates for line origin.
x2,y2 Absolute pixel coordinates for line end.
mode Off, On or Xor.
See also:
LcdPixelMode LcdHLine LcdVLine

void LcdPixel ( u08  x,
u08  y,
LcdPixelMode  mode 
)

Displays a pixel at given absolute (x, y) location.

Parameters:
x,y Absolute pixel coordinates
mode Off, On or Xor.
See also:
LcdPixelMode

void LcdRectangle ( u08  x1,
u08  y1,
u08  x2,
u08  y2,
LcdPixelMode  mode 
)

Draws a rectangle with the given top left corner, and right bottom corner.

Parameters:
x1,y1 Absolute pixel coordinates for left top corner.
x2,y2 Absolute pixel coordinates for right bottom corner.
mode Off, On or Xor.
None. 
See also:
LcdPixelMode LcdBox

void LcdSend ( u08  data,
LcdCmdData  cd 
)

Sends data to display controller.

Parameters:
data Data to be sent
cd Command or data
See also:
LcdCmdData

void LcdStr ( LcdFontSize  size,
u08 *  dataPtr 
)

Displays a character at current cursor location and increment cursor location according to font size.

Parameters:
size Font size.
dataPtr Pointer to null terminated ASCII string to display.
See also:
LcdFontSize LcdChr

void LcdUpdate ( void   ) 

Copies the LCD cache into the device RAM. Have to be called each time somthing was changed.

void LcdVLine ( u08  x1,
u08  y1,
u08  y2,
LcdPixelMode  mode 
)

Draws a vertical line between two points on the display.

Parameters:
x1,y1 Absolute pixel coordinates for line origin.
y2 Absolute pixel coordinates for line end. (x2=x1)
mode Off, On or Xor.
See also:
LcdPixelMode LcdLine LcdHLine

example

To generate such picture:


[img]

Fig.3 Example


You can use for example this code:


 #include "lcd.h"
 ...
 LcdInit();
 LcdClear();
 LcdGotoXY(4,2);
 LcdStr(FONT_1X,"10");
 LcdGotoXY(17,3);
 LcdStr(FONT_2X,"1");
 LcdLine(1,14,12,27, PIXEL_ON );
 LcdPixel(132,47,PIXEL_ON);
 LcdUpdate();

download

S1D10605 v0.1 5k [tgz]

documents

S1D10605 Series Datasheet (490k) [PDF] [LOCAL]
Specification for BTHQ 240064AVB (902k) [PDF]
Nokia LCD Lib [www]


photos


foto foto foto

Copyright © 2004 - 2008 , wykonał: Szymon Kulis