Gday All
Well i now have my 4 line LCD working, but now dont know why.
( And that hurts more )
I tried using a 16F84a as well as the prior chips and this also worked perfectly with both LCDs, it was still only the 16F88 with the 4 line LCD that failed
After several hours of frustration, i was grabbing at straws, so tried to forcibly reset the ANSEL register to 31 ( for the 16F88 chip ) and everything started working.
All this does is set RB6 and RB7 to digital, and hence should have no effect that is different between LCDs, but it does.
My test code is
--------------------------------
INCLUDE "modedefs.bas"
Voltage VAR WORD
DEFINE LCD_DREG PORTB ' Setup LCD 2x20 in 4 byte mode
DEFINE LCD_DBIT 4 ' R/S on B.3, E on B.2
DEFINE LCD_RSREG PORTB ' Data on B.4 - B.7
DEFINE LCD_RSBIT 3
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 2
DEFINE LCD_BITS 4
DEFINE LCD_LINES 4 '4 line lcd mode ( but 2x16 works just as well???? )
DEFINE OSC 4 '
ANSEL = 31 ' force RB6 and RB7 digital (16F88 only)
Pause 1000 ' Wait 1 second
Voltage = 0
Lcdout $fe, 1 ' Clear LCD screen
loop
Lcdout $fe, $C0, "Testing ", DEC Voltage, " "
voltage = voltage + 1
pause 1000
goto loop
end
---------------------
I can get it to work, but dont know why.
Is there a bug in the 16F88 preprocessing, or is something else happening, because i cannot figure it out now.
Andrew




Bookmarks