Whenever I run this in my 18F1320, I can read the data statement just fine but in place of 8's there are 3's. If I put in any other number it seems to work fine. I don't get it.
Thanks, Don
Code:
' Define LCD pins
Define LCD_DREG PORTA
Define LCD_DBIT 0
Define LCD_RSREG PORTA
Define LCD_RSBIT 4
Define LCD_EREG PORTB
Define LCD_EBIT 3
OSCCON = $60 ' Set up internal oscillator
x var byte
dtmf var byte
data @1,1,3,0,8,8,6,0,7,3,7,5
TRISB = %11010000
TRISA = %01100000
Pause 500 ' Wait 500mS for LCD to startup
LCDOut $fe, 1 ' Clear LCD screen
Pause 1 ' Wait 1 millisecond
LCDOut $fe,$80 ' Move cursor to the beginning of the first line
LCDOut "DTMF Demo using" ' Display
LCDOut $fe,$c0 ' Move cursor to the beginning of the second line
LCDOut "PIC18F1320" 'Display PIC Lecture
pause 1000
LCDOut $fe, 1 ' Clear LCD screen
LCDOut $fe,$80 ' Move cursor to the beginning of the first line
loop:
for x = 1 to 11
read x, dtmf
portb = dtmf
low portb.5
pause 100
high portb.5
pause 100
LCDOut DEC1(dtmf)
next x
pause 200
LCDOut $fe, 1 ' Clear LCD screen
pause 100
goto loop ' Do it forever
End
Bookmarks