Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

need datasheet 3310 & demo program

Status
Not open for further replies.

marki

Newbie level 5
Joined
May 9, 2007
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,330
HI

I need datasheet lcd nokia 3310 &demo program run on PIC

thank you very mush
 

well it all depends of what language you want to do it with

if it's picbasic then doa search on the net there is loads of stuff also try the Picbasic site theres is pleant of stuff
 

here my tests in MikroC for a pic16F628
the datasheet can be found here....: pcd8544
http://www.scienceprog.com/wp-content/uploads/2006/11/pcd8544.pdf

the pin connections.... mmmm.....

it´s all based on the microsyl avr routines...
**broken link removed**

Code:
#define SCL PORTB.F1
#define SDA PORTB.F2
#define D_C PORTB.F3
#define SCE PORTB.F4
#define RES PORTB.F5
#define LCD_CMD 0
#define LCD_DAT 1	// for D_C bit....


void LCD_send(char dato,char destino)
{
	char i;
	SCE = 0;
	D_C = destino;
	for (i = 0; i < 8 ; i++)	//rutina SPI
	{
		SDA = dato.F7;
	SCL=0;
	SCL=0;
	SCL=1;
	SCL=1;
	SCL=0;
	SCL=0;
		dato <<=1;
	}
	SCE=1;
}



void Nokia_LCD_init(void)
{
	PORTB = PORTB & 0xC1;	//RES = 0;
	TRISB = TRISB & 0xC1;	//todos los pines usados, son salida...
	delay_ms(10);
	RES = 1;
	SCE = 1;
    LCD_send( 0x21, LCD_CMD );  // LCD Extended Commands.
    LCD_send( 0xC8, LCD_CMD );  // Set LCD Vop (Contrast).
    LCD_send( 0x06, LCD_CMD );  // Set Temp coefficent.
    LCD_send( 0x13, LCD_CMD );  // LCD bias mode 1:48.
    LCD_send( 0x20, LCD_CMD );  // LCD Standard Commands, Horizontal addressing mode.
    LCD_send( 0x0C, LCD_CMD );  // LCD in normal mode.
}
void yuki_init(void)
{
    LCD_send( 0x22, LCD_CMD );  // LCD Standard Commands, Vertical(!) addressing mode.
    LCD_send(0x40 ,LCD_CMD);
    LCD_send(0x80 ,LCD_CMD);
}

static const char FontLookup [][5] = {
    { 0x00, 0x00, 0x00, 0x00, 0x00 },  // sp
    { 0x00, 0x00, 0x2f, 0x00, 0x00 },   // !
    { 0x00, 0x07, 0x00, 0x07, 0x00 },   // "
    { 0x14, 0x7f, 0x14, 0x7f, 0x14 },   // #
    { 0x24, 0x2a, 0x7f, 0x2a, 0x12 },   // $
    { 0xc4, 0xc8, 0x10, 0x26, 0x46 },   // %
    { 0x36, 0x49, 0x55, 0x22, 0x50 },   // &
    { 0x00, 0x05, 0x03, 0x00, 0x00 },   // '
    { 0x00, 0x1c, 0x22, 0x41, 0x00 },   // (
    { 0x00, 0x41, 0x22, 0x1c, 0x00 },   // )
    { 0x14, 0x08, 0x3E, 0x08, 0x14 },   // *
    { 0x08, 0x08, 0x3E, 0x08, 0x08 },   // +
    { 0x00, 0x00, 0x50, 0x30, 0x00 },   // ,
    { 0x10, 0x10, 0x10, 0x10, 0x10 },   // -
    { 0x00, 0x60, 0x60, 0x00, 0x00 },   // .
    { 0x20, 0x10, 0x08, 0x04, 0x02 },   // /
    { 0x3E, 0x51, 0x49, 0x45, 0x3E },   // 0
    { 0x00, 0x42, 0x7F, 0x40, 0x00 },   // 1
    { 0x42, 0x61, 0x51, 0x49, 0x46 },   // 2
    { 0x21, 0x41, 0x45, 0x4B, 0x31 },   // 3
    { 0x18, 0x14, 0x12, 0x7F, 0x10 },   // 4
    { 0x27, 0x45, 0x45, 0x45, 0x39 },   // 5
    { 0x3C, 0x4A, 0x49, 0x49, 0x30 },   // 6
    { 0x01, 0x71, 0x09, 0x05, 0x03 },   // 7
    { 0x36, 0x49, 0x49, 0x49, 0x36 },   // 8
    { 0x06, 0x49, 0x49, 0x29, 0x1E },   // 9
    { 0x00, 0x36, 0x36, 0x00, 0x00 },   // :
    { 0x00, 0x56, 0x36, 0x00, 0x00 },   // ;
    { 0x08, 0x14, 0x22, 0x41, 0x00 },   // <
    { 0x14, 0x14, 0x14, 0x14, 0x14 },   // =
    { 0x00, 0x41, 0x22, 0x14, 0x08 },   // >
    { 0x02, 0x01, 0x51, 0x09, 0x06 },   // ?
    { 0x32, 0x49, 0x59, 0x51, 0x3E },   // @
    { 0x7E, 0x11, 0x11, 0x11, 0x7E },   // A
    { 0x7F, 0x49, 0x49, 0x49, 0x36 },   // B
    { 0x3E, 0x41, 0x41, 0x41, 0x22 },   // C
    { 0x7F, 0x41, 0x41, 0x22, 0x1C },   // D
    { 0x7F, 0x49, 0x49, 0x49, 0x41 },   // E
    { 0x7F, 0x09, 0x09, 0x09, 0x01 },   // F
    { 0x3E, 0x41, 0x49, 0x49, 0x7A },   // G
    { 0x7F, 0x08, 0x08, 0x08, 0x7F },   // H
    { 0x00, 0x41, 0x7F, 0x41, 0x00 },   // I
    { 0x20, 0x40, 0x41, 0x3F, 0x01 },   // J
    { 0x7F, 0x08, 0x14, 0x22, 0x41 },   // K
    { 0x7F, 0x40, 0x40, 0x40, 0x40 },   // L
    { 0x7F, 0x02, 0x0C, 0x02, 0x7F },   // M
    { 0x7F, 0x04, 0x08, 0x10, 0x7F },   // N
    { 0x3E, 0x41, 0x41, 0x41, 0x3E },   // O
    { 0x7F, 0x09, 0x09, 0x09, 0x06 },   // P
    { 0x3E, 0x41, 0x51, 0x21, 0x5E },   // Q
    { 0x7F, 0x09, 0x19, 0x29, 0x46 },   // R
    { 0x46, 0x49, 0x49, 0x49, 0x31 },   // S
    { 0x01, 0x01, 0x7F, 0x01, 0x01 },   // T
    { 0x3F, 0x40, 0x40, 0x40, 0x3F },   // U
    { 0x1F, 0x20, 0x40, 0x20, 0x1F },   // V
    { 0x3F, 0x40, 0x38, 0x40, 0x3F },   // W
    { 0x63, 0x14, 0x08, 0x14, 0x63 },   // X
    { 0x07, 0x08, 0x70, 0x08, 0x07 },   // Y
    { 0x61, 0x51, 0x49, 0x45, 0x43 },   // Z
    { 0x00, 0x7F, 0x41, 0x41, 0x00 },   // [
    { 0x55, 0x2A, 0x55, 0x2A, 0x55 },   // 55
    { 0x00, 0x41, 0x41, 0x7F, 0x00 },   // ]
    { 0x04, 0x02, 0x01, 0x02, 0x04 },   // ^
    { 0x40, 0x40, 0x40, 0x40, 0x40 },   // _
    { 0x00, 0x01, 0x02, 0x04, 0x00 },   // '
    { 0x20, 0x54, 0x54, 0x54, 0x78 },   // a
    { 0x7F, 0x48, 0x44, 0x44, 0x38 },   // b
    { 0x38, 0x44, 0x44, 0x44, 0x20 },   // c
    { 0x38, 0x44, 0x44, 0x48, 0x7F },   // d
    { 0x38, 0x54, 0x54, 0x54, 0x18 },   // e
    { 0x08, 0x7E, 0x09, 0x01, 0x02 },   // f
    { 0x0C, 0x52, 0x52, 0x52, 0x3E },   // g
    { 0x7F, 0x08, 0x04, 0x04, 0x78 },   // h
    { 0x00, 0x44, 0x7D, 0x40, 0x00 },   // i
    { 0x20, 0x40, 0x44, 0x3D, 0x00 },   // j
    { 0x7F, 0x10, 0x28, 0x44, 0x00 },   // k
    { 0x00, 0x41, 0x7F, 0x40, 0x00 },   // l
    { 0x7C, 0x04, 0x18, 0x04, 0x78 },   // m
    { 0x7C, 0x08, 0x04, 0x04, 0x78 },   // n
    { 0x38, 0x44, 0x44, 0x44, 0x38 },   // o
    { 0x7C, 0x14, 0x14, 0x14, 0x08 },   // p
    { 0x08, 0x14, 0x14, 0x18, 0x7C },   // q
    { 0x7C, 0x08, 0x04, 0x04, 0x08 },   // r
    { 0x48, 0x54, 0x54, 0x54, 0x20 },   // s
    { 0x04, 0x3F, 0x44, 0x40, 0x20 },   // t
    { 0x3C, 0x40, 0x40, 0x20, 0x7C },   // u
    { 0x1C, 0x20, 0x40, 0x20, 0x1C },   // v
    { 0x3C, 0x40, 0x30, 0x40, 0x3C },   // w
    { 0x44, 0x28, 0x10, 0x28, 0x44 },   // x
    { 0x0C, 0x50, 0x50, 0x50, 0x3C },   // y
    { 0x44, 0x64, 0x54, 0x4C, 0x44 }    // z
};

// ------------------------------------------------------
// Picture name: yuki_bmp
// GLCD Model: Nokia3310 Like
// ------------------------------------------------------

unsigned char const yuki_bmp[504] =
{0, 252, 192, 255, 199, 255,
0, 63, 224, 31, 248, 255,
192, 7, 124, 0, 14, 0,
240, 1, 7, 0, 0, 0,
60, 0, 0, 0, 0, 0,
15, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
1, 0, 0, 0, 0, 64,
0, 0, 0, 0, 0, 32,
0, 0, 0, 0, 0, 24,
0, 0, 0, 0, 0, 8,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 128,
0, 0, 0, 0, 0, 64,
0, 0, 0, 0, 0, 16,
0, 0, 0, 0, 0, 8,
0, 0, 0, 0, 0, 132,
0, 0, 0, 31, 0, 66,
0, 0, 128, 117, 0, 17,
0, 0, 192, 192, 129, 8,
0, 0, 64, 14, 131, 132,
0, 0, 70, 2, 68, 194,
0, 192, 3, 27, 12, 209,
0, 240, 0, 11, 10, 237,
0, 62, 240, 247, 122, 224,
128, 15, 31, 140, 250, 115,
96, 255, 83, 112, 64, 254,
240, 255, 255, 255, 143, 253,
120, 6, 0, 60, 188, 15,
22, 0, 6, 224, 243, 7,
2, 0, 2, 255, 99, 6,
1, 0, 227, 1, 192, 6,
0, 0, 57, 1, 128, 5,
0, 128, 159, 1, 0, 3,
0, 128, 153, 1, 0, 2,
0, 96, 198, 0, 0, 6,
0, 240, 193, 0, 0, 12,
0, 76, 224, 0, 0, 12,
0, 114, 224, 0, 0, 8,
128, 77, 52, 0, 0, 24,
64, 66, 19, 2, 0, 16,
32, 129, 249, 3, 0, 48,
144, 128, 205, 3, 0, 96,
88, 152, 239, 3, 0, 224,
40, 134, 253, 0, 0, 224,
176, 129, 12, 0, 0, 192,
208, 232, 255, 1, 96, 192,
240, 7, 193, 1, 32, 192,
120, 0, 49, 0, 32, 128,
28, 0, 13, 0, 16, 192,
2, 0, 3, 0, 112, 224,
1, 192, 1, 0, 48, 176,
0, 96, 0, 0, 16, 8,
0, 16, 0, 0, 16, 12,
0, 12, 0, 0, 0, 6,
0, 2, 192, 3, 2, 3,
0, 1, 128, 15, 130, 129,
128, 0, 243, 31, 195, 192,
64, 0, 255, 179, 97, 192,
32, 128, 249, 224, 48, 96,
48, 128, 62, 96, 24, 48,
16, 128, 230, 51, 12, 9,
8, 64, 64, 27, 134, 132,
12, 64, 96, 155, 35, 66,
12, 224, 51, 255, 27, 65,
28, 192, 56, 253, 195, 160,
56, 0, 214, 134, 48, 240,
124, 192, 121, 6, 28, 248,
248, 63, 14, 7, 7, 248,
192, 131, 131, 243, 1, 252,
0, 0, 192, 1, 0, 118,
0, 0, 224, 0, 0, 57,
0, 0, 240, 0, 128, 28,
0, 0, 104, 0, 128, 7,
0, 0, 48, 0, 224, 3,
0, 0, 56, 0, 248, 0,
0, 0, 62, 0, 126, 8,
0, 0, 27, 192, 15, 30,
0, 120, 12, 240, 227, 7,
0, 0, 6, 255, 255, 1,
0, 128, 129, 255, 127, 0,
1, 240, 1, 252, 31, 0,
31, 254, 255, 255, 1, 0,
255, 31, 255, 3, 0, 0};


// ------------------------------------------------------
// Picture name: ely_bmp
// GLCD Model: Nokia3310 Like
// ------------------------------------------------------

unsigned char const ely_bmp[504] = {
0, 24, 0, 0, 0, 0,
0, 14, 0, 0, 0, 0,
0, 7, 0, 0, 1, 0,
192, 3, 0, 128, 1, 0,
224, 1, 0, 192, 0, 0,
248, 0, 0, 64, 0, 0,
124, 0, 28, 48, 0, 0,
118, 192, 15, 48, 0, 0,
59, 252, 1, 24, 0, 0,
153, 255, 0, 14, 0, 0,
252, 60, 0, 7, 0, 0,
62, 30, 192, 3, 0, 0,
143, 15, 224, 1, 0, 0,
227, 3, 248, 0, 0, 0,
240, 1, 126, 0, 0, 128,
240, 0, 119, 0, 0, 192,
56, 254, 63, 0, 0, 240,
190, 255, 30, 0, 0, 248,
254, 127, 15, 0, 0, 254,
159, 223, 15, 0, 0, 255,
199, 231, 231, 254, 207, 255,
241, 251, 255, 255, 249, 63,
248, 252, 128, 255, 191, 131,
254, 15, 250, 255, 3, 224,
159, 193, 127, 16, 0, 124,
7, 240, 255, 1, 0, 142,
0, 252, 255, 255, 255, 255,
0, 255, 255, 255, 255, 255,
224, 255, 255, 255, 255, 255,
240, 239, 255, 255, 255, 255,
248, 255, 254, 127, 248, 255,
240, 255, 235, 255, 247, 255,
248, 207, 123, 132, 255, 255,
248, 199, 206, 29, 255, 255,
248, 131, 248, 55, 254, 255,
220, 128, 232, 115, 252, 255,
108, 128, 129, 0, 252, 255,
60, 0, 0, 0, 248, 255,
28, 0, 0, 0, 240, 255,
24, 0, 0, 0, 225, 255,
56, 0, 0, 0, 193, 255,
56, 192, 0, 128, 129, 255,
255, 223, 0, 0, 0, 255,
255, 111, 4, 0, 0, 255,
254, 225, 13, 0, 136, 255,
254, 227, 4, 0, 204, 255,
60, 167, 4, 1, 70, 255,
252, 224, 132, 129, 99, 240,
252, 241, 140, 193, 49, 96,
120, 243, 252, 241, 24, 56,
254, 242, 237, 121, 8, 12,
254, 224, 237, 61, 4, 7,
252, 99, 249, 31, 230, 3,
248, 103, 248, 7, 255, 96,
240, 199, 252, 247, 127, 56,
192, 207, 223, 127, 31, 15,
128, 255, 17, 224, 231, 7,
0, 255, 49, 248, 255, 1,
0, 252, 51, 255, 63, 0,
0, 240, 55, 244, 143, 1,
128, 193, 15, 248, 225, 0,
128, 7, 31, 126, 126, 0,
1, 62, 120, 255, 31, 128,
63, 124, 224, 255, 63, 192,
254, 241, 131, 255, 255, 255,
248, 239, 63, 255, 255, 255,
112, 127, 255, 249, 255, 255,
224, 253, 255, 255, 225, 255,
128, 243, 255, 255, 7, 255,
0, 254, 247, 159, 191, 255,
0, 0, 0, 252, 56, 224,
0, 0, 0, 224, 0, 128,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 192, 1,
1, 0, 0, 0, 254, 255,
255, 0, 0, 0, 255, 255,
255, 127, 0, 240, 255, 255,
252, 255, 159, 255, 255, 255,
0, 224, 255, 15, 252, 255,
0, 0, 224, 1, 240, 243,
0, 0, 0, 0, 240, 131,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
};


void Lcd_graph (const char *dibujo)
{
    int i;

    for ( i = 0; i < 504 ; i++ )
    {
        Lcd_send(dibujo[i],LCD_DAT);
    }
}
void LcdChr ( char ch )
{
    char i, c;
    int  tmpIdx;


    if ( (ch < 0x20) || (ch > 0x7b) )
    {
        //  Convert to a printable character.
        ch = 92;
    }

    for ( i = 0; i < 5; i++ )
    {
        Lcd_send(FontLookup[ch - 32][i],LCD_DAT);
    }
        Lcd_send(0,LCD_DAT);   // una línea de espacio...
}

void Lcd_Clr ( void )
{
    int i;

    for ( i = 0; i < (84*48); i++ )
    {
        Lcd_send(0x00,LCD_DAT);
    }
}

void LCD_gotoXY(char X, char Y)
{
     LCD_send(0x40 | (Y & 7),LCD_CMD);
     LCD_send(0x80 | X,LCD_CMD);
}
#define LCD_chrXY(X,Y) LCD_gotoXY((X)*6,(Y))

void LCD_print(const char *cadena)
{
     while (*cadena) LcdChr(*cadena++);
}
void LCD_slow_print(const char *cadena)
{
     while (*cadena) {LcdChr(*cadena++); delay_ms(200);}
}

void main (void)
{
	PORTB=0;
	TRISB=1;
	OPTION_REG=0;
while (1)
{
	Nokia_lcd_init();
	LCD_Clr();
	LCD_print ("LCD Nokia");
        LCD_chrXY(0,2); //linea 2...
	LCD_slow_print ("Esto es  algo nuevo,bueno es la magia...");
	LCD_chrXY(2,5); //centro línea 5
	lcd_print ("706-24635");
	delay_ms(2000);//	while (PORTB.F0);
	yuki_init();
	LCD_graph(yuki_bmp);
        while (PORTB.F0);
	while (!PORTB.F0);
	Lcd_graph(ely_bmp);
        while (PORTB.F0);
}
}

wish it helps....
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top