Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 33

Thread: Nokia 3310 interface?

  1. #1
    Moderator
    Join Date
    Jan 1970
    Location
    North Norfolk blow-in.
    Posts
    6,000
    Blog Entries
    1

    Default Nokia 3310 interface?

    I've been following this thread;
    http://www.picaxeforum.co.uk/showthread.php?t=9797

    I've tried both Texy's code in post #9 and the original code, listed here;
    http://homepage.ntlworld.com/c.lewis19/nokia.htm

    Picaxes are either 18X or 28X1.

    I'm using a 3.3 ldo to provide power, and making connections via 1k resistors.
    There's 3.30v on Nokia pin 1.
    I've checked continuity: all eight contacts look OK.
    "Separation" / track-bridging looks and meters OK.
    LED's on out 0-4 happily twinkle.

    But, the screen is still blank!

    Possibilities.

    1. I can't solder for toffee, and I've botched something.
    Highly probable, and it's happened before.

    But, just in case,

    2. There is a “hidden” contrast-control code.
    I've seen mention of 80h – Ffh on searches, but in assembler.
    Is it accessible from Picaxe?

    3. Am I using the wrong value capacitor, or, is there an alternative circuit?

    4. I've wasted a whole £1 on the GLCD!

    Any other ideas please folks?

    E (and oe)
    Attached Images Attached Images
    Last edited by eclectic; 28-06-2008 at 20:24. Reason: yet more typo's!

  2. #2
    Moderator
    Join Date
    Mar 2008
    Location
    Western Australia
    Posts
    11,236

    Default

    A bit off searching finds that C3 is not essential.
    Others have used a 100nF capacitor though Texy suggests 1 to 10uF is okay.
    C3 Capacitor 100 nF not mandatory; needed, if display is unstable
    (eg: only every 2nd row is visible, ...)

    Texy also states:
    I experience two failures before I was successful.
    Not 100% clear whether these were faulty on purchase (through Ebay - Texy mentions readily available thru Ebay?). He mentions damaging 2 while working with them.
    Recall you mentioned you bought several. In that case, have you tried another display?


    Edit:
    Do you need a backlight connected to see the display?
    Some LCD displays are virtually invisible without but others are dull but can still be seen when backlight is off.
    Attached diagram shows a backlight circuit
    Attached Images Attached Images
    Last edited by westaust55; 29-06-2008 at 05:36.

  3. #3
    Moderator
    Join Date
    Mar 2008
    Location
    Western Australia
    Posts
    11,236

    Default

    e,

    While difficult when do not have a 3310 screen, but maybe you could post your code and we can have a look for obvious errors.

    Even the "corrected" code posted by Texy has at least one typo that I spotted. (has a space in the middle of the first "47"):
    Code:
    EEPROM 15,
    (24,26,28,30,31,33,34,36,38,39,41,42,43,44,45,46,4 7,47,47,47,47,47,47
    ,46,45,44,43,42)


    EDIT (Add-in) 1:
    A lot of conflicting info avalaible out there makes it hard to know what is right.
    here is a link sugegsting 5Vdc supply requierd (Care needed here)
    There is a schematic for the 16F877 PIC showing 5Vdc to the 33`0 LCD

    The Philips datasheet for PCD8544 indicaters max of 3.3Vdc for Vdd1 and Vdd2. And the absolute MAX rating for Vdd is 7Vdc

    The zip file has a C language code showing steps (in C) but indicates the codes to initialise.
    http://www.geocities.com/dariuskrail...ia3310lcd.html

    The extracted intialisation code is:
    Code:
    }
    
    void initlcd(void)
    {
    	_RES = 1;		// Set _RES HIGH.
    	_SCE = 1;		// Disable Chip.
    	_RES = 0;		// Reset the LCD.
    	DelayMs(100);	// Wait 100ms.
    	_RES = 1;		// Awake LCD from RESET state.
    
    	writecom(0x21);		// Activate Chip and H=1.
    	writecom(0xC2);		// Set LCD Voltage to about 7V.
    	writecom(0x13);		// Adjust voltage bias.
    	writecom(0x20);		// Horizontal addressing and H=0.
    	writecom(0x09);		// Activate all segments.
    	clearram();			// Erase all pixel on the DDRAM.
    	writecom(0x08);		// Blank the Display.
    	writecom(0x0C);		// Display Normal.
    	cursorxy(0,0);		// Cursor Home.
    }
    
    void writecom(char command_in)
    {
    	D_C = 0;				// Select Command register.
    	_SCE = 0;				// Select Chip.
    	clockdata(command_in);	// Clock in command bits.
    	_SCE = 1;				// Deselect Chip.	
    }
    The first EEPROM command for intialissation seems okay. The data from
    EEPROM 0,(33,197,6,19,32,12) represent:

    33 = Activate Chip and H=1
    197 = Set LCD voltage (192 = 7.02V & 197 = 7.32V)
    6 = Temperature control = temp coefficient 2 = 17mV/K
    19 = Adjust Bias System to 1:48
    32 = Horizontal addressing and H=0.
    12 = Display Normal. (H must =0 for display control)

    Edit (Add-in) 2:
    Contrast is adjusted by a combination of the Vlcd and the temp compensation.
    Some M/C code examples I found had $A9 = 169 giving an Vlcd voltage of 5.52V As you say, The value can be set to anything between $80 and $FF.
    80h being minimum contrast and $FF maximum. The msb is not used to calculate Vlcd so the range is from 3.06 to 10.68V

    From the datasheet, “Due to the temperature dependency of the liquid crystals’ viscosity, the LCD controlling voltage VLCD must be increased at lower temperatures to maintain optimum contrast.”
    Last edited by westaust55; 29-06-2008 at 10:34. Reason: More info

  4. #4
    Moderator
    Join Date
    Jan 1970
    Location
    North Norfolk blow-in.
    Posts
    6,000
    Blog Entries
    1

    Default

    WestAus.
    Genuine thanks for the research you've done.

    I'll wire up another LCD tomorrow,
    and have another go.

    e.

  5. #5
    Senior Member
    Join Date
    Jun 2008
    Location
    Newbury, Berks, UK
    Posts
    313

    Default

    My 1st picaxe project is far from over but I've got the 3310 LCD working fine, altho slow to write too. I'll post some fully working code tomorrow
    incidently some of the things quoted as by me aren't - I've only connected up 1 module so far, and its still working - and its connected to my main picaxe supply voltage using 4 AA nimhs. I measured it at 5.5 volts at one point, maybe I got lucky!

    Texy

  6. #6
    Senior Member
    Join Date
    Jan 1970
    Location
    Australia NE VIC
    Posts
    1,683

    Default

    I have a few NOKIA Displays, I'd try to get them going if
    I could SEE the connectors, let alone SOLDER them, ~ ;o)

    Need x10 ~OO~ or --O

    Even though those phones/displays are cheap to buy, I got
    mine from the OP-Shop/Secondhand Shop for 50˘ ea.

  7. #7
    Senior Member
    Join Date
    Jun 2008
    Location
    Newbury, Berks, UK
    Posts
    313

    Default

    As promised, here is code that is working on my 18x axe090 pcb. The 'typo' quoted by Westaust55 earlier, was simply where I cut n pasted it and the single line of code overlapped to another when I pasted it
    This is my enhanced code with character-set programmed into
    the 18x's eeprom area.

    Code:
     
    ; Nokia LCD driver
    #picaxe 18x
     
    symbol SCLK = 0 'Display pin 2 to PICAXE out 0
    symbol SDA = 5 'Display pin 3 to PICAXE out 5
    symbol DC = 2 'Display pin 4 to PICAXE out 2
    symbol CS = 3 'Display pin 5 to PICAXE out 3
    symbol RES = 6 'Display pin 8 to PICAXE out 6
    symbol Value = b0
    symbol X = b3
    symbol Y = b4
    symbol eeprom_address = b5
    symbol Loop1 = b10
    symbol loop3 = b12
    SYMBOL SDA_PIN = outpin5
     
    setfreq m8
    gosub InitLCD
    Value="H"
    gosub CharToLCD
    Value="I"
    gosub CharToLCD
    Value=" "
    gosub CharToLCD
    Value="P"
    gosub CharToLCD
    Value="I"
    gosub CharToLCD
    Value="C"
    gosub CharToLCD
    Value="A"
    gosub CharToLCD
    Value="X"
    gosub CharToLCD
    Value="E"
    gosub CharToLCD
    Value=" "
    gosub CharToLCD
    Value="F"
    gosub CharToLCD
    Value="O"
    gosub CharToLCD
    Value="R"
    gosub CharToLCD
    Value="U"
    gosub CharToLCD
    Value="M"
    gosub CharToLCD
    Value="!"
    gosub CharToLCD
    GoSub Invert
    pause 50
    GoSub Normal
    setfreq m4
    Stop
    End
    InitLCD:
    low SCLK
    low SDA
    low DC
    low CS
    low RES
    pause 50
    high RES
    high CS
    ;Command = 1
    Value=$21
    gosub CommandToLCD ` transmit to serial LCD module
    Value=$C9
    gosub CommandToLCD ` transmit to serial LCD module
    Value=$13
    gosub CommandToLCD ` transmit to serial LCD module
    Value=$20
    gosub CommandToLCD ` transmit to serial LCD module
    Value=$09
    gosub CommandToLCD ` transmit to serial LCD module
    Value=$08
    gosub CommandToLCD ` transmit to serial LCD module
    X = 0
    Y = 0
    GoSub GotoXY
    GoSub ClearFast
    GoSub Normal
    return
    CharToLCD:
    eeprom_address=0
    if Value>32 and Value <58 then
    eeprom_address=Value-33
    eeprom_address=eeprom_address*5+130
    elseif Value>64 and Value <91 then
    eeprom_address=Value-65
    eeprom_address=eeprom_address*5
    elseif Value=32 then
    Value=0
    gosub DataToLCD
    gosub DataToLCD
    gosub DataToLCD
    gosub DataToLCD
    gosub DataToLCD
    end if
    if Value=0 then
    return
    end if
    For Loop1 = 0 To 4
    read eeprom_address, Value
    inc eeprom_address
    GoSub DataToLCD
    Next Loop1
    Return
    CommandToLCD:
    low DC 'Command mode
    DataMode1:
    low CS
    SDA_PIN = bit7
    PulsOut SCLK,1
    SDA_PIN = bit6
    PulsOut SCLK,1
    SDA_PIN = bit5
    PulsOut SCLK,1
    SDA_PIN = bit4
    PulsOut SCLK,1
    SDA_PIN = bit3
    PulsOut SCLK,1
    SDA_PIN = bit2
    PulsOut SCLK,1
    SDA_PIN = bit1
    PulsOut SCLK,1
    SDA_PIN = bit0
    PulsOut SCLK,1
    high CS
    Return
    DataToLCD:
    high DC 'Data mode
    DataMode2:
    low CS
    SDA_PIN = bit7
    PulsOut SCLK,1
    SDA_PIN = bit6
    PulsOut SCLK,1
    SDA_PIN = bit5
    PulsOut SCLK,1
    SDA_PIN = bit4
    PulsOut SCLK,1
    SDA_PIN = bit3
    PulsOut SCLK,1
    SDA_PIN = bit2
    PulsOut SCLK,1
    SDA_PIN = bit1
    PulsOut SCLK,1
    SDA_PIN = bit0
    PulsOut SCLK,1
    high CS
    Return
    ClearFast:
    low SDA
    high DC
    low CS
    For Loop1 = 1 To 48
    For loop3 = 1 To 84
    low SCLK
    high SCLK
    Next loop3
    Next Loop1
    Return
    GotoXY:
    ;Command = 1
    Value = X + 128
    GoSub CommandToLCD
    Value = Y + 64
    GoSub CommandToLCD
    Return
    Invert:
    ;Command = 1
    Value = 13
    GoSub CommandToLCD
    Return
     
    Normal:
    Value = 12
    GoSub CommandToLCD
    Return
     
    eeprom 0,(0x7E, 0x11, 0x11, 0x11, 0x7E) ; A
    eeprom (0x7F, 0x49, 0x49, 0x49, 0x36) ; B
    eeprom (0x3E, 0x41, 0x41, 0x41, 0x22) ; C
    eeprom (0x7F, 0x41, 0x41, 0x22, 0x1C) ; D
    eeprom (0x7F, 0x49, 0x49, 0x49, 0x41) ; E
    eeprom (0x7F, 0x09, 0x09, 0x09, 0x01) ; F
    eeprom (0x3E, 0x41, 0x49, 0x49, 0x7A) ; G
    eeprom (0x7F, 0x08, 0x08, 0x08, 0x7F) ; H
    eeprom (0x00, 0x41, 0x7F, 0x41, 0x00) ; I
    eeprom (0x20, 0x40, 0x41, 0x3F, 0x01) ; J
    eeprom (0x7F, 0x08, 0x14, 0x22, 0x41) ; K
    eeprom (0x7F, 0x40, 0x40, 0x40, 0x40) ; L
    eeprom (0x7F, 0x02, 0x0C, 0x02, 0x7F) ; M
    eeprom (0x7F, 0x04, 0x08, 0x10, 0x7F) ; N
    eeprom (0x3E, 0x41, 0x41, 0x41, 0x3E) ; O
    eeprom (0x7F, 0x09, 0x09, 0x09, 0x06) ; P
    eeprom (0x3E, 0x41, 0x51, 0x21, 0x5E) ; Q
    eeprom (0x7F, 0x09, 0x19, 0x29, 0x46) ; R
    eeprom (0x46, 0x49, 0x49, 0x49, 0x31) ; S
    eeprom (0x01, 0x01, 0x7F, 0x01, 0x01) ; T
    eeprom (0x3F, 0x40, 0x40, 0x40, 0x3F) ; U
    eeprom (0x1F, 0x20, 0x40, 0x20, 0x1F) ; V
    eeprom (0x3F, 0x40, 0x38, 0x40, 0x3F) ; W
    eeprom (0x63, 0x14, 0x08, 0x14, 0x63) ; X
    eeprom (0x07, 0x08, 0x70, 0x08, 0x07) ; Y
    eeprom (0x61, 0x51, 0x49, 0x45, 0x43) ; Z
    eeprom (0x00, 0x00, 0x2f, 0x00, 0x00) ; !
    eeprom (0x00, 0x07, 0x00, 0x07, 0x00) ; "
    eeprom (0x14, 0x7f, 0x14, 0x7f, 0x14) ; #
    eeprom (0x24, 0x2a, 0x7f, 0x2a, 0x12) ; $
    eeprom (0xc4, 0xc8, 0x10, 0x26, 0x46) ; %
    eeprom (0x36, 0x49, 0x55, 0x22, 0x50) ; &
    eeprom (0x00, 0x05, 0x03, 0x00, 0x00) ; '
    eeprom (0x00, 0x1c, 0x22, 0x41, 0x00) ; (
    eeprom (0x00, 0x41, 0x22, 0x1c, 0x00) ; )
    eeprom (0x14, 0x08, 0x3E, 0x08, 0x14) ; *
    eeprom (0x08, 0x08, 0x3E, 0x08, 0x08) ; +
    eeprom (0x00, 0x00, 0x50, 0x30, 0x00) ; ,
    eeprom (0x10, 0x10, 0x10, 0x10, 0x10) ; -
    eeprom (0x00, 0x60, 0x60, 0x00, 0x00) ; .
    eeprom (0x20, 0x10, 0x08, 0x04, 0x02) ; /
    eeprom (0x3E, 0x51, 0x49, 0x45, 0x3E) ; 0
    eeprom (0x00, 0x42, 0x7F, 0x40, 0x00) ; 1
    eeprom (0x42, 0x61, 0x51, 0x49, 0x46) ; 2
    eeprom (0x21, 0x41, 0x45, 0x4B, 0x31) ; 3
    eeprom (0x18, 0x14, 0x12, 0x7F, 0x10) ; 4
    eeprom (0x27, 0x45, 0x45, 0x45, 0x39) ; 5
    eeprom (0x3C, 0x4A, 0x49, 0x49, 0x30) ; 6
    eeprom (0x01, 0x71, 0x09, 0x05, 0x03) ; 7
    eeprom (0x36, 0x49, 0x49, 0x49, 0x36) ; 8
    eeprom (0x06, 0x49, 0x49, 0x29, 0x1E) ; 9
    ..and a pic taken with my iPhone of what is displayed :



    Hope this helps,
    Texy
    Last edited by Texy; 30-06-2008 at 10:52.

  8. #8
    Moderator
    Join Date
    Jan 1970
    Location
    North Norfolk blow-in.
    Posts
    6,000
    Blog Entries
    1

    Default

    Thanks for the code Texy.

    May I bug you with more questions please?

    1. Have you connected the Nokia directly to V+ and to the Picaxe outputs?

    2. Is there a capacitor between nokia pins 7 - 6, and if so, of what value?

    3. In your program, at lines 54 and 84, there is "gosub Normal"

    Should "normal:" be inserted at line 178?

    e
    Last edited by eclectic; 30-06-2008 at 09:48. Reason: Added another question

  9. #9
    Senior Member
    Join Date
    Jun 2008
    Location
    Newbury, Berks, UK
    Posts
    313

    Default

    Quote Originally Posted by eclectic View Post
    Thanks for the code Texy.

    May I bug you with more questions please?

    1. Have you connected the Nokia directly to V+ and to the Picaxe outputs?

    2. Is there a capacitor between nokia pins 7 - 6, and if so, of what value?

    3. In your program, at lines 54 and 84, there is "gosub Normal"

    Should "normal:" be inserted at line 178?

    e
    1.Yes - no series resistors either. The battery pack has gone from +5.5v down to 2.5volts and still working
    2.Yes - 10uF - I don't know if the value is critial, but when I first started play with the lcd, I didn't have one fitted at all - result : no output.
    3. My bad - I deleted some rem comments before posting and deleted that line by mistake - I,ve now editted it back in to the post.

    HTH
    Texy

  10. #10
    Moderator
    Join Date
    Jan 1970
    Location
    North Norfolk blow-in.
    Posts
    6,000
    Blog Entries
    1

    Default

    Thanks Texy.

    I'll have a play later on today.
    e

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •