I've been using the following program to test a problem i've been having with an lcd display.
it seems the following program only displays on the lcd if it's been programmed from an epic programmer, if i use the mcloader the board flashes but nothing is displayed on the lcd.
Device = 18F458
Clock = 20
// some LCD options...
#option LCD_DATA = PORTD.4
#option LCD_RS = PORTB.4
#option LCD_EN = PORTB.5
// import LCD library...
Include "LCD.bas"
Include "utils.bas"
// program start...
SetAllDigital
TRISA.4 = 0
DelayMS(1000)
Cls
WriteAt(1,1,"Hello World")
While TRUE
PORTA.4 = Not PORTA.4
DelayMS(1000)
Wend
End
Any ideas?
Richard
boot loader problem
Moderators: David Barker, Jerry Messina
It will not solve the problem, but i'd spotted a slight problem in the SetAllDigital command
CMCON setting is O.K, but ADCON1 should be 7.
Using ADCON1=$0F leaves AN3, AN2, AN0 to analog
So just modify your code to...
I don't have any handy 18F458... so can't check, but it worked with a 18F452
So as Bruce said, double check that your LVP mode is disabled (wich is enabled by default), HS mode is selected and that you're using the 20MHz bootloader firmware.
Code: Select all
I103_F1_000014 ; L#MK SETALLDIGITAL
104_F5_000445 ; L#MK ADCON1 = $0F
MOVLW 15
MOVWF ADCON1,0
I105_F5_000446 ; L#MK CMCON = $07
MOVLW 7
MOVWF CMCON,0
Using ADCON1=$0F leaves AN3, AN2, AN0 to analog
So just modify your code to...
Code: Select all
Device = 18F458
Clock = 20
// some LCD options...
#option LCD_DATA = PORTD.4
#option LCD_RS = PORTB.4
#option LCD_EN = PORTB.5
// import LCD library...
Include "LCD.bas"
Include "utils.bas"
// program start...
ADCON1=7
CMCON=7
TRISA.4 = 0
DelayMS(1000)
Cls
WriteAt(1,1,"Test2...")
While TRUE
PORTA.4 = Not PORTA.4
DelayMS(1000)
Wend
End
So as Bruce said, double check that your LVP mode is disabled (wich is enabled by default), HS mode is selected and that you're using the 20MHz bootloader firmware.
thanks it worked
yep that cured it.
the 248,258,448 and 458 all have the same problems in any osc speed inc the newest 40mhz ones.
Will these be updated with a compiler update?
thanks a lot for the help.
the 248,258,448 and 458 all have the same problems in any osc speed inc the newest 40mhz ones.
Will these be updated with a compiler update?
thanks a lot for the help.
Hmmm..