LCD problem with 16F628


Closed Thread
Results 1 to 26 of 26

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: LCD problem with 16F628

    Your code says RS is PortB.4 while you say it's PortB.5.
    Your code says E us PortB.5 while you say it's PortB.6.

    /Henrik.

  2. #2
    Join Date
    Feb 2013
    Posts
    1,127


    Did you find this post helpful? Yes | No

    Default Re: LCD problem with 16F628

    Thanks, fixed that, but still does not works...

  3. #3
    Join Date
    Jul 2008
    Location
    TURKIYE-KONYA
    Posts
    51


    Did you find this post helpful? Yes | No

    Default Re: LCD problem with 16F628

    can you share your config settings?

  4. #4
    Join Date
    Feb 2013
    Posts
    1,127


    Did you find this post helpful? Yes | No

    Default Re: LCD problem with 16F628

    Code:
    ;----[16F628A Hardware Configuration]-------------------------------------------
    #IF __PROCESSOR__ = "16F628A"
      #DEFINE MCU_FOUND 1
    #CONFIG
    cfg = _INTOSC_OSC_NOCLKOUT    ; INTOSC oscillator: I/O function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN
    cfg&= _WDT_ON                 ; WDT enabled
    cfg&= _PWRTE_OFF              ; PWRT disabled
    cfg&= _MCLRE_OFF              ; RA5/MCLR/VPP pin function is digital input, MCLR internally tied to VDD
    cfg&= _BODEN_ON               ; BOD enabled
    cfg&= _LVP_OFF                ; RB4/PGM pin has digital I/O function, HV on MCLR must be used for programming
    cfg&= DATA_CP_OFF             ; Data memory code protection off
    cfg&= _CP_OFF                 ; Code protection off
      __CONFIG cfg
    
    #ENDCONFIG
    
    #ENDIF
    
    ;----[Verify Configs have been specified for Selected Processor]----------------
    ;       Note: Only include this routine once, after all #CONFIG blocks
    #IFNDEF MCU_FOUND
      #ERROR "No CONFIGs found for [" + __PROCESSOR__ +"]"
    #ENDIF
    
    Include "Modedefs.bas"
    PCON=%00001011 'set intosc to 4mhz
    DEFINE OSC 4
    DEFINE LCD_DREG PORTB
    DEFINE LCD_DBIT 0
    DEFINE LCD_RSREG PORTB
    DEFINE LCD_RSBIT 4
    DEFINE LCD_EREG PORTB
    DEFINE LCD_EBIT 5
    DEFINE LCD_BITS 4 
    DEFINE LCD_LINES 2
    DEFINE LCD_COMMANDUS 1500
    DEFINE LCD_DATAUS 44 
    pause 500
    
    LCDOUT $FE, "SACDELI   "
    PAUSE 5000
    END

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,645


    Did you find this post helpful? Yes | No

    Default Re: LCD problem with 16F628

    not suprised , it's certainly an odd use of the lcdout 254 directive
    Warning I'm not a teacher

  6. #6
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: LCD problem with 16F628

    Nice one Richard, don't know how I missed that!

  7. #7
    Join Date
    Feb 2013
    Posts
    1,127


    Did you find this post helpful? Yes | No

    Default Re: LCD problem with 16F628

    Haha thanks!
    Fixed it. But there were other issues too, MCU itself was also defective, replaced it, and everything works now just fine.

Similar Threads

  1. Newbie? Problem with LCD
    By lew247 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 7th December 2009, 19:48
  2. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  3. LCD Problem
    By karenhornby in forum General
    Replies: 3
    Last Post: - 19th June 2008, 11:43
  4. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07
  5. Gps with 16f628
    By dragons_fire in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 8th June 2006, 03:38

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