What does your code look like? What pins is the LCD connected to? What are you using for an oscillator?
What does your code look like? What pins is the LCD connected to? What are you using for an oscillator?
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
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 ...
_______________________________________________
Did you configure your 18f458 correctly? Especially LVP_OFF! This was the mistake, i made.
Here is my code, check for the LCDPUTCHAR routine.
I'm sorry, I know that this is a PIC Basic forum thats why I hadn't posted my code In the first thread. Yes, I have a pullup on MCLR, and LVP is off. Here I have a picture of what my screen shows when my program tries to write "Hello world!!!"
May-be your clock speed is too high? PLL ON perhaps?
Try simulating your code in MPLAB. If this works OK, it's something in hardware. If not, you'll find the bug quickly.
Bookmarks