16f88 can't get lcd to work


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302


    Did you find this post helpful? Yes | No

    Default

    try this
    Code:
        PAUSE 500
        
    loop:  
      
        Lcdout $fe, 1,"Hello" ' Display Hello
        Pause 2000
        Lcdout $fe, 1,"John"
        Pause 2000
        goto loop

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


    Did you find this post helpful? Yes | No

    Default Give This A Try

    Hi John,
    Try this, I couldn't get the config fuses right for mpasm, but I was able to get them right for the default assembler. it should work keyword should.
    JS


    Code:
    @ DEVICE MCLR_OFF, XT_OSC, WDT_OFF, LVP_OFF, BOD_OFF, PWRT_ON, PROTECT_OFF
    DEFINE OSC 4 ' XT osc
    DEFINE LCD_DREG PORTB
    DEFINE LCD_DBIT 4
    DEFINE LCD_RSREG PORTB
    DEFINE LCD_RSBIT 3
    DEFINE LCD_EREG PORTB
    DEFINE LCD_EBIT 2
    DEFINE LCD_BITS 4
    ' Set number of lines on LCD
    DEFINE LCD_LINES 2
    DEFINE LCD_COMMANDUS 2000
    ' Set data delay time in us
    DEFINE LCD_DATAUS 100
    
    TRISB=%00000000                            ' all portb to output
    TRISA=%00000000                            ' all porta to output
    ADCON1 = 7 ' or ADCON1 = %00000111 'Disable A/D converter
    ANSEL=%00000000 ' set all analog pins to digital
    CMCON=7
    main
    pause 2000
    Lcdout $fe, 1, "Hello" ' Display Hello
    pause 1000 
    LCDOUT $FE,1,"John"
    goto main
    END
    Last edited by Archangel; - 12th December 2006 at 07:53.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Joe
    The MPASM config fuses are in the p16f88.inc file in the Microchip\MPASM suite folder
    Code:
    _CONFIG1                    EQU     H'2007'
    _CONFIG2                    EQU     H'2008'
    
    ;Configuration Byte 1 Options
    _CP_ALL                      EQU     H'1FFF'
    _CP_OFF	                     EQU     H'3FFF'
    _CCP1_RB0		    		 EQU     H'3FFF'
    _CCP1_RB3                    EQU     H'2FFF'
    _DEBUG_OFF                   EQU     H'3FFF'
    _DEBUG_ON                    EQU     H'37FF'
    _WRT_PROTECT_OFF             EQU     H'3FFF'	;No program memory write protection
    _WRT_PROTECT_256             EQU     H'3DFF'	;First 256 program memory protected
    _WRT_PROTECT_2048            EQU     H'3BFF'	;First 2048 program memory protected
    _WRT_PROTECT_ALL             EQU     H'39FF'	;All of program memory protected
    _CPD_ON                      EQU     H'3EFF'
    _CPD_OFF                     EQU     H'3FFF'
    _LVP_ON                      EQU     H'3FFF'
    _LVP_OFF                     EQU     H'3F7F'
    _BODEN_ON                    EQU     H'3FFF'
    _BODEN_OFF                   EQU     H'3FBF'
    _MCLR_ON		   		     EQU     H'3FFF'
    _MCLR_OFF                    EQU     H'3FDF'
    _PWRTE_OFF                   EQU     H'3FFF'
    _PWRTE_ON                    EQU     H'3FF7'
    _WDT_ON                      EQU     H'3FFF'
    _WDT_OFF                     EQU     H'3FFB'
    _EXTRC_CLKOUT		    	 EQU     H'3FFF'
    _EXTRC_IO		    		 EQU     H'3FFE'
    _INTRC_CLKOUT                EQU     H'3FFD'
    _INTRC_IO		    		 EQU     H'3FFC'
    _EXTCLK			    		 EQU     H'3FEF'
    _HS_OSC                      EQU     H'3FEE'
    _XT_OSC                      EQU     H'3FED'
    _LP_OSC                      EQU     H'3FEC'
    
    ;Configuration Byte 2 Options
    _IESO_ON                     EQU     H'3FFF'
    _IESO_OFF                    EQU     H'3FFD'
    _FCMEN_ON                    EQU     H'3FFF'
    _FCMEN_OFF                   EQU     H'3FFE'
    AND NEVER EVER END A PROGRAM WITH A SINGLE END STATEMENT... use STOP OR an endless loop

    Here we don't know if the user use an external or want to use the internal OSC...
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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


    Did you find this post helpful? Yes | No

    Default you right boss!

    Quote Originally Posted by mister_e
    Joe . . .

    AND NEVER EVER END A PROGRAM WITH A SINGLE <h1>END</h1> STATEMENT... use STOP OR an endless loop

    ...
    Sorry about that mister_e, it got by me on the fourth paste, I had installed a goto main and then did a repaste and, oops left it out. As for mpasm config fuses . . . I kept getting errors using this format
    Code:
    @ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _LVP_OFF & _BODEN_ON
    but not this exact code. I have edited above post.
    JS
    Last edited by Archangel; - 12th December 2006 at 07:54.

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Yeah F88 is a bit like some 18F, try something around those bellow
    Code:
        '
        '    Pic Configuration
        '    =================
        '    Program Configuration Register 1
        @	__CONFIG    _CONFIG1, _CP_OFF & _CCP1_RB0 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_ON & _MCLR_OFF & _PWRTE_ON & _WDT_OFF & _INTRC_IO		    		 
    
        '    Program Configuration Register 2
        @   __CONFIG    _CONFIG2, _IESO_OFF & _FCMEN_OFF
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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


    Did you find this post helpful? Yes | No

    Default 16f88

    Hi Mister_e,
    The 16F88 seems to be extra labor intensive and not suitable for newbies, as it has so many registers that require you to set and other little quirks, there are several open posts this month by people (like myself) who are a little short on experience, that are having trouble with this device. I think they would do better with a 16F628a / 648a or 16F876 / 877 etc. At least until they get their sealegs.

  7. #7
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S.
    Hi Mister_e,
    The 16F88 seems to be extra labor intensive and not suitable for newbies, as it has so many registers that require you to set and other little quirks, there are several open posts this month by people (like myself) who are a little short on experience, that are having trouble with this device. I think they would do better with a 16F628a / 648a or 16F876 / 877 etc. At least until they get their sealegs.
    To some extent that comment may be true but as the 16F88 is so versatile you can use it for many different projects so will quickly learn its quirks.

    I was using 16F628 for 18pin projects and 16F877 for 40 pin projects.

    I am now using 16F88 and 18F452.

    My 40 pin project outgrew the capabilities of the 877 and my reason for getting started with the F88 was because it can be bootloaded. A real boon for developing code
    Keith

    www.diyha.co.uk
    www.kat5.tv

Similar Threads

  1. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  2. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07
  3. Why doesn't my code for 18f452 work on 18f252?
    By senojlr in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 23rd December 2005, 02:42
  4. Can't get LCD to work with 16F88
    By jswayze in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 10th September 2004, 11:05
  5. 4 line LCD with 16F88
    By anj in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 7th February 2004, 09:06

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