2x16 lcd problem


Results 1 to 12 of 12

Threaded View

  1. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by k3v1nP View Post
    Still the same went as high as 500. Also put in a PAUSE of 900 before first lcd out. I don't think it can be a busted lcd cause i have 4 and they all do the same thing. Unless this model is just junk.
    DATAUS is a byte value. Go to 500, and you may as well go to 244 (figured this out the hard way awhile back, not mentioned in the book, but good to know).
    Try the pause value up to a couple of seconds...some really are that slow...
    Also, double, nay, triple check your wiring...Make sure you've got the connector on the 'right way'.
    And put a 'heartbeat LED' in there...
    Code:
    CLEAR				;Define LCD registers and control bits
    DEFINE OSC  4			;System speed
    DEFINE LCD_DREG PORTD 	;data register
    DEFINE LCD_BITS 4 		;width of data path
    DEFINE LCD_DBIT 0		;data starts on bit 0
    DEFINE LCD_RSREG PORTE 	;select register 
    DEFINE LCD_RSBIT 0 		;select bit
    DEFINE LCD_EREG PORTE 	;enable register
    DEFINE LCD_EBIT 1 		;enable bit
    DEFINE LCD_RWREG PORTE 	;read/write register
    DEFINE LCD_RWBIT 2 		;read/write bit
    LOW PORTE.2 			;LCD R/W low (write) We will do no reading
    DEFINE LCD_LINES 2 		;lines in display
    DEFINE LCD_COMMANDUS 4000 	;delay in micro seconds
    DEFINE LCD_DATAUS 200 		;delay in micro seconds				; 
    ;Set the port directions. We are setting (must set) all of PORTD and all of PORTE as outputs
    ;even though PORTE has only 3 lines. The other 5 lines will be ignored by the system.
    				; 
    TRISD = %00000000 		; set all PORTD lines to output
    LED VAR PORTD.7
    OUTPUT LED
    TEMP VAR BYTE
    TRISE = %00000000 		; set all PORTE lines to output 
    				; Set the Analog to Digital control register
    ADCON1=%00000111 		; needed for the 16F877A see note above and below
    				; 
    PAUSE 2000
    LOOP:				; The main loop of the program
    TEMP = TEMP + 1
    LED = TEMP.0
    LCDOUT $FE, 1 			; clear screen
    PAUSE 500			; pause 0.25 seconds
    LCDOUT "HELLO" 			; print
    LCDOUT $FE, $C0 		; goto second line, first position
    LCDOUT "WORLD" 		; print
    PAUSE 250 			; pause 0.25 seconds
    GOTO LOOP 			; repeat
    END				; always end all programs with an END statement

    EDIT: Oh yeah, that schematic is jacked up...
    Example schematic and/or program is in the PBP manual...
    Last edited by skimask; - 28th October 2008 at 18:17. Reason: EDIT: Added Mr_E's FIX as noted below :D

Similar Threads

  1. LCD problem with 16F628
    By ngeronikolos in forum mel PIC BASIC Pro
    Replies: 25
    Last Post: - 19th September 2016, 09:28
  2. 2x16 lcd not working with pic16f72
    By vu2iia in forum Schematics
    Replies: 4
    Last Post: - 16th February 2011, 15:59
  3. Newbie? Problem with LCD
    By lew247 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 7th December 2009, 20:48
  4. LCD Problem
    By karenhornby in forum General
    Replies: 3
    Last Post: - 19th June 2008, 12:43
  5. Problem with 2x16 LCD on 16F630
    By Falcon in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 10th June 2005, 04:25

Members who have read this thread : 0

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

Posting Permissions

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