lumex 4 line display


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2007
    Posts
    16

    Thumbs down lumex 4 line display

    Has anyone ever used a lumex four line display? I am trying to connect the 18f14k50 to it in 4-bit bus mode and all i get on the output is the second and the fourth lines completly dark and nothing on the first and third lines. The setup code for the registers and stuff is below. PLease let me know if im missing anything. The part number for the display is LCM-So1604DSF. Any help would be greatly appreciated.

  2. #2
    Join Date
    Jan 2007
    Posts
    16


    Did you find this post helpful? Yes | No

    Default sorry forgot the code

    \\code\\
    '************************** Configuration Registers ****************************
    @__CONFIG _CONFIG1H, _FOSC_XT_1H & _IESO_ON_1H ; Set for an External Crystal
    @__CONFIG _CONFIG2L, _PWRTEN_ON_2L & _BOREN_ON_2L ; Brown out detect set for OFF, Power On Timer set for OFF
    @__CONFIG _CONFIG2H, _WDTEN_OFF_2H ; WDT set for OFF
    @__CONFIG _CONFIG3H, _MCLRE_OFF_3H ; MCLR is disabled
    '@__CONFIG _CONFIG5L, _CP0_ON_5L & _CP1_ON_5L ' Code Protect Blocks 0-1 is enabled
    '@__CONFIG _CONFIG6L, _WRT0_ON_6L & _WRT1_ON_6L ' Write Protect Blocks 0-1 is enabled
    WDTCON = %00000000 ' Assures the WDT is disabled
    '************************** Configuration Registers ****************************

    '''''''''''''''''''''''''''''' Microchip Definitions '''''''''''''''''''''''''''
    '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''
    include "modedefs.bas"
    DEFINE OSC 4
    DEFINE SER2_BITS 9
    DEFINE ADC_BITS 10 ' set number of bits in result
    DEFINE ADC_CLOCK 5 ' set clock source
    DEFINE ADC_SAMPLEUS 50 ' set sampling time for microseconds
    DEFINE LCD_DREG PORTC ' set LCD DATA port
    DEFINE LCD_DBIT 0 ' set starting DATA bit (0 or 4) if 4-bit
    DEFINE LCD_RSREG PORTC ' Set LCD Register Select port
    DEFINE LCD_RSBIT 7 ' Set LCD Register Select bit
    DEFINE LCD_EREG PORTB ' Set LCD Enable port
    DEFINE LCD_EBIT 6 ' Set LCD Enable bit
    DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits)
    DEFINE LCD_LINES 4 ' Set number of lines on LCD
    DEFINE LCD_COMMANDUS 20 ' Set command delay time in us
    DEFINE LCD_DATAUS 10 ' Set data delay time in us
    '''''''''''''''''''''''''''''' Microchip Definitions '''''''''''''''''''''''''''
    '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''

    ''''''''''''''''''''''''''' Register Definitions '''''''''''''''''''''''''''''''
    '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''
    TRISA = %00011011 ' Register A has 4 buttons(UP,SET,FNC,open)
    TRISB = %10000000 ' Register B has 1 button(DN)
    TRISC = %00010000 ' Register C is all outputs(LCD Control)
    PORTA = %00000000 ' Initialize all registers to zero
    PORTB = %00000000
    PORTC = %00000000
    INTCON = %00000000 ' No Interupts on programmer software
    CCP1CON = %00001100
    OSCCON = %01011100
    OSCCON2 = %00000111 ' Setup the PWM module for single output on RC5
    ''''''''''''''''''''''''''' Register Definitions '''''''''''''''''''''''''''''''
    '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''


    ''''''''''''''''''''''''''' Variable Declarations ''''''''''''''''''''''''''''''
    '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''

    'INPUTS AND OUTPUTS
    UP_BUTTON VAR PORTA.0 'PIN 19 (A0)
    SET_BUTTON VAR PORTC.4 'PIN 6 (A2)
    FUNCTION_BUTTON VAR PORTA.3 'PIN 4 (A3)
    COMM_OUT VAR PORTB.4 'PIN 13
    DOWN_BUTTON VAR PORTB.7 'PIN 10 (A1)
    REMOTE_FNC_RESET VAR PORTB.5 'PIN 12
    'LCD_DRIVE var PORTC.5

    'SETTINGS SET BY USER (PROGRAMMER)
    DUTY VAR WORD ' LCD CONTRAST SETTING (EEPROM - 2 & 3)
    TEST1_PROG_NUM VAR BYTE
    TEST1_OPERATING_PRESSURE VAR BYTE
    TEST1_PSI_DIFF VAR BYTE
    TEST1_CYCLE_TIME VAR BYTE
    TEST1_STABIL_TIME VAR BYTE
    TEST1_MAX_FILL_TIME VAR BYTE
    TEST1_MIN_PSI_PERCENT VAR BYTE
    TEST2_PROG_NUM VAR BYTE
    TEST2_OPERATING_PRESSURE VAR BYTE
    TEST2_PSI_DIFF VAR BYTE
    TEST2_CYCLE_TIME VAR BYTE
    TEST2_STABIL_TIME VAR BYTE
    TEST2_MAX_FILL_TIME VAR BYTE
    TEST2_MIN_PSI_PERCENT VAR BYTE

    'SOFTWARE VARIABLES
    TEST1_CHECKSUM VAR WORD ' USED TO MAKE SURE DATA WAS SENT WITH NO ERROR
    TEST2_CHECKSUM VAR WORD
    A0 VAR BYTE ' Byte Variables for Button Inputs
    A1 VAR BYTE
    A2 VAR BYTE
    A3 VAR BYTE
    i VAR BYTE
    DEBUG_VALUE var byte
    ''''''''''''''''''''''''''' Variable Declarations ''''''''''''''''''''''''''''''
    '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''


    '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''
    '''''''''''''''''''''''LCD Display Configuration''''''''''''''''''''''''''''''''

    ' 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32
    DATA 0, 0, 0, 100, 0, 0, 0, 0, 10, 1, 1, 1, 1, 10, 10, 1, 1, 1, 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data @ 224, "S","P","V","_","S","L","A","M","D","U","N","K","2 ","_","R","0","0"

    T2CON = %00000101 ' Turn on Timer2, Prescale=4

    '' Use formula to determine PR2 value for a 1KHz signal,
    '' 4MHz clock, and prescale=4. (4E6/(4*4*1E3))-1=249

    PR2 = 249 ' Set PR2 to get 1KHz out

    '' Use formula to determine CCPR1L:CCP1CON<5:4> value for
    '' ends of range 20% to 80%. (249+1)*4*0.2=200 (20% value)
    '' (249+1)*4*0.8=800 (80% value)
    READ 2, DUTY.HIGHBYTE
    READ 3, DUTY.LowBYTE
    Pause 10
    DUTY = DUTY
    CCP1CON.4 = duty.0 ' Store duty to registers as
    CCP1CON.5 = duty.1 ' a 10-bit word
    CCPR1L = DUTY >> 2
    duty = duty + 10 ' Increase duty cycle

    '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''
    '''''''''''''''''''''''LCD Display Configuration''''''''''''''''''''''''''''''''


    '-------------------------Program Starts Here-----------------------------------
    '-------------------------------------------------------------------------------

    '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''
    '''''''''''''''''''''''''Start Up Procedure'''''''''''''''''''''''''''''''''''''
    INITIALIZE:
    A0 = %00000000
    A1 = %00000000
    A2 = %00000000
    A3 = %00000000
    TEST1_PROG_NUM = 1
    TEST2_PROG_NUM = 2
    pause 500

    RUN_START_SCREEN:
    GOSUB CLEAR_LCD
    LCDOUT $FE, $80, "Spartan SPV"
    LCDOUT $FE, $C0, "Slamdunk 2"
    LCDOUT $FE, $94, " "
    LCDOUT $FE, $D4, " "
    \\code\\

  3. #3
    Join Date
    Aug 2007
    Posts
    4


    Did you find this post helpful? Yes | No

    Default

    I just spent a couple of hours with the same problem using a 4x20 chars LCD. In my case the problem was that the LCD R/W pin was floating instead of being pulled low. I just tied it to GND and voila!, it worked.
    Check this.
    JM

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    I just flailed about for a couple of hours with some really simple code to find my PIC has a couple of bad ports, a new PIC all was well.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I have a four line display that gave trouble. I did this to make it work.
    Code:
    DEFINE LCD_COMMANDUS    3000
    DEFINE LCD_DATAUS   150
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 9th December 2008, 00:40
  2. DS1820 display with 7-seg 4 digits
    By chai98a in forum Code Examples
    Replies: 12
    Last Post: - 10th April 2008, 14:12
  3. Replies: 14
    Last Post: - 26th September 2007, 06:41
  4. Simple 4 line LCD display with 18F4550
    By pic-ker in forum Code Examples
    Replies: 4
    Last Post: - 9th April 2007, 03:58
  5. having problems with Hantronix 20x4 lcd
    By Rhatidbwoy in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 22nd December 2005, 13:22

Members who have read this thread : 1

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

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