Problems with 18F458


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    Aug 2005
    Posts
    12

    Unhappy Problems with 18F458

    Hi everyone, I hope I can get some help on this great forum! =)

    I have recently moved from PIC16F18 to PIC18F458, and I have remade one of my old programs for testing with the new processor. The program is supposed to write som text on a standart HD44780 LCD, and it worked fine on the 16F84. When I now connect my LCD to 18F458, the screen shows the last to symbols of the text string in the start of line 1, the screen also flickers in a wierd way, and the cursor is blinking, although I turn it off in the program. Sometimes when I get my fingers close to the processor, or the quartz crystal the screen goes baserk and starts writing some nonsense on both lines (still flickering). I don't know whats worng, since I have everything correctly connected and everything. I don't think, that it could be the program, because I tried with the simpliest thing (two flashing LED's) and it also worked out kindda wierd...Any ideas? Thanks, any help will be appreciated!

    Regards Denis

  2. #2


    Did you find this post helpful? Yes | No

    Default

    What does your code look like? What pins is the LCD connected to? What are you using for an oscillator?

  3. #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

  4. #4
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Russian,

    Do you have a pullup resistor on MCLR ?

    And hey, this is a PICBASIC Forum !
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  5. #5


    Did you find this post helpful? Yes | No

    Default

    Sorry but assembly is greek to me.

  6. #6
    Join Date
    Sep 2004
    Location
    Tallinn, Estonia
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    Did you configure your 18f458 correctly? Especially LVP_OFF! This was the mistake, i made.
    Here is my code, check for the LCDPUTCHAR routine.
    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