Char. LCD and 18F452 on 20 MHz not work


Results 1 to 12 of 12

Threaded View

  1. #8
    Join Date
    Jul 2008
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    My english is bad, sorry
    With this code problem is finish.

    Xtal = 20 MHz
    Osc Config = HS

    Need first code:
    Code:
    pause 1000
    LCDOUT $FE,1
    pause 500
    after initialising lcd:
    Code:
    LCDOUT $FE,1,"HELLO WORLD"
    But PAUSE and PAUSEUS working at value/5.

    Example:
    Code:
    PAUSE 5000
    working to 1 Second.

    I edited in "pbppic18.lib" also PAUSE problem is finish.
    with 4 MHz xtal pauseus macro.
    Code:
    ;****************************************************************
    ;* PAUSEUS    : Pause n microseconds at 4MHz                    *
    ;*                                                              *
    ;* Input      : R0 + 1, W = microseconds                        *
    ;* Output     : None                                            *
    ;*                                                              *
    ;* Notes      : minimum 19us                                    *
    ;****************************************************************
    
          if (OSC == 4)
      LIST
    PAUSEUS clrf	R0 + 1		; 1
    PAUSEUSL addlw	-23		; 1 Subtract overhead
                 movwf   R0                        ; 1
    	movlw	-4		; ********changed -1 to -4***********
    	bnc	pauseush	             ; 1 / 2
    	nop			; 1
    pauseusloop CLRWDT?NOP		; 1
    	addwf	R0, F		; 1
    	bc	pauseusloop	; 1 / 2
    	nop			; 1
    pauseush addwf	R0, F		; 1
    	decf	R0 + 1, F	; 1
    	bc	pauseusloop	; 1 / 2
    	btfsc	R0, 0		; 1 / 2
    	bra	$ + 2		; 2 / 0
    	btfss	R0, 1		; 1 / 2
    	bra	pauseusdone	; 2 / 0
    	bra	$ + 2		; 0 / 2
    	nop			; 0 / 1
    pauseusdone return		; 2 + 3 (call + setup)
      NOLIST
          endif
    Thanks for your interesting.

    Best regards.
    Last edited by samettin; - 27th July 2008 at 22:28.

Similar Threads

  1. 18F452 and 8-bit LCD
    By exelanoz in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th December 2009, 07:57
  2. with 40 MHZ osc serin2 not work
    By Pedro Santos in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 13th August 2006, 22:56
  3. Replies: 5
    Last Post: - 5th February 2006, 16:51
  4. How do I get DATA @ to work with a 18F452?
    By jessey in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 2nd February 2006, 10:35
  5. 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

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