Problems with 18F458


Results 1 to 19 of 19

Threaded View

  1. #3
    Join Date
    Aug 2005
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    I use a 4 Mhz crystal as osc. and I use PORTB as output, this is what my code looks like, I have included the library for LCD in the txt file:

    LIST p=18F458 ;tell assembler what chip we are using
    include "p18f458.inc" ;include the defaults for the chip
    ERRORLEVEL 0, -302 ;suppress bank selection messages

    cblock 0x20 ;start of general purpose registers
    ;LCD
    count ;used in looping routines
    count1 ;used in delay routine
    counta ;used in delay routine
    countb ;used in delay routine
    tmp1 ;temporary storage
    tmp2 templcd ;temp store for 4 bit mode
    templcd2

    endc

    LCD_PORT Equ PORTB
    LCD_TRIS Equ TRISB
    LCD_RS Equ 0x04
    LCD_RW Equ 0x06
    LCD_E Equ 0x07


    ;--------Program-------------------


    SetPorts
    movlw 0x00 ;make all pins outputs
    movwf LCD_TRIS ;wait for LCD to settle
    call Delay100
    call LCD_Init ;setup LCD
    call LCD_CurOff

    ld
    call LCD_Line1
    movlw 'H'
    call LCD_Char
    movlw 'e'
    call LCD_Char
    movlw 'l'
    call LCD_Char
    movlw 'l'
    call LCD_Char
    movlw 'o'
    call LCD_Char
    movlw ' '
    call LCD_Char
    movlw 'W'
    call LCD_Char
    movlw 'o'
    call LCD_Char
    movlw 'r'
    call LCD_Char
    movlw 'l'
    call LCD_Char
    movlw 'd'
    call LCD_Char
    movlw '!'
    call LCD_Char
    movlw '!'
    call LCD_Char
    movlw '!'
    call LCD_Char

    endprg goto endprg


    include <lcd.lib>


    ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    end
    Attached Files Attached Files

Similar Threads

  1. Problems programming
    By Lionheart in forum General
    Replies: 4
    Last Post: - 7th December 2008, 16:51
  2. bootloader Freqout problems
    By handgio in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 5th December 2007, 13:38
  3. Problems with PORTD on 18F658
    By blainecf in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 13th June 2006, 17:32
  4. Problems with 16F876 on interrupts an WRITE / READ
    By BigWumpus in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th December 2005, 14:38
  5. USART problems
    By egberttheone in forum mel PIC BASIC Pro
    Replies: 47
    Last Post: - 6th March 2005, 21:45

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